diff --git a/.changelog/16d61271f560423abf192a9d93731ca0.json b/.changelog/16d61271f560423abf192a9d93731ca0.json new file mode 100644 index 00000000000..51e8e208bbe --- /dev/null +++ b/.changelog/16d61271f560423abf192a9d93731ca0.json @@ -0,0 +1,8 @@ +{ + "id": "16d61271-f560-423a-bf19-2a9d93731ca0", + "type": "feature", + "description": "This release introduces a new feature for Audit Manager: Evidence finder. You can now use evidence finder to quickly query your evidence, and add the matching evidence results to an assessment report.", + "modules": [ + "service/auditmanager" + ] +} \ No newline at end of file diff --git a/.changelog/182c88f192ee45d193d2ccaec425c934.json b/.changelog/182c88f192ee45d193d2ccaec425c934.json new file mode 100644 index 00000000000..d2760373337 --- /dev/null +++ b/.changelog/182c88f192ee45d193d2ccaec425c934.json @@ -0,0 +1,8 @@ +{ + "id": "182c88f1-92ee-45d1-93d2-ccaec425c934", + "type": "feature", + "description": "CloudFront API support for staging distributions and associated traffic management policies.", + "modules": [ + "service/cloudfront" + ] +} \ No newline at end of file diff --git a/.changelog/1dbb29ae2fc84ba494128df80f940fd6.json b/.changelog/1dbb29ae2fc84ba494128df80f940fd6.json new file mode 100644 index 00000000000..419e30cc840 --- /dev/null +++ b/.changelog/1dbb29ae2fc84ba494128df80f940fd6.json @@ -0,0 +1,8 @@ +{ + "id": "1dbb29ae-2fc8-4ba4-9412-8df80f940fd6", + "type": "feature", + "description": "AppFlow provides a new API called UpdateConnectorRegistration to update a custom connector that customers have previously registered. With this API, customers no longer need to unregister and then register a connector to make an update.", + "modules": [ + "service/appflow" + ] +} \ No newline at end of file diff --git a/.changelog/2150e257be15421a95961da8226c833b.json b/.changelog/2150e257be15421a95961da8226c833b.json new file mode 100644 index 00000000000..9d55d5f7ca1 --- /dev/null +++ b/.changelog/2150e257be15421a95961da8226c833b.json @@ -0,0 +1,8 @@ +{ + "id": "2150e257-be15-421a-9596-1da8226c833b", + "type": "feature", + "description": "Added DisableProfiler flag as a new field in ProfilerConfig", + "modules": [ + "service/sagemaker" + ] +} \ No newline at end of file diff --git a/.changelog/2387f355e2ad4eea9eeb0e2619d76639.json b/.changelog/2387f355e2ad4eea9eeb0e2619d76639.json new file mode 100644 index 00000000000..b96a8a8cfa4 --- /dev/null +++ b/.changelog/2387f355e2ad4eea9eeb0e2619d76639.json @@ -0,0 +1,8 @@ +{ + "id": "2387f355-e2ad-4eea-9eeb-0e2619d76639", + "type": "feature", + "description": "AWS IoT RoboRunner is a new service that makes it easy to build applications that help multi-vendor robots work together seamlessly. See the IoT RoboRunner developer guide for more details on getting started. https://docs.aws.amazon.com/iotroborunner/latest/dev/iotroborunner-welcome.html", + "modules": [ + "service/iotroborunner" + ] +} \ No newline at end of file diff --git a/.changelog/27adcefc351c48d4823f87b141ccd315.json b/.changelog/27adcefc351c48d4823f87b141ccd315.json new file mode 100644 index 00000000000..849556dda68 --- /dev/null +++ b/.changelog/27adcefc351c48d4823f87b141ccd315.json @@ -0,0 +1,8 @@ +{ + "id": "27adcefc-351c-48d4-823f-87b141ccd315", + "type": "feature", + "description": "Adds a NONE encryption algorithm type to AS2 connectors, providing support for skipping encryption of the AS2 message body when a HTTPS URL is also specified.", + "modules": [ + "service/transfer" + ] +} \ No newline at end of file diff --git a/.changelog/33d6fa2c259a4ec29401274faadc9ab8.json b/.changelog/33d6fa2c259a4ec29401274faadc9ab8.json new file mode 100644 index 00000000000..fa6c4105ebe --- /dev/null +++ b/.changelog/33d6fa2c259a4ec29401274faadc9ab8.json @@ -0,0 +1,8 @@ +{ + "id": "33d6fa2c-259a-4ec2-9401-274faadc9ab8", + "type": "feature", + "description": "This release 1. adds support for Principal Name Sharing with Service Catalog portfolio sharing. 2. Introduces repo sourced products which are created and managed with existing SC APIs. These products are synced to external repos and auto create new product versions based on changes in the repo.", + "modules": [ + "service/servicecatalog" + ] +} \ No newline at end of file diff --git a/.changelog/3f21cf45e5634773b7c9e9f8bf84361d.json b/.changelog/3f21cf45e5634773b7c9e9f8bf84361d.json new file mode 100644 index 00000000000..1d43c34e88f --- /dev/null +++ b/.changelog/3f21cf45e5634773b7c9e9f8bf84361d.json @@ -0,0 +1,8 @@ +{ + "id": "3f21cf45-e563-4773-b7c9-e9f8bf84361d", + "type": "documentation", + "description": "Updated minor fixes for DynamoDB documentation.", + "modules": [ + "service/dynamodbstreams" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..be4ef249d9c --- /dev/null +++ b/.changelog/41575353444b40ffbf474f4155544f00.json @@ -0,0 +1,9 @@ +{ + "id": "41575353-444b-40ff-bf47-4f4155544f00", + "type": "release", + "description": "New AWS service client module", + "modules": [ + "service/chimesdkvoice", + "service/iotroborunner" + ] +} \ No newline at end of file diff --git a/.changelog/6b464c8618f7417e8c5cbf4da8db1d8c.json b/.changelog/6b464c8618f7417e8c5cbf4da8db1d8c.json new file mode 100644 index 00000000000..f5641aee81e --- /dev/null +++ b/.changelog/6b464c8618f7417e8c5cbf4da8db1d8c.json @@ -0,0 +1,8 @@ +{ + "id": "6b464c86-18f7-417e-8c5c-bf4da8db1d8c", + "type": "feature", + "description": "Added AllowedAccessControlTags and TagRestrictedResource for Tag Based Access Control on Amazon Connect Webpage", + "modules": [ + "service/connect" + ] +} \ No newline at end of file diff --git a/.changelog/82cc487fa19e4b67ac19aef91f0980a1.json b/.changelog/82cc487fa19e4b67ac19aef91f0980a1.json new file mode 100644 index 00000000000..1fcee32088f --- /dev/null +++ b/.changelog/82cc487fa19e4b67ac19aef91f0980a1.json @@ -0,0 +1,8 @@ +{ + "id": "82cc487f-a19e-4b67-ac19-aef91f0980a1", + "type": "feature", + "description": "This release adds the following: 1) Asset management for centralized assets governance 2) QuickSight Q now supports public embedding 3) New Termination protection flag to mitigate accidental deletes 4) Athena data sources now accept a custom IAM role 5) QuickSight supports connectivity to Databricks", + "modules": [ + "service/quicksight" + ] +} \ No newline at end of file diff --git a/.changelog/91661ba090e1485aa94978d060f74982.json b/.changelog/91661ba090e1485aa94978d060f74982.json new file mode 100644 index 00000000000..1205c0e0584 --- /dev/null +++ b/.changelog/91661ba090e1485aa94978d060f74982.json @@ -0,0 +1,8 @@ +{ + "id": "91661ba0-90e1-485a-a949-78d060f74982", + "type": "feature", + "description": "This release adds support for copying an Amazon Machine Image's tags when copying an AMI.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/ac6e50bb9fce43e599a00c5aad2a17b4.json b/.changelog/ac6e50bb9fce43e599a00c5aad2a17b4.json new file mode 100644 index 00000000000..ab6837844ad --- /dev/null +++ b/.changelog/ac6e50bb9fce43e599a00c5aad2a17b4.json @@ -0,0 +1,8 @@ +{ + "id": "ac6e50bb-9fce-43e5-99a0-0c5aad2a17b4", + "type": "feature", + "description": "Amazon Chime Voice Connector, Voice Connector Group and PSTN Audio Service APIs are now available in the Amazon Chime SDK Voice namespace. See https://docs.aws.amazon.com/chime-sdk/latest/dg/sdk-available-regions.html for more details.", + "modules": [ + "service/chimesdkvoice" + ] +} \ No newline at end of file diff --git a/.changelog/b1439df5cce041d0ac0045af77969d07.json b/.changelog/b1439df5cce041d0ac0045af77969d07.json new file mode 100644 index 00000000000..cc40b4c0e9f --- /dev/null +++ b/.changelog/b1439df5cce041d0ac0045af77969d07.json @@ -0,0 +1,8 @@ +{ + "id": "b1439df5-cce0-41d0-ac00-45af77969d07", + "type": "feature", + "description": "AWS Systems Manager for SAP provides simplified operations and management of SAP applications such as SAP HANA. With this release, SAP customers and partners can automate and simplify their SAP system administration tasks such as backup/restore of SAP HANA.", + "modules": [ + "service/ssmsap" + ] +} \ No newline at end of file diff --git a/.changelog/b4eee0fbf7d9415bb22b7b5edcd80f88.json b/.changelog/b4eee0fbf7d9415bb22b7b5edcd80f88.json new file mode 100644 index 00000000000..fca33329e33 --- /dev/null +++ b/.changelog/b4eee0fbf7d9415bb22b7b5edcd80f88.json @@ -0,0 +1,8 @@ +{ + "id": "b4eee0fb-f7d9-415b-b22b-7b5edcd80f88", + "type": "feature", + "description": "This release adds support for using Step Functions service integrations to invoke any cross-account AWS resource, even if that service doesn't support resource-based policies or cross-account calls. See https://docs.aws.amazon.com/step-functions/latest/dg/concepts-access-cross-acct-resources.html", + "modules": [ + "service/sfn" + ] +} \ No newline at end of file diff --git a/.changelog/e53a4b13f9804b969e96d045a9ad7f95.json b/.changelog/e53a4b13f9804b969e96d045a9ad7f95.json new file mode 100644 index 00000000000..f04d7284b19 --- /dev/null +++ b/.changelog/e53a4b13f9804b969e96d045a9ad7f95.json @@ -0,0 +1,8 @@ +{ + "id": "e53a4b13-f980-4b96-9e96-d045a9ad7f95", + "type": "documentation", + "description": "Updated minor fixes for DynamoDB documentation.", + "modules": [ + "service/dynamodb" + ] +} \ No newline at end of file diff --git a/.changelog/ee84b8ab3b394852a80a08b9f348b387.json b/.changelog/ee84b8ab3b394852a80a08b9f348b387.json new file mode 100644 index 00000000000..51a0e5f7ec3 --- /dev/null +++ b/.changelog/ee84b8ab3b394852a80a08b9f348b387.json @@ -0,0 +1,8 @@ +{ + "id": "ee84b8ab-3b39-4852-a80a-08b9f348b387", + "type": "feature", + "description": "AWSGlue Crawler - Adding support for Table and Column level Comments with database level datatypes for JDBC based crawler.", + "modules": [ + "service/glue" + ] +} \ No newline at end of file diff --git a/service/appflow/api_op_RegisterConnector.go b/service/appflow/api_op_RegisterConnector.go index 1fa964fa86c..67e15359eff 100644 --- a/service/appflow/api_op_RegisterConnector.go +++ b/service/appflow/api_op_RegisterConnector.go @@ -11,8 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Registers a new connector with your Amazon Web Services account. Before you can -// register the connector, you must deploy lambda in your account. +// Registers a new custom connector with your Amazon Web Services account. Before +// you can register the connector, you must deploy the associated AWS lambda +// function in your account. func (c *Client) RegisterConnector(ctx context.Context, params *RegisterConnectorInput, optFns ...func(*Options)) (*RegisterConnectorOutput, error) { if params == nil { params = &RegisterConnectorInput{} diff --git a/service/appflow/api_op_UnregisterConnector.go b/service/appflow/api_op_UnregisterConnector.go index 84896ba1610..cb44c13f84b 100644 --- a/service/appflow/api_op_UnregisterConnector.go +++ b/service/appflow/api_op_UnregisterConnector.go @@ -11,7 +11,7 @@ import ( ) // Unregisters the custom connector registered in your account that matches the -// connectorLabel provided in the request. +// connector label provided in the request. func (c *Client) UnregisterConnector(ctx context.Context, params *UnregisterConnectorInput, optFns ...func(*Options)) (*UnregisterConnectorOutput, error) { if params == nil { params = &UnregisterConnectorInput{} diff --git a/service/appflow/api_op_UpdateConnectorRegistration.go b/service/appflow/api_op_UpdateConnectorRegistration.go new file mode 100644 index 00000000000..3f0cfd2935f --- /dev/null +++ b/service/appflow/api_op_UpdateConnectorRegistration.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package appflow + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/appflow/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a custom connector that you've previously registered. This operation +// updates the connector with one of the following: +// +// * The latest version of the +// AWS Lambda function that's assigned to the connector +// +// * A new AWS Lambda +// function that you specify +func (c *Client) UpdateConnectorRegistration(ctx context.Context, params *UpdateConnectorRegistrationInput, optFns ...func(*Options)) (*UpdateConnectorRegistrationOutput, error) { + if params == nil { + params = &UpdateConnectorRegistrationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateConnectorRegistration", params, optFns, c.addOperationUpdateConnectorRegistrationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateConnectorRegistrationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateConnectorRegistrationInput struct { + + // The name of the connector. The name is unique for each connector registration in + // your AWS account. + // + // This member is required. + ConnectorLabel *string + + // Contains information about the configuration of the connector being registered. + ConnectorProvisioningConfig *types.ConnectorProvisioningConfig + + // A description about the update that you're applying to the connector. + Description *string + + noSmithyDocumentSerde +} + +type UpdateConnectorRegistrationOutput struct { + + // The ARN of the connector being updated. + ConnectorArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateConnectorRegistrationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateConnectorRegistration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateConnectorRegistration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateConnectorRegistrationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateConnectorRegistration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateConnectorRegistration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "appflow", + OperationName: "UpdateConnectorRegistration", + } +} diff --git a/service/appflow/deserializers.go b/service/appflow/deserializers.go index ec74ae081c8..379785d7a26 100644 --- a/service/appflow/deserializers.go +++ b/service/appflow/deserializers.go @@ -3220,6 +3220,181 @@ func awsRestjson1_deserializeOpDocumentUpdateConnectorProfileOutput(v **UpdateCo return nil } +type awsRestjson1_deserializeOpUpdateConnectorRegistration struct { +} + +func (*awsRestjson1_deserializeOpUpdateConnectorRegistration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateConnectorRegistration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateConnectorRegistration(response, &metadata) + } + output := &UpdateConnectorRegistrationOutput{} + 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_deserializeOpDocumentUpdateConnectorRegistrationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateConnectorRegistration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ConnectorAuthenticationException", errorCode): + return awsRestjson1_deserializeErrorConnectorAuthenticationException(response, errorBody) + + case strings.EqualFold("ConnectorServerException", errorCode): + return awsRestjson1_deserializeErrorConnectorServerException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateConnectorRegistrationOutput(v **UpdateConnectorRegistrationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateConnectorRegistrationOutput + if *v == nil { + sv = &UpdateConnectorRegistrationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "connectorArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ARN to be of type string, got %T instead", value) + } + sv.ConnectorArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpUpdateFlow struct { } diff --git a/service/appflow/generated.json b/service/appflow/generated.json index b26eafef92a..cb64814d6bc 100644 --- a/service/appflow/generated.json +++ b/service/appflow/generated.json @@ -29,6 +29,7 @@ "api_op_UnregisterConnector.go", "api_op_UntagResource.go", "api_op_UpdateConnectorProfile.go", + "api_op_UpdateConnectorRegistration.go", "api_op_UpdateFlow.go", "deserializers.go", "doc.go", diff --git a/service/appflow/serializers.go b/service/appflow/serializers.go index 1a49fa39ec4..959aa8e8e1a 100644 --- a/service/appflow/serializers.go +++ b/service/appflow/serializers.go @@ -1656,6 +1656,86 @@ func awsRestjson1_serializeOpDocumentUpdateConnectorProfileInput(v *UpdateConnec return nil } +type awsRestjson1_serializeOpUpdateConnectorRegistration struct { +} + +func (*awsRestjson1_serializeOpUpdateConnectorRegistration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateConnectorRegistration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateConnectorRegistrationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/update-connector-registration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateConnectorRegistrationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateConnectorRegistrationInput(v *UpdateConnectorRegistrationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateConnectorRegistrationInput(v *UpdateConnectorRegistrationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectorLabel != nil { + ok := object.Key("connectorLabel") + ok.String(*v.ConnectorLabel) + } + + if v.ConnectorProvisioningConfig != nil { + ok := object.Key("connectorProvisioningConfig") + if err := awsRestjson1_serializeDocumentConnectorProvisioningConfig(v.ConnectorProvisioningConfig, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + return nil +} + type awsRestjson1_serializeOpUpdateFlow struct { } diff --git a/service/appflow/types/types.go b/service/appflow/types/types.go index 5336140133e..8e7cf875e02 100644 --- a/service/appflow/types/types.go +++ b/service/appflow/types/types.go @@ -2053,8 +2053,8 @@ type SalesforceSourceProperties struct { // REST_SYNC Amazon AppFlow uses only Salesforce REST API. By choosing this option, // you ensure that your flow writes consistent output, but you decrease performance // for large data transfers that are better suited for Bulk API 2.0. In some cases, - // if your flow attempts to transfer a vary large set of data, it might fail with a - // timed out error. + // if your flow attempts to transfer a vary large set of data, it might fail wituh + // a timed out error. DataTransferApi SalesforceDataTransferApi // The flag that enables dynamic fetching of new (recently added) fields in the diff --git a/service/appflow/validators.go b/service/appflow/validators.go index 5331e165693..658afe009e3 100644 --- a/service/appflow/validators.go +++ b/service/appflow/validators.go @@ -330,6 +330,26 @@ func (m *validateOpUpdateConnectorProfile) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpUpdateConnectorRegistration struct { +} + +func (*validateOpUpdateConnectorRegistration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateConnectorRegistration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateConnectorRegistrationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateConnectorRegistrationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateFlow struct { } @@ -414,6 +434,10 @@ func addOpUpdateConnectorProfileValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpUpdateConnectorProfile{}, middleware.After) } +func addOpUpdateConnectorRegistrationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateConnectorRegistration{}, middleware.After) +} + func addOpUpdateFlowValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateFlow{}, middleware.After) } @@ -2336,6 +2360,26 @@ func validateOpUpdateConnectorProfileInput(v *UpdateConnectorProfileInput) error } } +func validateOpUpdateConnectorRegistrationInput(v *UpdateConnectorRegistrationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateConnectorRegistrationInput"} + if v.ConnectorLabel == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectorLabel")) + } + if v.ConnectorProvisioningConfig != nil { + if err := validateConnectorProvisioningConfig(v.ConnectorProvisioningConfig); err != nil { + invalidParams.AddNested("ConnectorProvisioningConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateFlowInput(v *UpdateFlowInput) error { if v == nil { return nil diff --git a/service/auditmanager/api_op_BatchImportEvidenceToAssessmentControl.go b/service/auditmanager/api_op_BatchImportEvidenceToAssessmentControl.go index 8852a06f24f..49f316772da 100644 --- a/service/auditmanager/api_op_BatchImportEvidenceToAssessmentControl.go +++ b/service/auditmanager/api_op_BatchImportEvidenceToAssessmentControl.go @@ -12,7 +12,28 @@ import ( ) // Uploads one or more pieces of evidence to a control in an Audit Manager -// assessment. +// assessment. You can upload manual evidence from any Amazon Simple Storage +// Service (Amazon S3) bucket by specifying the S3 URI of the evidence. You must +// upload manual evidence to your S3 bucket before you can upload it to your +// assessment. For instructions, see CreateBucket +// (https://docs.aws.amazon.com/AmazonS3/latest/API/API_CreateBucket.html) and +// PutObject (https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutObject.html) +// in the Amazon Simple Storage Service API Reference. The following restrictions +// apply to this action: +// +// * Maximum size of an individual evidence file: 100 MB +// +// * +// Number of daily manual evidence uploads per control: 100 +// +// * Supported file +// formats: See Supported file types for manual evidence +// (https://docs.aws.amazon.com/audit-manager/latest/userguide/upload-evidence.html#supported-manual-evidence-files) +// in the Audit Manager User Guide +// +// For more information about Audit Manager +// service restrictions, see Quotas and restrictions for Audit Manager +// (https://docs.aws.amazon.com/audit-manager/latest/userguide/service-quotas.html). func (c *Client) BatchImportEvidenceToAssessmentControl(ctx context.Context, params *BatchImportEvidenceToAssessmentControlInput, optFns ...func(*Options)) (*BatchImportEvidenceToAssessmentControlOutput, error) { if params == nil { params = &BatchImportEvidenceToAssessmentControlInput{} diff --git a/service/auditmanager/api_op_CreateAssessmentReport.go b/service/auditmanager/api_op_CreateAssessmentReport.go index 8b3b627ae3b..7742825d20c 100644 --- a/service/auditmanager/api_op_CreateAssessmentReport.go +++ b/service/auditmanager/api_op_CreateAssessmentReport.go @@ -42,6 +42,23 @@ type CreateAssessmentReportInput struct { // The description of the assessment report. Description *string + // A SQL statement that represents an evidence finder query. Provide this parameter + // when you want to generate an assessment report from the results of an evidence + // finder search query. When you use this parameter, Audit Manager generates a + // one-time report using only the evidence from the query output. This report does + // not include any assessment evidence that was manually added to a report using + // the console + // (https://docs.aws.amazon.com/userguide/generate-assessment-report.html#generate-assessment-report-include-evidence), + // or associated with a report using the API + // (https://docs.aws.amazon.com/APIReference-evidenceFinder/API_BatchAssociateAssessmentReportEvidence.html). + // To use this parameter, the enablementStatus + // (https://docs.aws.amazon.com/APIReference-evidenceFinder/API_EvidenceFinderSetup.html#auditmanager-Type-EvidenceFinderSetup-enablementStatus) + // of evidence finder must be ENABLED. For examples and help resolving + // queryStatement validation exceptions, see Troubleshooting evidence finder issues + // (https://docs.aws.amazon.com/audit-manager/latest/userguide/evidence-finder-issues.html#querystatement-exceptions) + // in the AWS Audit Manager User Guide. + QueryStatement *string + noSmithyDocumentSerde } diff --git a/service/auditmanager/api_op_DeregisterOrganizationAdminAccount.go b/service/auditmanager/api_op_DeregisterOrganizationAdminAccount.go index 22ef7eda2dd..70f419a2745 100644 --- a/service/auditmanager/api_op_DeregisterOrganizationAdminAccount.go +++ b/service/auditmanager/api_op_DeregisterOrganizationAdminAccount.go @@ -16,13 +16,27 @@ import ( // previously collected under that account. This is also the case when you // deregister a delegated administrator from Organizations. However, Audit Manager // will stop collecting and attaching evidence to that delegated administrator -// account moving forward. When you deregister a delegated administrator account -// for Audit Manager, the data for that account isn’t deleted. If you want to -// delete resource data for a delegated administrator account, you must perform -// that task separately before you deregister the account. Either, you can do this -// in the Audit Manager console. Or, you can use one of the delete API operations -// that are provided by Audit Manager. To delete your Audit Manager resource data, -// see the following instructions: +// account moving forward. Keep in mind the following cleanup task if you use +// evidence finder: Before you use your management account to remove a delegated +// administrator, make sure that the current delegated administrator account signs +// in to Audit Manager and disables evidence finder first. Disabling evidence +// finder automatically deletes the event data store that was created in their +// account when they enabled evidence finder. If this task isn’t completed, the +// event data store remains in their account. In this case, we recommend that the +// original delegated administrator goes to CloudTrail Lake and manually deletes +// the event data store +// (https://docs.aws.amazon.com/userguide/awscloudtrail/latest/userguide/query-eds-disable-termination.html). +// This cleanup task is necessary to ensure that you don't end up with multiple +// event data stores. Audit Manager will ignore an unused event data store after +// you remove or change a delegated administrator account. However, the unused +// event data store continues to incur storage costs from CloudTrail Lake if you +// don't delete it. When you deregister a delegated administrator account for Audit +// Manager, the data for that account isn’t deleted. If you want to delete resource +// data for a delegated administrator account, you must perform that task +// separately before you deregister the account. Either, you can do this in the +// Audit Manager console. Or, you can use one of the delete API operations that are +// provided by Audit Manager. To delete your Audit Manager resource data, see the +// following instructions: // // * DeleteAssessment // (https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeleteAssessment.html) diff --git a/service/auditmanager/api_op_GetServicesInScope.go b/service/auditmanager/api_op_GetServicesInScope.go index fbba82ae066..e170b12184a 100644 --- a/service/auditmanager/api_op_GetServicesInScope.go +++ b/service/auditmanager/api_op_GetServicesInScope.go @@ -11,7 +11,12 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Returns a list of the in-scope Amazon Web Services for the specified assessment. +// Returns a list of all of the Amazon Web Services that you can choose to include +// in your assessment. When you create an assessment +// (https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_CreateAssessment.html), +// specify which of these services you want to include to narrow the assessment's +// scope +// (https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_Scope.html). func (c *Client) GetServicesInScope(ctx context.Context, params *GetServicesInScopeInput, optFns ...func(*Options)) (*GetServicesInScopeOutput, error) { if params == nil { params = &GetServicesInScopeInput{} diff --git a/service/auditmanager/api_op_UpdateSettings.go b/service/auditmanager/api_op_UpdateSettings.go index 5e99e2fe14b..59b4cf75f3d 100644 --- a/service/auditmanager/api_op_UpdateSettings.go +++ b/service/auditmanager/api_op_UpdateSettings.go @@ -35,6 +35,20 @@ type UpdateSettingsInput struct { // A list of the default audit owners. DefaultProcessOwners []types.Role + // Specifies whether the evidence finder feature is enabled. Change this attribute + // to enable or disable evidence finder. When you use this attribute to disable + // evidence finder, Audit Manager deletes the event data store that’s used to query + // your evidence data. As a result, you can’t re-enable evidence finder and use the + // feature again. Your only alternative is to deregister + // (https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_DeregisterAccount.html) + // and then re-register + // (https://docs.aws.amazon.com/audit-manager/latest/APIReference/API_RegisterAccount.html) + // Audit Manager. Disabling evidence finder is permanent, so consider this decision + // carefully before you proceed. If you’re using Audit Manager as a delegated + // administrator, keep in mind that this action applies to all member accounts in + // your organization. + EvidenceFinderEnabled *bool + // The KMS key details. KmsKey *string diff --git a/service/auditmanager/deserializers.go b/service/auditmanager/deserializers.go index 7d30bb47f20..48f4aceb0cb 100644 --- a/service/auditmanager/deserializers.go +++ b/service/auditmanager/deserializers.go @@ -13172,6 +13172,73 @@ func awsRestjson1_deserializeDocumentEvidenceAttributes(v *map[string]string, va return nil } +func awsRestjson1_deserializeDocumentEvidenceFinderEnablement(v **types.EvidenceFinderEnablement, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.EvidenceFinderEnablement + if *v == nil { + sv = &types.EvidenceFinderEnablement{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "backfillStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EvidenceFinderBackfillStatus to be of type string, got %T instead", value) + } + sv.BackfillStatus = types.EvidenceFinderBackfillStatus(jtv) + } + + case "enablementStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EvidenceFinderEnablementStatus to be of type string, got %T instead", value) + } + sv.EnablementStatus = types.EvidenceFinderEnablementStatus(jtv) + } + + case "error": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Error = ptr.String(jtv) + } + + case "eventDataStoreArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CloudTrailArn to be of type string, got %T instead", value) + } + sv.EventDataStoreArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentEvidenceIds(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14174,6 +14241,15 @@ func awsRestjson1_deserializeDocumentResource(v **types.Resource, value interfac sv.Arn = ptr.String(jtv) } + case "complianceCheck": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ComplianceCheck = ptr.String(jtv) + } + case "value": if value != nil { jtv, ok := value.(string) @@ -14581,6 +14657,11 @@ func awsRestjson1_deserializeDocumentSettings(v **types.Settings, value interfac return err } + case "evidenceFinderEnablement": + if err := awsRestjson1_deserializeDocumentEvidenceFinderEnablement(&sv.EvidenceFinderEnablement, value); err != nil { + return err + } + case "isAwsOrgEnabled": if value != nil { jtv, ok := value.(bool) diff --git a/service/auditmanager/serializers.go b/service/auditmanager/serializers.go index 11577bad1f8..e2e88f3ac0f 100644 --- a/service/auditmanager/serializers.go +++ b/service/auditmanager/serializers.go @@ -819,6 +819,11 @@ func awsRestjson1_serializeOpDocumentCreateAssessmentReportInput(v *CreateAssess ok.String(*v.Name) } + if v.QueryStatement != nil { + ok := object.Key("queryStatement") + ok.String(*v.QueryStatement) + } + return nil } @@ -4337,6 +4342,11 @@ func awsRestjson1_serializeOpDocumentUpdateSettingsInput(v *UpdateSettingsInput, } } + if v.EvidenceFinderEnabled != nil { + ok := object.Key("evidenceFinderEnabled") + ok.Boolean(*v.EvidenceFinderEnabled) + } + if v.KmsKey != nil { ok := object.Key("kmsKey") ok.String(*v.KmsKey) diff --git a/service/auditmanager/types/enums.go b/service/auditmanager/types/enums.go index af6365fce70..6931b071b6c 100644 --- a/service/auditmanager/types/enums.go +++ b/service/auditmanager/types/enums.go @@ -207,6 +207,49 @@ func (DelegationStatus) Values() []DelegationStatus { } } +type EvidenceFinderBackfillStatus string + +// Enum values for EvidenceFinderBackfillStatus +const ( + EvidenceFinderBackfillStatusNotStarted EvidenceFinderBackfillStatus = "NOT_STARTED" + EvidenceFinderBackfillStatusInProgress EvidenceFinderBackfillStatus = "IN_PROGRESS" + EvidenceFinderBackfillStatusCompleted EvidenceFinderBackfillStatus = "COMPLETED" +) + +// Values returns all known values for EvidenceFinderBackfillStatus. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (EvidenceFinderBackfillStatus) Values() []EvidenceFinderBackfillStatus { + return []EvidenceFinderBackfillStatus{ + "NOT_STARTED", + "IN_PROGRESS", + "COMPLETED", + } +} + +type EvidenceFinderEnablementStatus string + +// Enum values for EvidenceFinderEnablementStatus +const ( + EvidenceFinderEnablementStatusEnabled EvidenceFinderEnablementStatus = "ENABLED" + EvidenceFinderEnablementStatusDisabled EvidenceFinderEnablementStatus = "DISABLED" + EvidenceFinderEnablementStatusEnableInProgress EvidenceFinderEnablementStatus = "ENABLE_IN_PROGRESS" + EvidenceFinderEnablementStatusDisableInProgress EvidenceFinderEnablementStatus = "DISABLE_IN_PROGRESS" +) + +// Values returns all known values for EvidenceFinderEnablementStatus. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (EvidenceFinderEnablementStatus) Values() []EvidenceFinderEnablementStatus { + return []EvidenceFinderEnablementStatus{ + "ENABLED", + "DISABLED", + "ENABLE_IN_PROGRESS", + "DISABLE_IN_PROGRESS", + } +} + type FrameworkType string // Enum values for FrameworkType @@ -292,6 +335,7 @@ const ( SettingAttributeSnsTopic SettingAttribute = "SNS_TOPIC" SettingAttributeDefaultAssessmentReportsDestination SettingAttribute = "DEFAULT_ASSESSMENT_REPORTS_DESTINATION" SettingAttributeDefaultProcessOwners SettingAttribute = "DEFAULT_PROCESS_OWNERS" + SettingAttributeEvidenceFinderEnablement SettingAttribute = "EVIDENCE_FINDER_ENABLEMENT" ) // Values returns all known values for SettingAttribute. Note that this can be @@ -304,6 +348,7 @@ func (SettingAttribute) Values() []SettingAttribute { "SNS_TOPIC", "DEFAULT_ASSESSMENT_REPORTS_DESTINATION", "DEFAULT_PROCESS_OWNERS", + "EVIDENCE_FINDER_ENABLEMENT", } } diff --git a/service/auditmanager/types/types.go b/service/auditmanager/types/types.go index f9762ac689b..e51f901c5b6 100644 --- a/service/auditmanager/types/types.go +++ b/service/auditmanager/types/types.go @@ -382,14 +382,14 @@ type AssessmentReport struct { noSmithyDocumentSerde } -// An error entity for the AssessmentReportEvidence API. This is used to provide +// An error entity for assessment report evidence errors. This is used to provide // more meaningful errors than a simple string message. type AssessmentReportEvidenceError struct { - // The error code that the AssessmentReportEvidence API returned. + // The error code that was returned. ErrorCode *string - // The error message that the AssessmentReportEvidence API returned. + // The error message that was returned. ErrorMessage *string // The identifier for the evidence. @@ -552,8 +552,8 @@ type Control struct { // The data mapping sources for the control. ControlMappingSources []ControlMappingSource - // The data source that determines where Audit Manager collects evidence from for - // the control. + // The data source types that determine where Audit Manager collects evidence from + // for the control. ControlSources *string // Specifies when the control was created. @@ -955,10 +955,22 @@ type Evidence struct { // organization path. AwsOrganization *string - // The evaluation status for evidence that falls under the compliance check - // category. For evidence collected from Security Hub, a Pass or Fail result is - // shown. For evidence collected from Config, a Compliant or Noncompliant result is - // shown. + // The evaluation status for automated evidence that falls under the compliance + // check category. + // + // * Audit Manager classes evidence as non-compliant if Security + // Hub reports a Fail result, or if Config reports a Non-compliant result. + // + // * Audit + // Manager classes evidence as compliant if Security Hub reports a Pass result, or + // if Config reports a Compliant result. + // + // * If a compliance check isn't available + // or applicable, then no compliance evaluation can be made for that evidence. This + // is the case if the evidence uses Config or Security Hub as the underlying data + // source type, but those services aren't enabled. This is also the case if the + // evidence uses an underlying data source type that doesn't support compliance + // checks (such as manual evidence, Amazon Web Services API calls, or CloudTrail). ComplianceCheck *string // The data source where the evidence was collected from. @@ -995,6 +1007,59 @@ type Evidence struct { noSmithyDocumentSerde } +// The settings object that specifies whether evidence finder is enabled. This +// object also describes the related event data store, and the backfill status for +// populating the event data store with evidence data. +type EvidenceFinderEnablement struct { + + // The current status of the evidence data backfill process. The backfill starts + // after you enable evidence finder. During this task, Audit Manager populates an + // event data store with your past evidence data so that your evidence can be + // queried. + // + // * NOT_STARTED means that the backfill hasn’t started yet. + // + // * + // IN_PROGRESS means that the backfill is in progress. This can take up to 24 hours + // to complete, depending on the amount of evidence data. + // + // * COMPLETED means that + // the backfill is complete. All of your past evidence is now queryable. + BackfillStatus EvidenceFinderBackfillStatus + + // The current status of the evidence finder feature and the related event data + // store. + // + // * ENABLE_IN_PROGRESS means that you requested to enable evidence finder. + // An event data store is currently being created to support evidence finder + // queries. + // + // * ENABLED means that an event data store was successfully created and + // evidence finder is enabled. We recommend that you wait 24 hours until the event + // data store is backfilled with your past evidence data. You can use evidence + // finder in the meantime, but not all data might be available until the backfill + // is complete. + // + // * DISABLE_IN_PROGRESS means that you requested to disable evidence + // finder, and your request is pending the deletion of the event data store. + // + // * + // DISABLED means that you have permanently disabled evidence finder and the event + // data store has been deleted. You can't re-enable evidence finder after this + // point. + EnablementStatus EvidenceFinderEnablementStatus + + // Represents any errors that occurred when enabling or disabling evidence finder. + Error *string + + // The Amazon Resource Name (ARN) of the CloudTrail Lake event data store that’s + // used by evidence finder. The event data store is the lake of evidence data that + // evidence finder runs queries against. + EventDataStoreArn *string + + noSmithyDocumentSerde +} + // A breakdown of the latest compliance check status for the evidence in your Audit // Manager assessments. type EvidenceInsights struct { @@ -1245,6 +1310,25 @@ type Resource struct { // The Amazon Resource Name (ARN) for the resource. Arn *string + // The evaluation status for a resource that was assessed when collecting + // compliance check evidence. + // + // * Audit Manager classes the resource as + // non-compliant if Security Hub reports a Fail result, or if Config reports a + // Non-compliant result. + // + // * Audit Manager classes the resource as compliant if + // Security Hub reports a Pass result, or if Config reports a Compliant result. + // + // * + // If a compliance check isn't available or applicable, then no compliance + // evaluation can be made for that resource. This is the case if a resource + // assessment uses Config or Security Hub as the underlying data source type, but + // those services aren't enabled. This is also the case if the resource assessment + // uses an underlying data source type that doesn't support compliance checks (such + // as manual evidence, Amazon Web Services API calls, or CloudTrail). + ComplianceCheck *string + // The value of the resource. Value *string @@ -1313,6 +1397,9 @@ type Settings struct { // The designated default audit owners. DefaultProcessOwners []Role + // The current evidence finder status and event data store details. + EvidenceFinderEnablement *EvidenceFinderEnablement + // Specifies whether Organizations is enabled. IsAwsOrgEnabled *bool @@ -1385,11 +1472,7 @@ type SourceKeyword struct { // keywordValue: Custom_CustomRuleForAccount-conformance-pack // // * Service-linked - // rule name: securityhub-api-gw-cache-encrypted-101104e1 keywordValue: - // Custom_securityhub-api-gw-cache-encrypted - // - // * Service-linked rule name: - // OrgConfigRule-s3-bucket-versioning-enabled-dbgzf8ba keywordValue: + // rule name: OrgConfigRule-s3-bucket-versioning-enabled-dbgzf8ba keywordValue: // Custom_OrgConfigRule-s3-bucket-versioning-enabled KeywordValue *string diff --git a/service/chimesdkvoice/LICENSE.txt b/service/chimesdkvoice/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/chimesdkvoice/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/chimesdkvoice/api_client.go b/service/chimesdkvoice/api_client.go new file mode 100644 index 00000000000..2d5b9ab6ed5 --- /dev/null +++ b/service/chimesdkvoice/api_client.go @@ -0,0 +1,434 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "Chime SDK Voice" +const ServiceAPIVersion = "2022-08-03" + +// Client provides the API client to make operations call for Amazon Chime SDK +// Voice. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "chimesdkvoice", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/chimesdkvoice/api_client_test.go b/service/chimesdkvoice/api_client_test.go new file mode 100644 index 00000000000..6cfec58ad98 --- /dev/null +++ b/service/chimesdkvoice/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/chimesdkvoice/api_op_AssociatePhoneNumbersWithVoiceConnector.go b/service/chimesdkvoice/api_op_AssociatePhoneNumbersWithVoiceConnector.go new file mode 100644 index 00000000000..a5d3e83010e --- /dev/null +++ b/service/chimesdkvoice/api_op_AssociatePhoneNumbersWithVoiceConnector.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) AssociatePhoneNumbersWithVoiceConnector(ctx context.Context, params *AssociatePhoneNumbersWithVoiceConnectorInput, optFns ...func(*Options)) (*AssociatePhoneNumbersWithVoiceConnectorOutput, error) { + if params == nil { + params = &AssociatePhoneNumbersWithVoiceConnectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociatePhoneNumbersWithVoiceConnector", params, optFns, c.addOperationAssociatePhoneNumbersWithVoiceConnectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociatePhoneNumbersWithVoiceConnectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociatePhoneNumbersWithVoiceConnectorInput struct { + + // This member is required. + E164PhoneNumbers []string + + // This member is required. + VoiceConnectorId *string + + ForceAssociate *bool + + noSmithyDocumentSerde +} + +type AssociatePhoneNumbersWithVoiceConnectorOutput struct { + PhoneNumberErrors []types.PhoneNumberError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociatePhoneNumbersWithVoiceConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociatePhoneNumbersWithVoiceConnector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociatePhoneNumbersWithVoiceConnector{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAssociatePhoneNumbersWithVoiceConnectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociatePhoneNumbersWithVoiceConnector(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssociatePhoneNumbersWithVoiceConnector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "AssociatePhoneNumbersWithVoiceConnector", + } +} diff --git a/service/chimesdkvoice/api_op_AssociatePhoneNumbersWithVoiceConnectorGroup.go b/service/chimesdkvoice/api_op_AssociatePhoneNumbersWithVoiceConnectorGroup.go new file mode 100644 index 00000000000..c60ba323996 --- /dev/null +++ b/service/chimesdkvoice/api_op_AssociatePhoneNumbersWithVoiceConnectorGroup.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) AssociatePhoneNumbersWithVoiceConnectorGroup(ctx context.Context, params *AssociatePhoneNumbersWithVoiceConnectorGroupInput, optFns ...func(*Options)) (*AssociatePhoneNumbersWithVoiceConnectorGroupOutput, error) { + if params == nil { + params = &AssociatePhoneNumbersWithVoiceConnectorGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociatePhoneNumbersWithVoiceConnectorGroup", params, optFns, c.addOperationAssociatePhoneNumbersWithVoiceConnectorGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociatePhoneNumbersWithVoiceConnectorGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociatePhoneNumbersWithVoiceConnectorGroupInput struct { + + // This member is required. + E164PhoneNumbers []string + + // This member is required. + VoiceConnectorGroupId *string + + ForceAssociate *bool + + noSmithyDocumentSerde +} + +type AssociatePhoneNumbersWithVoiceConnectorGroupOutput struct { + PhoneNumberErrors []types.PhoneNumberError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociatePhoneNumbersWithVoiceConnectorGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociatePhoneNumbersWithVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociatePhoneNumbersWithVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpAssociatePhoneNumbersWithVoiceConnectorGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociatePhoneNumbersWithVoiceConnectorGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssociatePhoneNumbersWithVoiceConnectorGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "AssociatePhoneNumbersWithVoiceConnectorGroup", + } +} diff --git a/service/chimesdkvoice/api_op_BatchDeletePhoneNumber.go b/service/chimesdkvoice/api_op_BatchDeletePhoneNumber.go new file mode 100644 index 00000000000..8320b8f703b --- /dev/null +++ b/service/chimesdkvoice/api_op_BatchDeletePhoneNumber.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) BatchDeletePhoneNumber(ctx context.Context, params *BatchDeletePhoneNumberInput, optFns ...func(*Options)) (*BatchDeletePhoneNumberOutput, error) { + if params == nil { + params = &BatchDeletePhoneNumberInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchDeletePhoneNumber", params, optFns, c.addOperationBatchDeletePhoneNumberMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchDeletePhoneNumberOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchDeletePhoneNumberInput struct { + + // This member is required. + PhoneNumberIds []string + + noSmithyDocumentSerde +} + +type BatchDeletePhoneNumberOutput struct { + PhoneNumberErrors []types.PhoneNumberError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchDeletePhoneNumberMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchDeletePhoneNumber{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchDeletePhoneNumber{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchDeletePhoneNumberValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchDeletePhoneNumber(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchDeletePhoneNumber(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "BatchDeletePhoneNumber", + } +} diff --git a/service/chimesdkvoice/api_op_BatchUpdatePhoneNumber.go b/service/chimesdkvoice/api_op_BatchUpdatePhoneNumber.go new file mode 100644 index 00000000000..b683b6dec3f --- /dev/null +++ b/service/chimesdkvoice/api_op_BatchUpdatePhoneNumber.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) BatchUpdatePhoneNumber(ctx context.Context, params *BatchUpdatePhoneNumberInput, optFns ...func(*Options)) (*BatchUpdatePhoneNumberOutput, error) { + if params == nil { + params = &BatchUpdatePhoneNumberInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "BatchUpdatePhoneNumber", params, optFns, c.addOperationBatchUpdatePhoneNumberMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*BatchUpdatePhoneNumberOutput) + out.ResultMetadata = metadata + return out, nil +} + +type BatchUpdatePhoneNumberInput struct { + + // This member is required. + UpdatePhoneNumberRequestItems []types.UpdatePhoneNumberRequestItem + + noSmithyDocumentSerde +} + +type BatchUpdatePhoneNumberOutput struct { + PhoneNumberErrors []types.PhoneNumberError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationBatchUpdatePhoneNumberMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpBatchUpdatePhoneNumber{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpBatchUpdatePhoneNumber{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpBatchUpdatePhoneNumberValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opBatchUpdatePhoneNumber(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opBatchUpdatePhoneNumber(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "BatchUpdatePhoneNumber", + } +} diff --git a/service/chimesdkvoice/api_op_CreatePhoneNumberOrder.go b/service/chimesdkvoice/api_op_CreatePhoneNumberOrder.go new file mode 100644 index 00000000000..681cc2945df --- /dev/null +++ b/service/chimesdkvoice/api_op_CreatePhoneNumberOrder.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) CreatePhoneNumberOrder(ctx context.Context, params *CreatePhoneNumberOrderInput, optFns ...func(*Options)) (*CreatePhoneNumberOrderOutput, error) { + if params == nil { + params = &CreatePhoneNumberOrderInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreatePhoneNumberOrder", params, optFns, c.addOperationCreatePhoneNumberOrderMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreatePhoneNumberOrderOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreatePhoneNumberOrderInput struct { + + // This member is required. + E164PhoneNumbers []string + + // This member is required. + ProductType types.PhoneNumberProductType + + noSmithyDocumentSerde +} + +type CreatePhoneNumberOrderOutput struct { + PhoneNumberOrder *types.PhoneNumberOrder + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreatePhoneNumberOrderMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreatePhoneNumberOrder{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreatePhoneNumberOrder{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreatePhoneNumberOrderValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreatePhoneNumberOrder(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreatePhoneNumberOrder(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreatePhoneNumberOrder", + } +} diff --git a/service/chimesdkvoice/api_op_CreateProxySession.go b/service/chimesdkvoice/api_op_CreateProxySession.go new file mode 100644 index 00000000000..ea1c47541fd --- /dev/null +++ b/service/chimesdkvoice/api_op_CreateProxySession.go @@ -0,0 +1,132 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) CreateProxySession(ctx context.Context, params *CreateProxySessionInput, optFns ...func(*Options)) (*CreateProxySessionOutput, error) { + if params == nil { + params = &CreateProxySessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateProxySession", params, optFns, c.addOperationCreateProxySessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateProxySessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateProxySessionInput struct { + + // This member is required. + Capabilities []types.Capability + + // This member is required. + ParticipantPhoneNumbers []string + + // This member is required. + VoiceConnectorId *string + + ExpiryMinutes *int32 + + GeoMatchLevel types.GeoMatchLevel + + GeoMatchParams *types.GeoMatchParams + + Name *string + + NumberSelectionBehavior types.NumberSelectionBehavior + + noSmithyDocumentSerde +} + +type CreateProxySessionOutput struct { + ProxySession *types.ProxySession + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateProxySessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateProxySession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateProxySession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateProxySessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateProxySession(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateProxySession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreateProxySession", + } +} diff --git a/service/chimesdkvoice/api_op_CreateSipMediaApplication.go b/service/chimesdkvoice/api_op_CreateSipMediaApplication.go new file mode 100644 index 00000000000..0d7b74a28b5 --- /dev/null +++ b/service/chimesdkvoice/api_op_CreateSipMediaApplication.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) CreateSipMediaApplication(ctx context.Context, params *CreateSipMediaApplicationInput, optFns ...func(*Options)) (*CreateSipMediaApplicationOutput, error) { + if params == nil { + params = &CreateSipMediaApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSipMediaApplication", params, optFns, c.addOperationCreateSipMediaApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSipMediaApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSipMediaApplicationInput struct { + + // This member is required. + AwsRegion *string + + // This member is required. + Endpoints []types.SipMediaApplicationEndpoint + + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type CreateSipMediaApplicationOutput struct { + SipMediaApplication *types.SipMediaApplication + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSipMediaApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSipMediaApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSipMediaApplication{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateSipMediaApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSipMediaApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSipMediaApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreateSipMediaApplication", + } +} diff --git a/service/chimesdkvoice/api_op_CreateSipMediaApplicationCall.go b/service/chimesdkvoice/api_op_CreateSipMediaApplicationCall.go new file mode 100644 index 00000000000..e0fc7f814dd --- /dev/null +++ b/service/chimesdkvoice/api_op_CreateSipMediaApplicationCall.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) CreateSipMediaApplicationCall(ctx context.Context, params *CreateSipMediaApplicationCallInput, optFns ...func(*Options)) (*CreateSipMediaApplicationCallOutput, error) { + if params == nil { + params = &CreateSipMediaApplicationCallInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSipMediaApplicationCall", params, optFns, c.addOperationCreateSipMediaApplicationCallMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSipMediaApplicationCallOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSipMediaApplicationCallInput struct { + + // This member is required. + FromPhoneNumber *string + + // This member is required. + SipMediaApplicationId *string + + // This member is required. + ToPhoneNumber *string + + ArgumentsMap map[string]string + + SipHeaders map[string]string + + noSmithyDocumentSerde +} + +type CreateSipMediaApplicationCallOutput struct { + SipMediaApplicationCall *types.SipMediaApplicationCall + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSipMediaApplicationCallMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSipMediaApplicationCall{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSipMediaApplicationCall{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateSipMediaApplicationCallValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSipMediaApplicationCall(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSipMediaApplicationCall(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreateSipMediaApplicationCall", + } +} diff --git a/service/chimesdkvoice/api_op_CreateSipRule.go b/service/chimesdkvoice/api_op_CreateSipRule.go new file mode 100644 index 00000000000..72c96d6c046 --- /dev/null +++ b/service/chimesdkvoice/api_op_CreateSipRule.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) CreateSipRule(ctx context.Context, params *CreateSipRuleInput, optFns ...func(*Options)) (*CreateSipRuleOutput, error) { + if params == nil { + params = &CreateSipRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSipRule", params, optFns, c.addOperationCreateSipRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSipRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSipRuleInput struct { + + // This member is required. + Name *string + + // This member is required. + TriggerType types.SipRuleTriggerType + + // This member is required. + TriggerValue *string + + Disabled *bool + + TargetApplications []types.SipRuleTargetApplication + + noSmithyDocumentSerde +} + +type CreateSipRuleOutput struct { + SipRule *types.SipRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSipRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSipRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSipRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateSipRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSipRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateSipRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreateSipRule", + } +} diff --git a/service/chimesdkvoice/api_op_CreateVoiceConnector.go b/service/chimesdkvoice/api_op_CreateVoiceConnector.go new file mode 100644 index 00000000000..7288540035b --- /dev/null +++ b/service/chimesdkvoice/api_op_CreateVoiceConnector.go @@ -0,0 +1,121 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) CreateVoiceConnector(ctx context.Context, params *CreateVoiceConnectorInput, optFns ...func(*Options)) (*CreateVoiceConnectorOutput, error) { + if params == nil { + params = &CreateVoiceConnectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateVoiceConnector", params, optFns, c.addOperationCreateVoiceConnectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateVoiceConnectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateVoiceConnectorInput struct { + + // This member is required. + Name *string + + // This member is required. + RequireEncryption *bool + + AwsRegion types.VoiceConnectorAwsRegion + + noSmithyDocumentSerde +} + +type CreateVoiceConnectorOutput struct { + VoiceConnector *types.VoiceConnector + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateVoiceConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateVoiceConnector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateVoiceConnector{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateVoiceConnectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVoiceConnector(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateVoiceConnector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreateVoiceConnector", + } +} diff --git a/service/chimesdkvoice/api_op_CreateVoiceConnectorGroup.go b/service/chimesdkvoice/api_op_CreateVoiceConnectorGroup.go new file mode 100644 index 00000000000..339f325756c --- /dev/null +++ b/service/chimesdkvoice/api_op_CreateVoiceConnectorGroup.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) CreateVoiceConnectorGroup(ctx context.Context, params *CreateVoiceConnectorGroupInput, optFns ...func(*Options)) (*CreateVoiceConnectorGroupOutput, error) { + if params == nil { + params = &CreateVoiceConnectorGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateVoiceConnectorGroup", params, optFns, c.addOperationCreateVoiceConnectorGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateVoiceConnectorGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateVoiceConnectorGroupInput struct { + + // This member is required. + Name *string + + VoiceConnectorItems []types.VoiceConnectorItem + + noSmithyDocumentSerde +} + +type CreateVoiceConnectorGroupOutput struct { + VoiceConnectorGroup *types.VoiceConnectorGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateVoiceConnectorGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateVoiceConnectorGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateVoiceConnectorGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateVoiceConnectorGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "CreateVoiceConnectorGroup", + } +} diff --git a/service/chimesdkvoice/api_op_DeletePhoneNumber.go b/service/chimesdkvoice/api_op_DeletePhoneNumber.go new file mode 100644 index 00000000000..d3986ab6519 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeletePhoneNumber.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeletePhoneNumber(ctx context.Context, params *DeletePhoneNumberInput, optFns ...func(*Options)) (*DeletePhoneNumberOutput, error) { + if params == nil { + params = &DeletePhoneNumberInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeletePhoneNumber", params, optFns, c.addOperationDeletePhoneNumberMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeletePhoneNumberOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeletePhoneNumberInput struct { + + // This member is required. + PhoneNumberId *string + + noSmithyDocumentSerde +} + +type DeletePhoneNumberOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeletePhoneNumberMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeletePhoneNumber{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeletePhoneNumber{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeletePhoneNumberValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeletePhoneNumber(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeletePhoneNumber(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeletePhoneNumber", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteProxySession.go b/service/chimesdkvoice/api_op_DeleteProxySession.go new file mode 100644 index 00000000000..225ae30dc37 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteProxySession.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteProxySession(ctx context.Context, params *DeleteProxySessionInput, optFns ...func(*Options)) (*DeleteProxySessionOutput, error) { + if params == nil { + params = &DeleteProxySessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteProxySession", params, optFns, c.addOperationDeleteProxySessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteProxySessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteProxySessionInput struct { + + // This member is required. + ProxySessionId *string + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DeleteProxySessionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteProxySessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteProxySession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteProxySession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteProxySessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteProxySession(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteProxySession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteProxySession", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteSipMediaApplication.go b/service/chimesdkvoice/api_op_DeleteSipMediaApplication.go new file mode 100644 index 00000000000..1d183ac262d --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteSipMediaApplication.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteSipMediaApplication(ctx context.Context, params *DeleteSipMediaApplicationInput, optFns ...func(*Options)) (*DeleteSipMediaApplicationOutput, error) { + if params == nil { + params = &DeleteSipMediaApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSipMediaApplication", params, optFns, c.addOperationDeleteSipMediaApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSipMediaApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSipMediaApplicationInput struct { + + // This member is required. + SipMediaApplicationId *string + + noSmithyDocumentSerde +} + +type DeleteSipMediaApplicationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSipMediaApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSipMediaApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSipMediaApplication{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSipMediaApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSipMediaApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSipMediaApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteSipMediaApplication", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteSipRule.go b/service/chimesdkvoice/api_op_DeleteSipRule.go new file mode 100644 index 00000000000..ada6fbfef31 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteSipRule.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteSipRule(ctx context.Context, params *DeleteSipRuleInput, optFns ...func(*Options)) (*DeleteSipRuleOutput, error) { + if params == nil { + params = &DeleteSipRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSipRule", params, optFns, c.addOperationDeleteSipRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSipRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSipRuleInput struct { + + // This member is required. + SipRuleId *string + + noSmithyDocumentSerde +} + +type DeleteSipRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSipRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSipRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSipRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSipRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSipRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSipRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteSipRule", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteVoiceConnector.go b/service/chimesdkvoice/api_op_DeleteVoiceConnector.go new file mode 100644 index 00000000000..f8ab5f43f82 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteVoiceConnector.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteVoiceConnector(ctx context.Context, params *DeleteVoiceConnectorInput, optFns ...func(*Options)) (*DeleteVoiceConnectorOutput, error) { + if params == nil { + params = &DeleteVoiceConnectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVoiceConnector", params, optFns, c.addOperationDeleteVoiceConnectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVoiceConnectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVoiceConnectorInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DeleteVoiceConnectorOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVoiceConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVoiceConnector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVoiceConnector{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVoiceConnectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVoiceConnector(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVoiceConnector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteVoiceConnector", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteVoiceConnectorEmergencyCallingConfiguration.go b/service/chimesdkvoice/api_op_DeleteVoiceConnectorEmergencyCallingConfiguration.go new file mode 100644 index 00000000000..3e7322f064a --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteVoiceConnectorEmergencyCallingConfiguration.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteVoiceConnectorEmergencyCallingConfiguration(ctx context.Context, params *DeleteVoiceConnectorEmergencyCallingConfigurationInput, optFns ...func(*Options)) (*DeleteVoiceConnectorEmergencyCallingConfigurationOutput, error) { + if params == nil { + params = &DeleteVoiceConnectorEmergencyCallingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVoiceConnectorEmergencyCallingConfiguration", params, optFns, c.addOperationDeleteVoiceConnectorEmergencyCallingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVoiceConnectorEmergencyCallingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVoiceConnectorEmergencyCallingConfigurationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DeleteVoiceConnectorEmergencyCallingConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVoiceConnectorEmergencyCallingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVoiceConnectorEmergencyCallingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVoiceConnectorEmergencyCallingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVoiceConnectorEmergencyCallingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteVoiceConnectorEmergencyCallingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteVoiceConnectorGroup.go b/service/chimesdkvoice/api_op_DeleteVoiceConnectorGroup.go new file mode 100644 index 00000000000..52a4dbe2b80 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteVoiceConnectorGroup.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteVoiceConnectorGroup(ctx context.Context, params *DeleteVoiceConnectorGroupInput, optFns ...func(*Options)) (*DeleteVoiceConnectorGroupOutput, error) { + if params == nil { + params = &DeleteVoiceConnectorGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVoiceConnectorGroup", params, optFns, c.addOperationDeleteVoiceConnectorGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVoiceConnectorGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVoiceConnectorGroupInput struct { + + // This member is required. + VoiceConnectorGroupId *string + + noSmithyDocumentSerde +} + +type DeleteVoiceConnectorGroupOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVoiceConnectorGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVoiceConnectorGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVoiceConnectorGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVoiceConnectorGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteVoiceConnectorGroup", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteVoiceConnectorOrigination.go b/service/chimesdkvoice/api_op_DeleteVoiceConnectorOrigination.go new file mode 100644 index 00000000000..6d790b273bd --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteVoiceConnectorOrigination.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteVoiceConnectorOrigination(ctx context.Context, params *DeleteVoiceConnectorOriginationInput, optFns ...func(*Options)) (*DeleteVoiceConnectorOriginationOutput, error) { + if params == nil { + params = &DeleteVoiceConnectorOriginationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVoiceConnectorOrigination", params, optFns, c.addOperationDeleteVoiceConnectorOriginationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVoiceConnectorOriginationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVoiceConnectorOriginationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DeleteVoiceConnectorOriginationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVoiceConnectorOriginationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVoiceConnectorOrigination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVoiceConnectorOrigination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVoiceConnectorOriginationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVoiceConnectorOrigination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVoiceConnectorOrigination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteVoiceConnectorOrigination", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteVoiceConnectorProxy.go b/service/chimesdkvoice/api_op_DeleteVoiceConnectorProxy.go new file mode 100644 index 00000000000..faa44031f79 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteVoiceConnectorProxy.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteVoiceConnectorProxy(ctx context.Context, params *DeleteVoiceConnectorProxyInput, optFns ...func(*Options)) (*DeleteVoiceConnectorProxyOutput, error) { + if params == nil { + params = &DeleteVoiceConnectorProxyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVoiceConnectorProxy", params, optFns, c.addOperationDeleteVoiceConnectorProxyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVoiceConnectorProxyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVoiceConnectorProxyInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DeleteVoiceConnectorProxyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVoiceConnectorProxyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVoiceConnectorProxy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVoiceConnectorProxy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVoiceConnectorProxyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVoiceConnectorProxy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVoiceConnectorProxy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteVoiceConnectorProxy", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteVoiceConnectorStreamingConfiguration.go b/service/chimesdkvoice/api_op_DeleteVoiceConnectorStreamingConfiguration.go new file mode 100644 index 00000000000..0d38fe40d05 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteVoiceConnectorStreamingConfiguration.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteVoiceConnectorStreamingConfiguration(ctx context.Context, params *DeleteVoiceConnectorStreamingConfigurationInput, optFns ...func(*Options)) (*DeleteVoiceConnectorStreamingConfigurationOutput, error) { + if params == nil { + params = &DeleteVoiceConnectorStreamingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVoiceConnectorStreamingConfiguration", params, optFns, c.addOperationDeleteVoiceConnectorStreamingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVoiceConnectorStreamingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVoiceConnectorStreamingConfigurationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DeleteVoiceConnectorStreamingConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVoiceConnectorStreamingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVoiceConnectorStreamingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVoiceConnectorStreamingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVoiceConnectorStreamingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVoiceConnectorStreamingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVoiceConnectorStreamingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteVoiceConnectorStreamingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteVoiceConnectorTermination.go b/service/chimesdkvoice/api_op_DeleteVoiceConnectorTermination.go new file mode 100644 index 00000000000..d6bae0136a7 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteVoiceConnectorTermination.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteVoiceConnectorTermination(ctx context.Context, params *DeleteVoiceConnectorTerminationInput, optFns ...func(*Options)) (*DeleteVoiceConnectorTerminationOutput, error) { + if params == nil { + params = &DeleteVoiceConnectorTerminationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVoiceConnectorTermination", params, optFns, c.addOperationDeleteVoiceConnectorTerminationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVoiceConnectorTerminationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVoiceConnectorTerminationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DeleteVoiceConnectorTerminationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVoiceConnectorTerminationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVoiceConnectorTermination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVoiceConnectorTermination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVoiceConnectorTerminationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVoiceConnectorTermination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVoiceConnectorTermination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteVoiceConnectorTermination", + } +} diff --git a/service/chimesdkvoice/api_op_DeleteVoiceConnectorTerminationCredentials.go b/service/chimesdkvoice/api_op_DeleteVoiceConnectorTerminationCredentials.go new file mode 100644 index 00000000000..6e4e3ff4c55 --- /dev/null +++ b/service/chimesdkvoice/api_op_DeleteVoiceConnectorTerminationCredentials.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DeleteVoiceConnectorTerminationCredentials(ctx context.Context, params *DeleteVoiceConnectorTerminationCredentialsInput, optFns ...func(*Options)) (*DeleteVoiceConnectorTerminationCredentialsOutput, error) { + if params == nil { + params = &DeleteVoiceConnectorTerminationCredentialsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteVoiceConnectorTerminationCredentials", params, optFns, c.addOperationDeleteVoiceConnectorTerminationCredentialsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteVoiceConnectorTerminationCredentialsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteVoiceConnectorTerminationCredentialsInput struct { + + // This member is required. + Usernames []string + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DeleteVoiceConnectorTerminationCredentialsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteVoiceConnectorTerminationCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteVoiceConnectorTerminationCredentials{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteVoiceConnectorTerminationCredentials{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteVoiceConnectorTerminationCredentialsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteVoiceConnectorTerminationCredentials(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteVoiceConnectorTerminationCredentials(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DeleteVoiceConnectorTerminationCredentials", + } +} diff --git a/service/chimesdkvoice/api_op_DisassociatePhoneNumbersFromVoiceConnector.go b/service/chimesdkvoice/api_op_DisassociatePhoneNumbersFromVoiceConnector.go new file mode 100644 index 00000000000..fe5911db6b4 --- /dev/null +++ b/service/chimesdkvoice/api_op_DisassociatePhoneNumbersFromVoiceConnector.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DisassociatePhoneNumbersFromVoiceConnector(ctx context.Context, params *DisassociatePhoneNumbersFromVoiceConnectorInput, optFns ...func(*Options)) (*DisassociatePhoneNumbersFromVoiceConnectorOutput, error) { + if params == nil { + params = &DisassociatePhoneNumbersFromVoiceConnectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociatePhoneNumbersFromVoiceConnector", params, optFns, c.addOperationDisassociatePhoneNumbersFromVoiceConnectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociatePhoneNumbersFromVoiceConnectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociatePhoneNumbersFromVoiceConnectorInput struct { + + // This member is required. + E164PhoneNumbers []string + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type DisassociatePhoneNumbersFromVoiceConnectorOutput struct { + PhoneNumberErrors []types.PhoneNumberError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociatePhoneNumbersFromVoiceConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociatePhoneNumbersFromVoiceConnector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociatePhoneNumbersFromVoiceConnector{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociatePhoneNumbersFromVoiceConnectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociatePhoneNumbersFromVoiceConnector(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisassociatePhoneNumbersFromVoiceConnector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DisassociatePhoneNumbersFromVoiceConnector", + } +} diff --git a/service/chimesdkvoice/api_op_DisassociatePhoneNumbersFromVoiceConnectorGroup.go b/service/chimesdkvoice/api_op_DisassociatePhoneNumbersFromVoiceConnectorGroup.go new file mode 100644 index 00000000000..c557f9004f6 --- /dev/null +++ b/service/chimesdkvoice/api_op_DisassociatePhoneNumbersFromVoiceConnectorGroup.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) DisassociatePhoneNumbersFromVoiceConnectorGroup(ctx context.Context, params *DisassociatePhoneNumbersFromVoiceConnectorGroupInput, optFns ...func(*Options)) (*DisassociatePhoneNumbersFromVoiceConnectorGroupOutput, error) { + if params == nil { + params = &DisassociatePhoneNumbersFromVoiceConnectorGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociatePhoneNumbersFromVoiceConnectorGroup", params, optFns, c.addOperationDisassociatePhoneNumbersFromVoiceConnectorGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociatePhoneNumbersFromVoiceConnectorGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociatePhoneNumbersFromVoiceConnectorGroupInput struct { + + // This member is required. + E164PhoneNumbers []string + + // This member is required. + VoiceConnectorGroupId *string + + noSmithyDocumentSerde +} + +type DisassociatePhoneNumbersFromVoiceConnectorGroupOutput struct { + PhoneNumberErrors []types.PhoneNumberError + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociatePhoneNumbersFromVoiceConnectorGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociatePhoneNumbersFromVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociatePhoneNumbersFromVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDisassociatePhoneNumbersFromVoiceConnectorGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociatePhoneNumbersFromVoiceConnectorGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisassociatePhoneNumbersFromVoiceConnectorGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "DisassociatePhoneNumbersFromVoiceConnectorGroup", + } +} diff --git a/service/chimesdkvoice/api_op_GetGlobalSettings.go b/service/chimesdkvoice/api_op_GetGlobalSettings.go new file mode 100644 index 00000000000..e56ace49643 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetGlobalSettings.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetGlobalSettings(ctx context.Context, params *GetGlobalSettingsInput, optFns ...func(*Options)) (*GetGlobalSettingsOutput, error) { + if params == nil { + params = &GetGlobalSettingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetGlobalSettings", params, optFns, c.addOperationGetGlobalSettingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetGlobalSettingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetGlobalSettingsInput struct { + noSmithyDocumentSerde +} + +type GetGlobalSettingsOutput struct { + VoiceConnector *types.VoiceConnectorSettings + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetGlobalSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetGlobalSettings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetGlobalSettings{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetGlobalSettings(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetGlobalSettings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetGlobalSettings", + } +} diff --git a/service/chimesdkvoice/api_op_GetPhoneNumber.go b/service/chimesdkvoice/api_op_GetPhoneNumber.go new file mode 100644 index 00000000000..9a6b73cbc60 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetPhoneNumber.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetPhoneNumber(ctx context.Context, params *GetPhoneNumberInput, optFns ...func(*Options)) (*GetPhoneNumberOutput, error) { + if params == nil { + params = &GetPhoneNumberInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPhoneNumber", params, optFns, c.addOperationGetPhoneNumberMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPhoneNumberOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPhoneNumberInput struct { + + // This member is required. + PhoneNumberId *string + + noSmithyDocumentSerde +} + +type GetPhoneNumberOutput struct { + PhoneNumber *types.PhoneNumber + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPhoneNumberMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPhoneNumber{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPhoneNumber{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetPhoneNumberValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPhoneNumber(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetPhoneNumber(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetPhoneNumber", + } +} diff --git a/service/chimesdkvoice/api_op_GetPhoneNumberOrder.go b/service/chimesdkvoice/api_op_GetPhoneNumberOrder.go new file mode 100644 index 00000000000..1b20832951e --- /dev/null +++ b/service/chimesdkvoice/api_op_GetPhoneNumberOrder.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetPhoneNumberOrder(ctx context.Context, params *GetPhoneNumberOrderInput, optFns ...func(*Options)) (*GetPhoneNumberOrderOutput, error) { + if params == nil { + params = &GetPhoneNumberOrderInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPhoneNumberOrder", params, optFns, c.addOperationGetPhoneNumberOrderMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPhoneNumberOrderOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPhoneNumberOrderInput struct { + + // This member is required. + PhoneNumberOrderId *string + + noSmithyDocumentSerde +} + +type GetPhoneNumberOrderOutput struct { + PhoneNumberOrder *types.PhoneNumberOrder + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPhoneNumberOrderMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPhoneNumberOrder{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPhoneNumberOrder{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetPhoneNumberOrderValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPhoneNumberOrder(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetPhoneNumberOrder(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetPhoneNumberOrder", + } +} diff --git a/service/chimesdkvoice/api_op_GetPhoneNumberSettings.go b/service/chimesdkvoice/api_op_GetPhoneNumberSettings.go new file mode 100644 index 00000000000..2c32174e8f7 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetPhoneNumberSettings.go @@ -0,0 +1,111 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +func (c *Client) GetPhoneNumberSettings(ctx context.Context, params *GetPhoneNumberSettingsInput, optFns ...func(*Options)) (*GetPhoneNumberSettingsOutput, error) { + if params == nil { + params = &GetPhoneNumberSettingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPhoneNumberSettings", params, optFns, c.addOperationGetPhoneNumberSettingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPhoneNumberSettingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPhoneNumberSettingsInput struct { + noSmithyDocumentSerde +} + +type GetPhoneNumberSettingsOutput struct { + CallingName *string + + CallingNameUpdatedTimestamp *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPhoneNumberSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetPhoneNumberSettings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetPhoneNumberSettings{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPhoneNumberSettings(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetPhoneNumberSettings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetPhoneNumberSettings", + } +} diff --git a/service/chimesdkvoice/api_op_GetProxySession.go b/service/chimesdkvoice/api_op_GetProxySession.go new file mode 100644 index 00000000000..1dd94dc279b --- /dev/null +++ b/service/chimesdkvoice/api_op_GetProxySession.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetProxySession(ctx context.Context, params *GetProxySessionInput, optFns ...func(*Options)) (*GetProxySessionOutput, error) { + if params == nil { + params = &GetProxySessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetProxySession", params, optFns, c.addOperationGetProxySessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetProxySessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetProxySessionInput struct { + + // This member is required. + ProxySessionId *string + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetProxySessionOutput struct { + ProxySession *types.ProxySession + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetProxySessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetProxySession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetProxySession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetProxySessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetProxySession(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetProxySession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetProxySession", + } +} diff --git a/service/chimesdkvoice/api_op_GetSipMediaApplication.go b/service/chimesdkvoice/api_op_GetSipMediaApplication.go new file mode 100644 index 00000000000..c12cdf75c35 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetSipMediaApplication.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetSipMediaApplication(ctx context.Context, params *GetSipMediaApplicationInput, optFns ...func(*Options)) (*GetSipMediaApplicationOutput, error) { + if params == nil { + params = &GetSipMediaApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSipMediaApplication", params, optFns, c.addOperationGetSipMediaApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSipMediaApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSipMediaApplicationInput struct { + + // This member is required. + SipMediaApplicationId *string + + noSmithyDocumentSerde +} + +type GetSipMediaApplicationOutput struct { + SipMediaApplication *types.SipMediaApplication + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSipMediaApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSipMediaApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSipMediaApplication{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSipMediaApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSipMediaApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSipMediaApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetSipMediaApplication", + } +} diff --git a/service/chimesdkvoice/api_op_GetSipMediaApplicationAlexaSkillConfiguration.go b/service/chimesdkvoice/api_op_GetSipMediaApplicationAlexaSkillConfiguration.go new file mode 100644 index 00000000000..cc5c6f879b1 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetSipMediaApplicationAlexaSkillConfiguration.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetSipMediaApplicationAlexaSkillConfiguration(ctx context.Context, params *GetSipMediaApplicationAlexaSkillConfigurationInput, optFns ...func(*Options)) (*GetSipMediaApplicationAlexaSkillConfigurationOutput, error) { + if params == nil { + params = &GetSipMediaApplicationAlexaSkillConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSipMediaApplicationAlexaSkillConfiguration", params, optFns, c.addOperationGetSipMediaApplicationAlexaSkillConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSipMediaApplicationAlexaSkillConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSipMediaApplicationAlexaSkillConfigurationInput struct { + + // This member is required. + SipMediaApplicationId *string + + noSmithyDocumentSerde +} + +type GetSipMediaApplicationAlexaSkillConfigurationOutput struct { + SipMediaApplicationAlexaSkillConfiguration *types.SipMediaApplicationAlexaSkillConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSipMediaApplicationAlexaSkillConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSipMediaApplicationAlexaSkillConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSipMediaApplicationAlexaSkillConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSipMediaApplicationAlexaSkillConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSipMediaApplicationAlexaSkillConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSipMediaApplicationAlexaSkillConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetSipMediaApplicationAlexaSkillConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_GetSipMediaApplicationLoggingConfiguration.go b/service/chimesdkvoice/api_op_GetSipMediaApplicationLoggingConfiguration.go new file mode 100644 index 00000000000..df23e6503d3 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetSipMediaApplicationLoggingConfiguration.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetSipMediaApplicationLoggingConfiguration(ctx context.Context, params *GetSipMediaApplicationLoggingConfigurationInput, optFns ...func(*Options)) (*GetSipMediaApplicationLoggingConfigurationOutput, error) { + if params == nil { + params = &GetSipMediaApplicationLoggingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSipMediaApplicationLoggingConfiguration", params, optFns, c.addOperationGetSipMediaApplicationLoggingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSipMediaApplicationLoggingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSipMediaApplicationLoggingConfigurationInput struct { + + // This member is required. + SipMediaApplicationId *string + + noSmithyDocumentSerde +} + +type GetSipMediaApplicationLoggingConfigurationOutput struct { + SipMediaApplicationLoggingConfiguration *types.SipMediaApplicationLoggingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSipMediaApplicationLoggingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSipMediaApplicationLoggingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSipMediaApplicationLoggingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSipMediaApplicationLoggingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSipMediaApplicationLoggingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSipMediaApplicationLoggingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetSipMediaApplicationLoggingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_GetSipRule.go b/service/chimesdkvoice/api_op_GetSipRule.go new file mode 100644 index 00000000000..af3fa35bdd5 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetSipRule.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetSipRule(ctx context.Context, params *GetSipRuleInput, optFns ...func(*Options)) (*GetSipRuleOutput, error) { + if params == nil { + params = &GetSipRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSipRule", params, optFns, c.addOperationGetSipRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSipRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSipRuleInput struct { + + // This member is required. + SipRuleId *string + + noSmithyDocumentSerde +} + +type GetSipRuleOutput struct { + SipRule *types.SipRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSipRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSipRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSipRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSipRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSipRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSipRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetSipRule", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnector.go b/service/chimesdkvoice/api_op_GetVoiceConnector.go new file mode 100644 index 00000000000..3cd370f507f --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnector.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnector(ctx context.Context, params *GetVoiceConnectorInput, optFns ...func(*Options)) (*GetVoiceConnectorOutput, error) { + if params == nil { + params = &GetVoiceConnectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnector", params, optFns, c.addOperationGetVoiceConnectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorOutput struct { + VoiceConnector *types.VoiceConnector + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnector{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnector(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnector", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnectorEmergencyCallingConfiguration.go b/service/chimesdkvoice/api_op_GetVoiceConnectorEmergencyCallingConfiguration.go new file mode 100644 index 00000000000..358a53dedf0 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnectorEmergencyCallingConfiguration.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnectorEmergencyCallingConfiguration(ctx context.Context, params *GetVoiceConnectorEmergencyCallingConfigurationInput, optFns ...func(*Options)) (*GetVoiceConnectorEmergencyCallingConfigurationOutput, error) { + if params == nil { + params = &GetVoiceConnectorEmergencyCallingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnectorEmergencyCallingConfiguration", params, optFns, c.addOperationGetVoiceConnectorEmergencyCallingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorEmergencyCallingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorEmergencyCallingConfigurationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorEmergencyCallingConfigurationOutput struct { + EmergencyCallingConfiguration *types.EmergencyCallingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorEmergencyCallingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorEmergencyCallingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnectorEmergencyCallingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnectorEmergencyCallingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnectorEmergencyCallingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnectorGroup.go b/service/chimesdkvoice/api_op_GetVoiceConnectorGroup.go new file mode 100644 index 00000000000..033e7cb3594 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnectorGroup.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnectorGroup(ctx context.Context, params *GetVoiceConnectorGroupInput, optFns ...func(*Options)) (*GetVoiceConnectorGroupOutput, error) { + if params == nil { + params = &GetVoiceConnectorGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnectorGroup", params, optFns, c.addOperationGetVoiceConnectorGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorGroupInput struct { + + // This member is required. + VoiceConnectorGroupId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorGroupOutput struct { + VoiceConnectorGroup *types.VoiceConnectorGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnectorGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnectorGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnectorGroup", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnectorLoggingConfiguration.go b/service/chimesdkvoice/api_op_GetVoiceConnectorLoggingConfiguration.go new file mode 100644 index 00000000000..e00e06a13fa --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnectorLoggingConfiguration.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnectorLoggingConfiguration(ctx context.Context, params *GetVoiceConnectorLoggingConfigurationInput, optFns ...func(*Options)) (*GetVoiceConnectorLoggingConfigurationOutput, error) { + if params == nil { + params = &GetVoiceConnectorLoggingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnectorLoggingConfiguration", params, optFns, c.addOperationGetVoiceConnectorLoggingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorLoggingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorLoggingConfigurationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorLoggingConfigurationOutput struct { + LoggingConfiguration *types.LoggingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorLoggingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnectorLoggingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnectorLoggingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorLoggingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnectorLoggingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnectorLoggingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnectorLoggingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnectorOrigination.go b/service/chimesdkvoice/api_op_GetVoiceConnectorOrigination.go new file mode 100644 index 00000000000..b5edb34a500 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnectorOrigination.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnectorOrigination(ctx context.Context, params *GetVoiceConnectorOriginationInput, optFns ...func(*Options)) (*GetVoiceConnectorOriginationOutput, error) { + if params == nil { + params = &GetVoiceConnectorOriginationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnectorOrigination", params, optFns, c.addOperationGetVoiceConnectorOriginationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorOriginationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorOriginationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorOriginationOutput struct { + Origination *types.Origination + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorOriginationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnectorOrigination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnectorOrigination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorOriginationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnectorOrigination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnectorOrigination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnectorOrigination", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnectorProxy.go b/service/chimesdkvoice/api_op_GetVoiceConnectorProxy.go new file mode 100644 index 00000000000..2226ba99ef0 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnectorProxy.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnectorProxy(ctx context.Context, params *GetVoiceConnectorProxyInput, optFns ...func(*Options)) (*GetVoiceConnectorProxyOutput, error) { + if params == nil { + params = &GetVoiceConnectorProxyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnectorProxy", params, optFns, c.addOperationGetVoiceConnectorProxyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorProxyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorProxyInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorProxyOutput struct { + Proxy *types.Proxy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorProxyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnectorProxy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnectorProxy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorProxyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnectorProxy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnectorProxy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnectorProxy", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnectorStreamingConfiguration.go b/service/chimesdkvoice/api_op_GetVoiceConnectorStreamingConfiguration.go new file mode 100644 index 00000000000..60e030b2ee0 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnectorStreamingConfiguration.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnectorStreamingConfiguration(ctx context.Context, params *GetVoiceConnectorStreamingConfigurationInput, optFns ...func(*Options)) (*GetVoiceConnectorStreamingConfigurationOutput, error) { + if params == nil { + params = &GetVoiceConnectorStreamingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnectorStreamingConfiguration", params, optFns, c.addOperationGetVoiceConnectorStreamingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorStreamingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorStreamingConfigurationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorStreamingConfigurationOutput struct { + StreamingConfiguration *types.StreamingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorStreamingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnectorStreamingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnectorStreamingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorStreamingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnectorStreamingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnectorStreamingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnectorStreamingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnectorTermination.go b/service/chimesdkvoice/api_op_GetVoiceConnectorTermination.go new file mode 100644 index 00000000000..5d02c26d459 --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnectorTermination.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnectorTermination(ctx context.Context, params *GetVoiceConnectorTerminationInput, optFns ...func(*Options)) (*GetVoiceConnectorTerminationOutput, error) { + if params == nil { + params = &GetVoiceConnectorTerminationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnectorTermination", params, optFns, c.addOperationGetVoiceConnectorTerminationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorTerminationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorTerminationInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorTerminationOutput struct { + Termination *types.Termination + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorTerminationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnectorTermination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnectorTermination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorTerminationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnectorTermination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnectorTermination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnectorTermination", + } +} diff --git a/service/chimesdkvoice/api_op_GetVoiceConnectorTerminationHealth.go b/service/chimesdkvoice/api_op_GetVoiceConnectorTerminationHealth.go new file mode 100644 index 00000000000..8ea09aa79ee --- /dev/null +++ b/service/chimesdkvoice/api_op_GetVoiceConnectorTerminationHealth.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) GetVoiceConnectorTerminationHealth(ctx context.Context, params *GetVoiceConnectorTerminationHealthInput, optFns ...func(*Options)) (*GetVoiceConnectorTerminationHealthOutput, error) { + if params == nil { + params = &GetVoiceConnectorTerminationHealthInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetVoiceConnectorTerminationHealth", params, optFns, c.addOperationGetVoiceConnectorTerminationHealthMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetVoiceConnectorTerminationHealthOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetVoiceConnectorTerminationHealthInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type GetVoiceConnectorTerminationHealthOutput struct { + TerminationHealth *types.TerminationHealth + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetVoiceConnectorTerminationHealthMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetVoiceConnectorTerminationHealth{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetVoiceConnectorTerminationHealth{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetVoiceConnectorTerminationHealthValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetVoiceConnectorTerminationHealth(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetVoiceConnectorTerminationHealth(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "GetVoiceConnectorTerminationHealth", + } +} diff --git a/service/chimesdkvoice/api_op_ListAvailableVoiceConnectorRegions.go b/service/chimesdkvoice/api_op_ListAvailableVoiceConnectorRegions.go new file mode 100644 index 00000000000..24f817a0677 --- /dev/null +++ b/service/chimesdkvoice/api_op_ListAvailableVoiceConnectorRegions.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListAvailableVoiceConnectorRegions(ctx context.Context, params *ListAvailableVoiceConnectorRegionsInput, optFns ...func(*Options)) (*ListAvailableVoiceConnectorRegionsOutput, error) { + if params == nil { + params = &ListAvailableVoiceConnectorRegionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListAvailableVoiceConnectorRegions", params, optFns, c.addOperationListAvailableVoiceConnectorRegionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListAvailableVoiceConnectorRegionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListAvailableVoiceConnectorRegionsInput struct { + noSmithyDocumentSerde +} + +type ListAvailableVoiceConnectorRegionsOutput struct { + VoiceConnectorRegions []types.VoiceConnectorAwsRegion + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListAvailableVoiceConnectorRegionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListAvailableVoiceConnectorRegions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListAvailableVoiceConnectorRegions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListAvailableVoiceConnectorRegions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListAvailableVoiceConnectorRegions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListAvailableVoiceConnectorRegions", + } +} diff --git a/service/chimesdkvoice/api_op_ListPhoneNumberOrders.go b/service/chimesdkvoice/api_op_ListPhoneNumberOrders.go new file mode 100644 index 00000000000..d9ed7ee2681 --- /dev/null +++ b/service/chimesdkvoice/api_op_ListPhoneNumberOrders.go @@ -0,0 +1,206 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +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/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListPhoneNumberOrders(ctx context.Context, params *ListPhoneNumberOrdersInput, optFns ...func(*Options)) (*ListPhoneNumberOrdersOutput, error) { + if params == nil { + params = &ListPhoneNumberOrdersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPhoneNumberOrders", params, optFns, c.addOperationListPhoneNumberOrdersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPhoneNumberOrdersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPhoneNumberOrdersInput struct { + MaxResults *int32 + + NextToken *string + + noSmithyDocumentSerde +} + +type ListPhoneNumberOrdersOutput struct { + NextToken *string + + PhoneNumberOrders []types.PhoneNumberOrder + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPhoneNumberOrdersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPhoneNumberOrders{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPhoneNumberOrders{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPhoneNumberOrders(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListPhoneNumberOrdersAPIClient is a client that implements the +// ListPhoneNumberOrders operation. +type ListPhoneNumberOrdersAPIClient interface { + ListPhoneNumberOrders(context.Context, *ListPhoneNumberOrdersInput, ...func(*Options)) (*ListPhoneNumberOrdersOutput, error) +} + +var _ ListPhoneNumberOrdersAPIClient = (*Client)(nil) + +// ListPhoneNumberOrdersPaginatorOptions is the paginator options for +// ListPhoneNumberOrders +type ListPhoneNumberOrdersPaginatorOptions struct { + 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 +} + +// ListPhoneNumberOrdersPaginator is a paginator for ListPhoneNumberOrders +type ListPhoneNumberOrdersPaginator struct { + options ListPhoneNumberOrdersPaginatorOptions + client ListPhoneNumberOrdersAPIClient + params *ListPhoneNumberOrdersInput + nextToken *string + firstPage bool +} + +// NewListPhoneNumberOrdersPaginator returns a new ListPhoneNumberOrdersPaginator +func NewListPhoneNumberOrdersPaginator(client ListPhoneNumberOrdersAPIClient, params *ListPhoneNumberOrdersInput, optFns ...func(*ListPhoneNumberOrdersPaginatorOptions)) *ListPhoneNumberOrdersPaginator { + if params == nil { + params = &ListPhoneNumberOrdersInput{} + } + + options := ListPhoneNumberOrdersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPhoneNumberOrdersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPhoneNumberOrdersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPhoneNumberOrders page. +func (p *ListPhoneNumberOrdersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPhoneNumberOrdersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListPhoneNumberOrders(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListPhoneNumberOrders(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListPhoneNumberOrders", + } +} diff --git a/service/chimesdkvoice/api_op_ListPhoneNumbers.go b/service/chimesdkvoice/api_op_ListPhoneNumbers.go new file mode 100644 index 00000000000..e65affbc1ae --- /dev/null +++ b/service/chimesdkvoice/api_op_ListPhoneNumbers.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +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/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListPhoneNumbers(ctx context.Context, params *ListPhoneNumbersInput, optFns ...func(*Options)) (*ListPhoneNumbersOutput, error) { + if params == nil { + params = &ListPhoneNumbersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListPhoneNumbers", params, optFns, c.addOperationListPhoneNumbersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListPhoneNumbersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListPhoneNumbersInput struct { + FilterName types.PhoneNumberAssociationName + + FilterValue *string + + MaxResults *int32 + + NextToken *string + + ProductType types.PhoneNumberProductType + + Status *string + + noSmithyDocumentSerde +} + +type ListPhoneNumbersOutput struct { + NextToken *string + + PhoneNumbers []types.PhoneNumber + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListPhoneNumbersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListPhoneNumbers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListPhoneNumbers{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListPhoneNumbers(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListPhoneNumbersAPIClient is a client that implements the ListPhoneNumbers +// operation. +type ListPhoneNumbersAPIClient interface { + ListPhoneNumbers(context.Context, *ListPhoneNumbersInput, ...func(*Options)) (*ListPhoneNumbersOutput, error) +} + +var _ ListPhoneNumbersAPIClient = (*Client)(nil) + +// ListPhoneNumbersPaginatorOptions is the paginator options for ListPhoneNumbers +type ListPhoneNumbersPaginatorOptions struct { + 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 +} + +// ListPhoneNumbersPaginator is a paginator for ListPhoneNumbers +type ListPhoneNumbersPaginator struct { + options ListPhoneNumbersPaginatorOptions + client ListPhoneNumbersAPIClient + params *ListPhoneNumbersInput + nextToken *string + firstPage bool +} + +// NewListPhoneNumbersPaginator returns a new ListPhoneNumbersPaginator +func NewListPhoneNumbersPaginator(client ListPhoneNumbersAPIClient, params *ListPhoneNumbersInput, optFns ...func(*ListPhoneNumbersPaginatorOptions)) *ListPhoneNumbersPaginator { + if params == nil { + params = &ListPhoneNumbersInput{} + } + + options := ListPhoneNumbersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListPhoneNumbersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListPhoneNumbersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListPhoneNumbers page. +func (p *ListPhoneNumbersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListPhoneNumbersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListPhoneNumbers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListPhoneNumbers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListPhoneNumbers", + } +} diff --git a/service/chimesdkvoice/api_op_ListProxySessions.go b/service/chimesdkvoice/api_op_ListProxySessions.go new file mode 100644 index 00000000000..1805a8d68a8 --- /dev/null +++ b/service/chimesdkvoice/api_op_ListProxySessions.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +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/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListProxySessions(ctx context.Context, params *ListProxySessionsInput, optFns ...func(*Options)) (*ListProxySessionsOutput, error) { + if params == nil { + params = &ListProxySessionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListProxySessions", params, optFns, c.addOperationListProxySessionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListProxySessionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListProxySessionsInput struct { + + // This member is required. + VoiceConnectorId *string + + MaxResults *int32 + + NextToken *string + + Status types.ProxySessionStatus + + noSmithyDocumentSerde +} + +type ListProxySessionsOutput struct { + NextToken *string + + ProxySessions []types.ProxySession + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListProxySessionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListProxySessions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListProxySessions{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListProxySessionsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListProxySessions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListProxySessionsAPIClient is a client that implements the ListProxySessions +// operation. +type ListProxySessionsAPIClient interface { + ListProxySessions(context.Context, *ListProxySessionsInput, ...func(*Options)) (*ListProxySessionsOutput, error) +} + +var _ ListProxySessionsAPIClient = (*Client)(nil) + +// ListProxySessionsPaginatorOptions is the paginator options for ListProxySessions +type ListProxySessionsPaginatorOptions struct { + 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 +} + +// ListProxySessionsPaginator is a paginator for ListProxySessions +type ListProxySessionsPaginator struct { + options ListProxySessionsPaginatorOptions + client ListProxySessionsAPIClient + params *ListProxySessionsInput + nextToken *string + firstPage bool +} + +// NewListProxySessionsPaginator returns a new ListProxySessionsPaginator +func NewListProxySessionsPaginator(client ListProxySessionsAPIClient, params *ListProxySessionsInput, optFns ...func(*ListProxySessionsPaginatorOptions)) *ListProxySessionsPaginator { + if params == nil { + params = &ListProxySessionsInput{} + } + + options := ListProxySessionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListProxySessionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListProxySessionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListProxySessions page. +func (p *ListProxySessionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListProxySessionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListProxySessions(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListProxySessions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListProxySessions", + } +} diff --git a/service/chimesdkvoice/api_op_ListSipMediaApplications.go b/service/chimesdkvoice/api_op_ListSipMediaApplications.go new file mode 100644 index 00000000000..cb8f477549c --- /dev/null +++ b/service/chimesdkvoice/api_op_ListSipMediaApplications.go @@ -0,0 +1,207 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +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/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListSipMediaApplications(ctx context.Context, params *ListSipMediaApplicationsInput, optFns ...func(*Options)) (*ListSipMediaApplicationsOutput, error) { + if params == nil { + params = &ListSipMediaApplicationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSipMediaApplications", params, optFns, c.addOperationListSipMediaApplicationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSipMediaApplicationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSipMediaApplicationsInput struct { + MaxResults *int32 + + NextToken *string + + noSmithyDocumentSerde +} + +type ListSipMediaApplicationsOutput struct { + NextToken *string + + SipMediaApplications []types.SipMediaApplication + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSipMediaApplicationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSipMediaApplications{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSipMediaApplications{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSipMediaApplications(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSipMediaApplicationsAPIClient is a client that implements the +// ListSipMediaApplications operation. +type ListSipMediaApplicationsAPIClient interface { + ListSipMediaApplications(context.Context, *ListSipMediaApplicationsInput, ...func(*Options)) (*ListSipMediaApplicationsOutput, error) +} + +var _ ListSipMediaApplicationsAPIClient = (*Client)(nil) + +// ListSipMediaApplicationsPaginatorOptions is the paginator options for +// ListSipMediaApplications +type ListSipMediaApplicationsPaginatorOptions struct { + 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 +} + +// ListSipMediaApplicationsPaginator is a paginator for ListSipMediaApplications +type ListSipMediaApplicationsPaginator struct { + options ListSipMediaApplicationsPaginatorOptions + client ListSipMediaApplicationsAPIClient + params *ListSipMediaApplicationsInput + nextToken *string + firstPage bool +} + +// NewListSipMediaApplicationsPaginator returns a new +// ListSipMediaApplicationsPaginator +func NewListSipMediaApplicationsPaginator(client ListSipMediaApplicationsAPIClient, params *ListSipMediaApplicationsInput, optFns ...func(*ListSipMediaApplicationsPaginatorOptions)) *ListSipMediaApplicationsPaginator { + if params == nil { + params = &ListSipMediaApplicationsInput{} + } + + options := ListSipMediaApplicationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSipMediaApplicationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSipMediaApplicationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSipMediaApplications page. +func (p *ListSipMediaApplicationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSipMediaApplicationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListSipMediaApplications(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListSipMediaApplications(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListSipMediaApplications", + } +} diff --git a/service/chimesdkvoice/api_op_ListSipRules.go b/service/chimesdkvoice/api_op_ListSipRules.go new file mode 100644 index 00000000000..36a718a3847 --- /dev/null +++ b/service/chimesdkvoice/api_op_ListSipRules.go @@ -0,0 +1,206 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +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/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListSipRules(ctx context.Context, params *ListSipRulesInput, optFns ...func(*Options)) (*ListSipRulesOutput, error) { + if params == nil { + params = &ListSipRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSipRules", params, optFns, c.addOperationListSipRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSipRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSipRulesInput struct { + MaxResults *int32 + + NextToken *string + + SipMediaApplicationId *string + + noSmithyDocumentSerde +} + +type ListSipRulesOutput struct { + NextToken *string + + SipRules []types.SipRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSipRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSipRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSipRules{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSipRules(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSipRulesAPIClient is a client that implements the ListSipRules operation. +type ListSipRulesAPIClient interface { + ListSipRules(context.Context, *ListSipRulesInput, ...func(*Options)) (*ListSipRulesOutput, error) +} + +var _ ListSipRulesAPIClient = (*Client)(nil) + +// ListSipRulesPaginatorOptions is the paginator options for ListSipRules +type ListSipRulesPaginatorOptions struct { + 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 +} + +// ListSipRulesPaginator is a paginator for ListSipRules +type ListSipRulesPaginator struct { + options ListSipRulesPaginatorOptions + client ListSipRulesAPIClient + params *ListSipRulesInput + nextToken *string + firstPage bool +} + +// NewListSipRulesPaginator returns a new ListSipRulesPaginator +func NewListSipRulesPaginator(client ListSipRulesAPIClient, params *ListSipRulesInput, optFns ...func(*ListSipRulesPaginatorOptions)) *ListSipRulesPaginator { + if params == nil { + params = &ListSipRulesInput{} + } + + options := ListSipRulesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSipRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSipRulesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSipRules page. +func (p *ListSipRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSipRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListSipRules(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListSipRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListSipRules", + } +} diff --git a/service/chimesdkvoice/api_op_ListSupportedPhoneNumberCountries.go b/service/chimesdkvoice/api_op_ListSupportedPhoneNumberCountries.go new file mode 100644 index 00000000000..18ce7014969 --- /dev/null +++ b/service/chimesdkvoice/api_op_ListSupportedPhoneNumberCountries.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListSupportedPhoneNumberCountries(ctx context.Context, params *ListSupportedPhoneNumberCountriesInput, optFns ...func(*Options)) (*ListSupportedPhoneNumberCountriesOutput, error) { + if params == nil { + params = &ListSupportedPhoneNumberCountriesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSupportedPhoneNumberCountries", params, optFns, c.addOperationListSupportedPhoneNumberCountriesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSupportedPhoneNumberCountriesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSupportedPhoneNumberCountriesInput struct { + + // This member is required. + ProductType types.PhoneNumberProductType + + noSmithyDocumentSerde +} + +type ListSupportedPhoneNumberCountriesOutput struct { + PhoneNumberCountries []types.PhoneNumberCountry + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSupportedPhoneNumberCountriesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSupportedPhoneNumberCountries{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSupportedPhoneNumberCountries{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListSupportedPhoneNumberCountriesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSupportedPhoneNumberCountries(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListSupportedPhoneNumberCountries(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListSupportedPhoneNumberCountries", + } +} diff --git a/service/chimesdkvoice/api_op_ListVoiceConnectorGroups.go b/service/chimesdkvoice/api_op_ListVoiceConnectorGroups.go new file mode 100644 index 00000000000..05939f795ee --- /dev/null +++ b/service/chimesdkvoice/api_op_ListVoiceConnectorGroups.go @@ -0,0 +1,207 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +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/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListVoiceConnectorGroups(ctx context.Context, params *ListVoiceConnectorGroupsInput, optFns ...func(*Options)) (*ListVoiceConnectorGroupsOutput, error) { + if params == nil { + params = &ListVoiceConnectorGroupsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVoiceConnectorGroups", params, optFns, c.addOperationListVoiceConnectorGroupsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVoiceConnectorGroupsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListVoiceConnectorGroupsInput struct { + MaxResults *int32 + + NextToken *string + + noSmithyDocumentSerde +} + +type ListVoiceConnectorGroupsOutput struct { + NextToken *string + + VoiceConnectorGroups []types.VoiceConnectorGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVoiceConnectorGroupsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVoiceConnectorGroups{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVoiceConnectorGroups{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVoiceConnectorGroups(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListVoiceConnectorGroupsAPIClient is a client that implements the +// ListVoiceConnectorGroups operation. +type ListVoiceConnectorGroupsAPIClient interface { + ListVoiceConnectorGroups(context.Context, *ListVoiceConnectorGroupsInput, ...func(*Options)) (*ListVoiceConnectorGroupsOutput, error) +} + +var _ ListVoiceConnectorGroupsAPIClient = (*Client)(nil) + +// ListVoiceConnectorGroupsPaginatorOptions is the paginator options for +// ListVoiceConnectorGroups +type ListVoiceConnectorGroupsPaginatorOptions struct { + 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 +} + +// ListVoiceConnectorGroupsPaginator is a paginator for ListVoiceConnectorGroups +type ListVoiceConnectorGroupsPaginator struct { + options ListVoiceConnectorGroupsPaginatorOptions + client ListVoiceConnectorGroupsAPIClient + params *ListVoiceConnectorGroupsInput + nextToken *string + firstPage bool +} + +// NewListVoiceConnectorGroupsPaginator returns a new +// ListVoiceConnectorGroupsPaginator +func NewListVoiceConnectorGroupsPaginator(client ListVoiceConnectorGroupsAPIClient, params *ListVoiceConnectorGroupsInput, optFns ...func(*ListVoiceConnectorGroupsPaginatorOptions)) *ListVoiceConnectorGroupsPaginator { + if params == nil { + params = &ListVoiceConnectorGroupsInput{} + } + + options := ListVoiceConnectorGroupsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListVoiceConnectorGroupsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVoiceConnectorGroupsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListVoiceConnectorGroups page. +func (p *ListVoiceConnectorGroupsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVoiceConnectorGroupsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListVoiceConnectorGroups(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListVoiceConnectorGroups(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListVoiceConnectorGroups", + } +} diff --git a/service/chimesdkvoice/api_op_ListVoiceConnectorTerminationCredentials.go b/service/chimesdkvoice/api_op_ListVoiceConnectorTerminationCredentials.go new file mode 100644 index 00000000000..035e0881c60 --- /dev/null +++ b/service/chimesdkvoice/api_op_ListVoiceConnectorTerminationCredentials.go @@ -0,0 +1,115 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListVoiceConnectorTerminationCredentials(ctx context.Context, params *ListVoiceConnectorTerminationCredentialsInput, optFns ...func(*Options)) (*ListVoiceConnectorTerminationCredentialsOutput, error) { + if params == nil { + params = &ListVoiceConnectorTerminationCredentialsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVoiceConnectorTerminationCredentials", params, optFns, c.addOperationListVoiceConnectorTerminationCredentialsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVoiceConnectorTerminationCredentialsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListVoiceConnectorTerminationCredentialsInput struct { + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type ListVoiceConnectorTerminationCredentialsOutput struct { + Usernames []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVoiceConnectorTerminationCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVoiceConnectorTerminationCredentials{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVoiceConnectorTerminationCredentials{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListVoiceConnectorTerminationCredentialsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVoiceConnectorTerminationCredentials(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListVoiceConnectorTerminationCredentials(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListVoiceConnectorTerminationCredentials", + } +} diff --git a/service/chimesdkvoice/api_op_ListVoiceConnectors.go b/service/chimesdkvoice/api_op_ListVoiceConnectors.go new file mode 100644 index 00000000000..f5bd80fa1e3 --- /dev/null +++ b/service/chimesdkvoice/api_op_ListVoiceConnectors.go @@ -0,0 +1,206 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +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/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ListVoiceConnectors(ctx context.Context, params *ListVoiceConnectorsInput, optFns ...func(*Options)) (*ListVoiceConnectorsOutput, error) { + if params == nil { + params = &ListVoiceConnectorsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListVoiceConnectors", params, optFns, c.addOperationListVoiceConnectorsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListVoiceConnectorsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListVoiceConnectorsInput struct { + MaxResults *int32 + + NextToken *string + + noSmithyDocumentSerde +} + +type ListVoiceConnectorsOutput struct { + NextToken *string + + VoiceConnectors []types.VoiceConnector + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListVoiceConnectorsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListVoiceConnectors{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListVoiceConnectors{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListVoiceConnectors(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListVoiceConnectorsAPIClient is a client that implements the ListVoiceConnectors +// operation. +type ListVoiceConnectorsAPIClient interface { + ListVoiceConnectors(context.Context, *ListVoiceConnectorsInput, ...func(*Options)) (*ListVoiceConnectorsOutput, error) +} + +var _ ListVoiceConnectorsAPIClient = (*Client)(nil) + +// ListVoiceConnectorsPaginatorOptions is the paginator options for +// ListVoiceConnectors +type ListVoiceConnectorsPaginatorOptions struct { + 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 +} + +// ListVoiceConnectorsPaginator is a paginator for ListVoiceConnectors +type ListVoiceConnectorsPaginator struct { + options ListVoiceConnectorsPaginatorOptions + client ListVoiceConnectorsAPIClient + params *ListVoiceConnectorsInput + nextToken *string + firstPage bool +} + +// NewListVoiceConnectorsPaginator returns a new ListVoiceConnectorsPaginator +func NewListVoiceConnectorsPaginator(client ListVoiceConnectorsAPIClient, params *ListVoiceConnectorsInput, optFns ...func(*ListVoiceConnectorsPaginatorOptions)) *ListVoiceConnectorsPaginator { + if params == nil { + params = &ListVoiceConnectorsInput{} + } + + options := ListVoiceConnectorsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListVoiceConnectorsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListVoiceConnectorsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListVoiceConnectors page. +func (p *ListVoiceConnectorsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListVoiceConnectorsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListVoiceConnectors(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListVoiceConnectors(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ListVoiceConnectors", + } +} diff --git a/service/chimesdkvoice/api_op_PutSipMediaApplicationAlexaSkillConfiguration.go b/service/chimesdkvoice/api_op_PutSipMediaApplicationAlexaSkillConfiguration.go new file mode 100644 index 00000000000..3d8580fdf26 --- /dev/null +++ b/service/chimesdkvoice/api_op_PutSipMediaApplicationAlexaSkillConfiguration.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutSipMediaApplicationAlexaSkillConfiguration(ctx context.Context, params *PutSipMediaApplicationAlexaSkillConfigurationInput, optFns ...func(*Options)) (*PutSipMediaApplicationAlexaSkillConfigurationOutput, error) { + if params == nil { + params = &PutSipMediaApplicationAlexaSkillConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutSipMediaApplicationAlexaSkillConfiguration", params, optFns, c.addOperationPutSipMediaApplicationAlexaSkillConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutSipMediaApplicationAlexaSkillConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutSipMediaApplicationAlexaSkillConfigurationInput struct { + + // This member is required. + SipMediaApplicationId *string + + SipMediaApplicationAlexaSkillConfiguration *types.SipMediaApplicationAlexaSkillConfiguration + + noSmithyDocumentSerde +} + +type PutSipMediaApplicationAlexaSkillConfigurationOutput struct { + SipMediaApplicationAlexaSkillConfiguration *types.SipMediaApplicationAlexaSkillConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutSipMediaApplicationAlexaSkillConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSipMediaApplicationAlexaSkillConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSipMediaApplicationAlexaSkillConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutSipMediaApplicationAlexaSkillConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSipMediaApplicationAlexaSkillConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutSipMediaApplicationAlexaSkillConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutSipMediaApplicationAlexaSkillConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_PutSipMediaApplicationLoggingConfiguration.go b/service/chimesdkvoice/api_op_PutSipMediaApplicationLoggingConfiguration.go new file mode 100644 index 00000000000..f9f217c4a3e --- /dev/null +++ b/service/chimesdkvoice/api_op_PutSipMediaApplicationLoggingConfiguration.go @@ -0,0 +1,118 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutSipMediaApplicationLoggingConfiguration(ctx context.Context, params *PutSipMediaApplicationLoggingConfigurationInput, optFns ...func(*Options)) (*PutSipMediaApplicationLoggingConfigurationOutput, error) { + if params == nil { + params = &PutSipMediaApplicationLoggingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutSipMediaApplicationLoggingConfiguration", params, optFns, c.addOperationPutSipMediaApplicationLoggingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutSipMediaApplicationLoggingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutSipMediaApplicationLoggingConfigurationInput struct { + + // This member is required. + SipMediaApplicationId *string + + SipMediaApplicationLoggingConfiguration *types.SipMediaApplicationLoggingConfiguration + + noSmithyDocumentSerde +} + +type PutSipMediaApplicationLoggingConfigurationOutput struct { + SipMediaApplicationLoggingConfiguration *types.SipMediaApplicationLoggingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutSipMediaApplicationLoggingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutSipMediaApplicationLoggingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutSipMediaApplicationLoggingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutSipMediaApplicationLoggingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutSipMediaApplicationLoggingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutSipMediaApplicationLoggingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutSipMediaApplicationLoggingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_PutVoiceConnectorEmergencyCallingConfiguration.go b/service/chimesdkvoice/api_op_PutVoiceConnectorEmergencyCallingConfiguration.go new file mode 100644 index 00000000000..485b0b4ac23 --- /dev/null +++ b/service/chimesdkvoice/api_op_PutVoiceConnectorEmergencyCallingConfiguration.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutVoiceConnectorEmergencyCallingConfiguration(ctx context.Context, params *PutVoiceConnectorEmergencyCallingConfigurationInput, optFns ...func(*Options)) (*PutVoiceConnectorEmergencyCallingConfigurationOutput, error) { + if params == nil { + params = &PutVoiceConnectorEmergencyCallingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutVoiceConnectorEmergencyCallingConfiguration", params, optFns, c.addOperationPutVoiceConnectorEmergencyCallingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutVoiceConnectorEmergencyCallingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutVoiceConnectorEmergencyCallingConfigurationInput struct { + + // This member is required. + EmergencyCallingConfiguration *types.EmergencyCallingConfiguration + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type PutVoiceConnectorEmergencyCallingConfigurationOutput struct { + EmergencyCallingConfiguration *types.EmergencyCallingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutVoiceConnectorEmergencyCallingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutVoiceConnectorEmergencyCallingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutVoiceConnectorEmergencyCallingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutVoiceConnectorEmergencyCallingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutVoiceConnectorEmergencyCallingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_PutVoiceConnectorLoggingConfiguration.go b/service/chimesdkvoice/api_op_PutVoiceConnectorLoggingConfiguration.go new file mode 100644 index 00000000000..97346013c0d --- /dev/null +++ b/service/chimesdkvoice/api_op_PutVoiceConnectorLoggingConfiguration.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutVoiceConnectorLoggingConfiguration(ctx context.Context, params *PutVoiceConnectorLoggingConfigurationInput, optFns ...func(*Options)) (*PutVoiceConnectorLoggingConfigurationOutput, error) { + if params == nil { + params = &PutVoiceConnectorLoggingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutVoiceConnectorLoggingConfiguration", params, optFns, c.addOperationPutVoiceConnectorLoggingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutVoiceConnectorLoggingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutVoiceConnectorLoggingConfigurationInput struct { + + // This member is required. + LoggingConfiguration *types.LoggingConfiguration + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type PutVoiceConnectorLoggingConfigurationOutput struct { + LoggingConfiguration *types.LoggingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutVoiceConnectorLoggingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutVoiceConnectorLoggingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutVoiceConnectorLoggingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutVoiceConnectorLoggingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutVoiceConnectorLoggingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutVoiceConnectorLoggingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutVoiceConnectorLoggingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_PutVoiceConnectorOrigination.go b/service/chimesdkvoice/api_op_PutVoiceConnectorOrigination.go new file mode 100644 index 00000000000..2a3b6d8d557 --- /dev/null +++ b/service/chimesdkvoice/api_op_PutVoiceConnectorOrigination.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutVoiceConnectorOrigination(ctx context.Context, params *PutVoiceConnectorOriginationInput, optFns ...func(*Options)) (*PutVoiceConnectorOriginationOutput, error) { + if params == nil { + params = &PutVoiceConnectorOriginationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutVoiceConnectorOrigination", params, optFns, c.addOperationPutVoiceConnectorOriginationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutVoiceConnectorOriginationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutVoiceConnectorOriginationInput struct { + + // This member is required. + Origination *types.Origination + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type PutVoiceConnectorOriginationOutput struct { + Origination *types.Origination + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutVoiceConnectorOriginationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutVoiceConnectorOrigination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutVoiceConnectorOrigination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutVoiceConnectorOriginationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutVoiceConnectorOrigination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutVoiceConnectorOrigination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutVoiceConnectorOrigination", + } +} diff --git a/service/chimesdkvoice/api_op_PutVoiceConnectorProxy.go b/service/chimesdkvoice/api_op_PutVoiceConnectorProxy.go new file mode 100644 index 00000000000..fff5482405e --- /dev/null +++ b/service/chimesdkvoice/api_op_PutVoiceConnectorProxy.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutVoiceConnectorProxy(ctx context.Context, params *PutVoiceConnectorProxyInput, optFns ...func(*Options)) (*PutVoiceConnectorProxyOutput, error) { + if params == nil { + params = &PutVoiceConnectorProxyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutVoiceConnectorProxy", params, optFns, c.addOperationPutVoiceConnectorProxyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutVoiceConnectorProxyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutVoiceConnectorProxyInput struct { + + // This member is required. + DefaultSessionExpiryMinutes *int32 + + // This member is required. + PhoneNumberPoolCountries []string + + // This member is required. + VoiceConnectorId *string + + Disabled *bool + + FallBackPhoneNumber *string + + noSmithyDocumentSerde +} + +type PutVoiceConnectorProxyOutput struct { + Proxy *types.Proxy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutVoiceConnectorProxyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutVoiceConnectorProxy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutVoiceConnectorProxy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutVoiceConnectorProxyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutVoiceConnectorProxy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutVoiceConnectorProxy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutVoiceConnectorProxy", + } +} diff --git a/service/chimesdkvoice/api_op_PutVoiceConnectorStreamingConfiguration.go b/service/chimesdkvoice/api_op_PutVoiceConnectorStreamingConfiguration.go new file mode 100644 index 00000000000..282fed22cbb --- /dev/null +++ b/service/chimesdkvoice/api_op_PutVoiceConnectorStreamingConfiguration.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutVoiceConnectorStreamingConfiguration(ctx context.Context, params *PutVoiceConnectorStreamingConfigurationInput, optFns ...func(*Options)) (*PutVoiceConnectorStreamingConfigurationOutput, error) { + if params == nil { + params = &PutVoiceConnectorStreamingConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutVoiceConnectorStreamingConfiguration", params, optFns, c.addOperationPutVoiceConnectorStreamingConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutVoiceConnectorStreamingConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutVoiceConnectorStreamingConfigurationInput struct { + + // This member is required. + StreamingConfiguration *types.StreamingConfiguration + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type PutVoiceConnectorStreamingConfigurationOutput struct { + StreamingConfiguration *types.StreamingConfiguration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutVoiceConnectorStreamingConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutVoiceConnectorStreamingConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutVoiceConnectorStreamingConfiguration{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutVoiceConnectorStreamingConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutVoiceConnectorStreamingConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutVoiceConnectorStreamingConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutVoiceConnectorStreamingConfiguration", + } +} diff --git a/service/chimesdkvoice/api_op_PutVoiceConnectorTermination.go b/service/chimesdkvoice/api_op_PutVoiceConnectorTermination.go new file mode 100644 index 00000000000..e22685b58bc --- /dev/null +++ b/service/chimesdkvoice/api_op_PutVoiceConnectorTermination.go @@ -0,0 +1,119 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutVoiceConnectorTermination(ctx context.Context, params *PutVoiceConnectorTerminationInput, optFns ...func(*Options)) (*PutVoiceConnectorTerminationOutput, error) { + if params == nil { + params = &PutVoiceConnectorTerminationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutVoiceConnectorTermination", params, optFns, c.addOperationPutVoiceConnectorTerminationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutVoiceConnectorTerminationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutVoiceConnectorTerminationInput struct { + + // This member is required. + Termination *types.Termination + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type PutVoiceConnectorTerminationOutput struct { + Termination *types.Termination + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutVoiceConnectorTerminationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutVoiceConnectorTermination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutVoiceConnectorTermination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutVoiceConnectorTerminationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutVoiceConnectorTermination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutVoiceConnectorTermination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutVoiceConnectorTermination", + } +} diff --git a/service/chimesdkvoice/api_op_PutVoiceConnectorTerminationCredentials.go b/service/chimesdkvoice/api_op_PutVoiceConnectorTerminationCredentials.go new file mode 100644 index 00000000000..f829fc25c0a --- /dev/null +++ b/service/chimesdkvoice/api_op_PutVoiceConnectorTerminationCredentials.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) PutVoiceConnectorTerminationCredentials(ctx context.Context, params *PutVoiceConnectorTerminationCredentialsInput, optFns ...func(*Options)) (*PutVoiceConnectorTerminationCredentialsOutput, error) { + if params == nil { + params = &PutVoiceConnectorTerminationCredentialsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutVoiceConnectorTerminationCredentials", params, optFns, c.addOperationPutVoiceConnectorTerminationCredentialsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutVoiceConnectorTerminationCredentialsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutVoiceConnectorTerminationCredentialsInput struct { + + // This member is required. + VoiceConnectorId *string + + Credentials []types.Credential + + noSmithyDocumentSerde +} + +type PutVoiceConnectorTerminationCredentialsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutVoiceConnectorTerminationCredentialsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpPutVoiceConnectorTerminationCredentials{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpPutVoiceConnectorTerminationCredentials{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpPutVoiceConnectorTerminationCredentialsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutVoiceConnectorTerminationCredentials(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutVoiceConnectorTerminationCredentials(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "PutVoiceConnectorTerminationCredentials", + } +} diff --git a/service/chimesdkvoice/api_op_RestorePhoneNumber.go b/service/chimesdkvoice/api_op_RestorePhoneNumber.go new file mode 100644 index 00000000000..0719dd23272 --- /dev/null +++ b/service/chimesdkvoice/api_op_RestorePhoneNumber.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) RestorePhoneNumber(ctx context.Context, params *RestorePhoneNumberInput, optFns ...func(*Options)) (*RestorePhoneNumberOutput, error) { + if params == nil { + params = &RestorePhoneNumberInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RestorePhoneNumber", params, optFns, c.addOperationRestorePhoneNumberMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RestorePhoneNumberOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RestorePhoneNumberInput struct { + + // This member is required. + PhoneNumberId *string + + noSmithyDocumentSerde +} + +type RestorePhoneNumberOutput struct { + PhoneNumber *types.PhoneNumber + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRestorePhoneNumberMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpRestorePhoneNumber{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRestorePhoneNumber{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpRestorePhoneNumberValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRestorePhoneNumber(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRestorePhoneNumber(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "RestorePhoneNumber", + } +} diff --git a/service/chimesdkvoice/api_op_SearchAvailablePhoneNumbers.go b/service/chimesdkvoice/api_op_SearchAvailablePhoneNumbers.go new file mode 100644 index 00000000000..5254fadd995 --- /dev/null +++ b/service/chimesdkvoice/api_op_SearchAvailablePhoneNumbers.go @@ -0,0 +1,220 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +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/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) SearchAvailablePhoneNumbers(ctx context.Context, params *SearchAvailablePhoneNumbersInput, optFns ...func(*Options)) (*SearchAvailablePhoneNumbersOutput, error) { + if params == nil { + params = &SearchAvailablePhoneNumbersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchAvailablePhoneNumbers", params, optFns, c.addOperationSearchAvailablePhoneNumbersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchAvailablePhoneNumbersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchAvailablePhoneNumbersInput struct { + AreaCode *string + + City *string + + Country *string + + MaxResults *int32 + + NextToken *string + + PhoneNumberType types.PhoneNumberType + + State *string + + TollFreePrefix *string + + noSmithyDocumentSerde +} + +type SearchAvailablePhoneNumbersOutput struct { + E164PhoneNumbers []string + + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchAvailablePhoneNumbersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchAvailablePhoneNumbers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchAvailablePhoneNumbers{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchAvailablePhoneNumbers(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// SearchAvailablePhoneNumbersAPIClient is a client that implements the +// SearchAvailablePhoneNumbers operation. +type SearchAvailablePhoneNumbersAPIClient interface { + SearchAvailablePhoneNumbers(context.Context, *SearchAvailablePhoneNumbersInput, ...func(*Options)) (*SearchAvailablePhoneNumbersOutput, error) +} + +var _ SearchAvailablePhoneNumbersAPIClient = (*Client)(nil) + +// SearchAvailablePhoneNumbersPaginatorOptions is the paginator options for +// SearchAvailablePhoneNumbers +type SearchAvailablePhoneNumbersPaginatorOptions struct { + 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 +} + +// SearchAvailablePhoneNumbersPaginator is a paginator for +// SearchAvailablePhoneNumbers +type SearchAvailablePhoneNumbersPaginator struct { + options SearchAvailablePhoneNumbersPaginatorOptions + client SearchAvailablePhoneNumbersAPIClient + params *SearchAvailablePhoneNumbersInput + nextToken *string + firstPage bool +} + +// NewSearchAvailablePhoneNumbersPaginator returns a new +// SearchAvailablePhoneNumbersPaginator +func NewSearchAvailablePhoneNumbersPaginator(client SearchAvailablePhoneNumbersAPIClient, params *SearchAvailablePhoneNumbersInput, optFns ...func(*SearchAvailablePhoneNumbersPaginatorOptions)) *SearchAvailablePhoneNumbersPaginator { + if params == nil { + params = &SearchAvailablePhoneNumbersInput{} + } + + options := SearchAvailablePhoneNumbersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchAvailablePhoneNumbersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchAvailablePhoneNumbersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchAvailablePhoneNumbers page. +func (p *SearchAvailablePhoneNumbersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchAvailablePhoneNumbersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.SearchAvailablePhoneNumbers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opSearchAvailablePhoneNumbers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "SearchAvailablePhoneNumbers", + } +} diff --git a/service/chimesdkvoice/api_op_UpdateGlobalSettings.go b/service/chimesdkvoice/api_op_UpdateGlobalSettings.go new file mode 100644 index 00000000000..8f8778cbf3e --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdateGlobalSettings.go @@ -0,0 +1,109 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdateGlobalSettings(ctx context.Context, params *UpdateGlobalSettingsInput, optFns ...func(*Options)) (*UpdateGlobalSettingsOutput, error) { + if params == nil { + params = &UpdateGlobalSettingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateGlobalSettings", params, optFns, c.addOperationUpdateGlobalSettingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateGlobalSettingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateGlobalSettingsInput struct { + VoiceConnector *types.VoiceConnectorSettings + + noSmithyDocumentSerde +} + +type UpdateGlobalSettingsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateGlobalSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateGlobalSettings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateGlobalSettings{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateGlobalSettings(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateGlobalSettings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdateGlobalSettings", + } +} diff --git a/service/chimesdkvoice/api_op_UpdatePhoneNumber.go b/service/chimesdkvoice/api_op_UpdatePhoneNumber.go new file mode 100644 index 00000000000..d5611f41ba1 --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdatePhoneNumber.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdatePhoneNumber(ctx context.Context, params *UpdatePhoneNumberInput, optFns ...func(*Options)) (*UpdatePhoneNumberOutput, error) { + if params == nil { + params = &UpdatePhoneNumberInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePhoneNumber", params, optFns, c.addOperationUpdatePhoneNumberMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePhoneNumberOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePhoneNumberInput struct { + + // This member is required. + PhoneNumberId *string + + CallingName *string + + ProductType types.PhoneNumberProductType + + noSmithyDocumentSerde +} + +type UpdatePhoneNumberOutput struct { + PhoneNumber *types.PhoneNumber + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePhoneNumberMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePhoneNumber{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePhoneNumber{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdatePhoneNumberValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePhoneNumber(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdatePhoneNumber(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdatePhoneNumber", + } +} diff --git a/service/chimesdkvoice/api_op_UpdatePhoneNumberSettings.go b/service/chimesdkvoice/api_op_UpdatePhoneNumberSettings.go new file mode 100644 index 00000000000..6b25b60619e --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdatePhoneNumberSettings.go @@ -0,0 +1,113 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdatePhoneNumberSettings(ctx context.Context, params *UpdatePhoneNumberSettingsInput, optFns ...func(*Options)) (*UpdatePhoneNumberSettingsOutput, error) { + if params == nil { + params = &UpdatePhoneNumberSettingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdatePhoneNumberSettings", params, optFns, c.addOperationUpdatePhoneNumberSettingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdatePhoneNumberSettingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdatePhoneNumberSettingsInput struct { + + // This member is required. + CallingName *string + + noSmithyDocumentSerde +} + +type UpdatePhoneNumberSettingsOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdatePhoneNumberSettingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdatePhoneNumberSettings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdatePhoneNumberSettings{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdatePhoneNumberSettingsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdatePhoneNumberSettings(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdatePhoneNumberSettings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdatePhoneNumberSettings", + } +} diff --git a/service/chimesdkvoice/api_op_UpdateProxySession.go b/service/chimesdkvoice/api_op_UpdateProxySession.go new file mode 100644 index 00000000000..876d07280ab --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdateProxySession.go @@ -0,0 +1,124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdateProxySession(ctx context.Context, params *UpdateProxySessionInput, optFns ...func(*Options)) (*UpdateProxySessionOutput, error) { + if params == nil { + params = &UpdateProxySessionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateProxySession", params, optFns, c.addOperationUpdateProxySessionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateProxySessionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateProxySessionInput struct { + + // This member is required. + Capabilities []types.Capability + + // This member is required. + ProxySessionId *string + + // This member is required. + VoiceConnectorId *string + + ExpiryMinutes *int32 + + noSmithyDocumentSerde +} + +type UpdateProxySessionOutput struct { + ProxySession *types.ProxySession + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateProxySessionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateProxySession{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateProxySession{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateProxySessionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateProxySession(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateProxySession(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdateProxySession", + } +} diff --git a/service/chimesdkvoice/api_op_UpdateSipMediaApplication.go b/service/chimesdkvoice/api_op_UpdateSipMediaApplication.go new file mode 100644 index 00000000000..c5bc1e7a6fc --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdateSipMediaApplication.go @@ -0,0 +1,120 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdateSipMediaApplication(ctx context.Context, params *UpdateSipMediaApplicationInput, optFns ...func(*Options)) (*UpdateSipMediaApplicationOutput, error) { + if params == nil { + params = &UpdateSipMediaApplicationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSipMediaApplication", params, optFns, c.addOperationUpdateSipMediaApplicationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSipMediaApplicationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSipMediaApplicationInput struct { + + // This member is required. + SipMediaApplicationId *string + + Endpoints []types.SipMediaApplicationEndpoint + + Name *string + + noSmithyDocumentSerde +} + +type UpdateSipMediaApplicationOutput struct { + SipMediaApplication *types.SipMediaApplication + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSipMediaApplicationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSipMediaApplication{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSipMediaApplication{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSipMediaApplicationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSipMediaApplication(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSipMediaApplication(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdateSipMediaApplication", + } +} diff --git a/service/chimesdkvoice/api_op_UpdateSipMediaApplicationCall.go b/service/chimesdkvoice/api_op_UpdateSipMediaApplicationCall.go new file mode 100644 index 00000000000..8fa2f07d0b0 --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdateSipMediaApplicationCall.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdateSipMediaApplicationCall(ctx context.Context, params *UpdateSipMediaApplicationCallInput, optFns ...func(*Options)) (*UpdateSipMediaApplicationCallOutput, error) { + if params == nil { + params = &UpdateSipMediaApplicationCallInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSipMediaApplicationCall", params, optFns, c.addOperationUpdateSipMediaApplicationCallMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSipMediaApplicationCallOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSipMediaApplicationCallInput struct { + + // This member is required. + Arguments map[string]string + + // This member is required. + SipMediaApplicationId *string + + // This member is required. + TransactionId *string + + noSmithyDocumentSerde +} + +type UpdateSipMediaApplicationCallOutput struct { + SipMediaApplicationCall *types.SipMediaApplicationCall + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSipMediaApplicationCallMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSipMediaApplicationCall{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSipMediaApplicationCall{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSipMediaApplicationCallValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSipMediaApplicationCall(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSipMediaApplicationCall(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdateSipMediaApplicationCall", + } +} diff --git a/service/chimesdkvoice/api_op_UpdateSipRule.go b/service/chimesdkvoice/api_op_UpdateSipRule.go new file mode 100644 index 00000000000..ebdfd37da5e --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdateSipRule.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdateSipRule(ctx context.Context, params *UpdateSipRuleInput, optFns ...func(*Options)) (*UpdateSipRuleOutput, error) { + if params == nil { + params = &UpdateSipRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSipRule", params, optFns, c.addOperationUpdateSipRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSipRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSipRuleInput struct { + + // This member is required. + Name *string + + // This member is required. + SipRuleId *string + + Disabled *bool + + TargetApplications []types.SipRuleTargetApplication + + noSmithyDocumentSerde +} + +type UpdateSipRuleOutput struct { + SipRule *types.SipRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSipRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSipRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSipRule{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSipRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSipRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSipRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdateSipRule", + } +} diff --git a/service/chimesdkvoice/api_op_UpdateVoiceConnector.go b/service/chimesdkvoice/api_op_UpdateVoiceConnector.go new file mode 100644 index 00000000000..16d8666c1c4 --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdateVoiceConnector.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdateVoiceConnector(ctx context.Context, params *UpdateVoiceConnectorInput, optFns ...func(*Options)) (*UpdateVoiceConnectorOutput, error) { + if params == nil { + params = &UpdateVoiceConnectorInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateVoiceConnector", params, optFns, c.addOperationUpdateVoiceConnectorMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateVoiceConnectorOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateVoiceConnectorInput struct { + + // This member is required. + Name *string + + // This member is required. + RequireEncryption *bool + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type UpdateVoiceConnectorOutput struct { + VoiceConnector *types.VoiceConnector + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateVoiceConnectorMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateVoiceConnector{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateVoiceConnector{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateVoiceConnectorValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVoiceConnector(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateVoiceConnector(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdateVoiceConnector", + } +} diff --git a/service/chimesdkvoice/api_op_UpdateVoiceConnectorGroup.go b/service/chimesdkvoice/api_op_UpdateVoiceConnectorGroup.go new file mode 100644 index 00000000000..9144dddeede --- /dev/null +++ b/service/chimesdkvoice/api_op_UpdateVoiceConnectorGroup.go @@ -0,0 +1,122 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) UpdateVoiceConnectorGroup(ctx context.Context, params *UpdateVoiceConnectorGroupInput, optFns ...func(*Options)) (*UpdateVoiceConnectorGroupOutput, error) { + if params == nil { + params = &UpdateVoiceConnectorGroupInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateVoiceConnectorGroup", params, optFns, c.addOperationUpdateVoiceConnectorGroupMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateVoiceConnectorGroupOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateVoiceConnectorGroupInput struct { + + // This member is required. + Name *string + + // This member is required. + VoiceConnectorGroupId *string + + // This member is required. + VoiceConnectorItems []types.VoiceConnectorItem + + noSmithyDocumentSerde +} + +type UpdateVoiceConnectorGroupOutput struct { + VoiceConnectorGroup *types.VoiceConnectorGroup + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateVoiceConnectorGroupMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateVoiceConnectorGroup{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateVoiceConnectorGroupValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateVoiceConnectorGroup(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateVoiceConnectorGroup(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "UpdateVoiceConnectorGroup", + } +} diff --git a/service/chimesdkvoice/api_op_ValidateE911Address.go b/service/chimesdkvoice/api_op_ValidateE911Address.go new file mode 100644 index 00000000000..ce67dde0264 --- /dev/null +++ b/service/chimesdkvoice/api_op_ValidateE911Address.go @@ -0,0 +1,140 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func (c *Client) ValidateE911Address(ctx context.Context, params *ValidateE911AddressInput, optFns ...func(*Options)) (*ValidateE911AddressOutput, error) { + if params == nil { + params = &ValidateE911AddressInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ValidateE911Address", params, optFns, c.addOperationValidateE911AddressMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ValidateE911AddressOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ValidateE911AddressInput struct { + + // This member is required. + AwsAccountId *string + + // This member is required. + City *string + + // This member is required. + Country *string + + // This member is required. + PostalCode *string + + // This member is required. + State *string + + // This member is required. + StreetInfo *string + + // This member is required. + StreetNumber *string + + noSmithyDocumentSerde +} + +type ValidateE911AddressOutput struct { + Address *types.Address + + AddressExternalId *string + + CandidateAddressList []types.CandidateAddress + + ValidationResult int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationValidateE911AddressMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpValidateE911Address{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpValidateE911Address{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpValidateE911AddressValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opValidateE911Address(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opValidateE911Address(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "chime", + OperationName: "ValidateE911Address", + } +} diff --git a/service/chimesdkvoice/deserializers.go b/service/chimesdkvoice/deserializers.go new file mode 100644 index 00000000000..b0f5b080db6 --- /dev/null +++ b/service/chimesdkvoice/deserializers.go @@ -0,0 +1,15596 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "io/ioutil" + "strings" +) + +type awsRestjson1_deserializeOpAssociatePhoneNumbersWithVoiceConnector struct { +} + +func (*awsRestjson1_deserializeOpAssociatePhoneNumbersWithVoiceConnector) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociatePhoneNumbersWithVoiceConnector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorAssociatePhoneNumbersWithVoiceConnector(response, &metadata) + } + output := &AssociatePhoneNumbersWithVoiceConnectorOutput{} + 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_deserializeOpDocumentAssociatePhoneNumbersWithVoiceConnectorOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociatePhoneNumbersWithVoiceConnector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAssociatePhoneNumbersWithVoiceConnectorOutput(v **AssociatePhoneNumbersWithVoiceConnectorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *AssociatePhoneNumbersWithVoiceConnectorOutput + if *v == nil { + sv = &AssociatePhoneNumbersWithVoiceConnectorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberErrors": + if err := awsRestjson1_deserializeDocumentPhoneNumberErrorList(&sv.PhoneNumberErrors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpAssociatePhoneNumbersWithVoiceConnectorGroup struct { +} + +func (*awsRestjson1_deserializeOpAssociatePhoneNumbersWithVoiceConnectorGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociatePhoneNumbersWithVoiceConnectorGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorAssociatePhoneNumbersWithVoiceConnectorGroup(response, &metadata) + } + output := &AssociatePhoneNumbersWithVoiceConnectorGroupOutput{} + 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_deserializeOpDocumentAssociatePhoneNumbersWithVoiceConnectorGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociatePhoneNumbersWithVoiceConnectorGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentAssociatePhoneNumbersWithVoiceConnectorGroupOutput(v **AssociatePhoneNumbersWithVoiceConnectorGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *AssociatePhoneNumbersWithVoiceConnectorGroupOutput + if *v == nil { + sv = &AssociatePhoneNumbersWithVoiceConnectorGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberErrors": + if err := awsRestjson1_deserializeDocumentPhoneNumberErrorList(&sv.PhoneNumberErrors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpBatchDeletePhoneNumber struct { +} + +func (*awsRestjson1_deserializeOpBatchDeletePhoneNumber) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchDeletePhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorBatchDeletePhoneNumber(response, &metadata) + } + output := &BatchDeletePhoneNumberOutput{} + 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_deserializeOpDocumentBatchDeletePhoneNumberOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchDeletePhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentBatchDeletePhoneNumberOutput(v **BatchDeletePhoneNumberOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *BatchDeletePhoneNumberOutput + if *v == nil { + sv = &BatchDeletePhoneNumberOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberErrors": + if err := awsRestjson1_deserializeDocumentPhoneNumberErrorList(&sv.PhoneNumberErrors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpBatchUpdatePhoneNumber struct { +} + +func (*awsRestjson1_deserializeOpBatchUpdatePhoneNumber) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpBatchUpdatePhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorBatchUpdatePhoneNumber(response, &metadata) + } + output := &BatchUpdatePhoneNumberOutput{} + 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_deserializeOpDocumentBatchUpdatePhoneNumberOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorBatchUpdatePhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentBatchUpdatePhoneNumberOutput(v **BatchUpdatePhoneNumberOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *BatchUpdatePhoneNumberOutput + if *v == nil { + sv = &BatchUpdatePhoneNumberOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberErrors": + if err := awsRestjson1_deserializeDocumentPhoneNumberErrorList(&sv.PhoneNumberErrors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreatePhoneNumberOrder struct { +} + +func (*awsRestjson1_deserializeOpCreatePhoneNumberOrder) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreatePhoneNumberOrder) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreatePhoneNumberOrder(response, &metadata) + } + output := &CreatePhoneNumberOrderOutput{} + 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_deserializeOpDocumentCreatePhoneNumberOrderOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreatePhoneNumberOrder(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreatePhoneNumberOrderOutput(v **CreatePhoneNumberOrderOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreatePhoneNumberOrderOutput + if *v == nil { + sv = &CreatePhoneNumberOrderOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberOrder": + if err := awsRestjson1_deserializeDocumentPhoneNumberOrder(&sv.PhoneNumberOrder, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateProxySession struct { +} + +func (*awsRestjson1_deserializeOpCreateProxySession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateProxySession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateProxySession(response, &metadata) + } + output := &CreateProxySessionOutput{} + 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_deserializeOpDocumentCreateProxySessionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateProxySession(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateProxySessionOutput(v **CreateProxySessionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateProxySessionOutput + if *v == nil { + sv = &CreateProxySessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProxySession": + if err := awsRestjson1_deserializeDocumentProxySession(&sv.ProxySession, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateSipMediaApplication struct { +} + +func (*awsRestjson1_deserializeOpCreateSipMediaApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSipMediaApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateSipMediaApplication(response, &metadata) + } + output := &CreateSipMediaApplicationOutput{} + 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_deserializeOpDocumentCreateSipMediaApplicationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateSipMediaApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSipMediaApplicationOutput(v **CreateSipMediaApplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateSipMediaApplicationOutput + if *v == nil { + sv = &CreateSipMediaApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplication": + if err := awsRestjson1_deserializeDocumentSipMediaApplication(&sv.SipMediaApplication, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateSipMediaApplicationCall struct { +} + +func (*awsRestjson1_deserializeOpCreateSipMediaApplicationCall) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSipMediaApplicationCall) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateSipMediaApplicationCall(response, &metadata) + } + output := &CreateSipMediaApplicationCallOutput{} + 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_deserializeOpDocumentCreateSipMediaApplicationCallOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateSipMediaApplicationCall(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSipMediaApplicationCallOutput(v **CreateSipMediaApplicationCallOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateSipMediaApplicationCallOutput + if *v == nil { + sv = &CreateSipMediaApplicationCallOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplicationCall": + if err := awsRestjson1_deserializeDocumentSipMediaApplicationCall(&sv.SipMediaApplicationCall, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateSipRule struct { +} + +func (*awsRestjson1_deserializeOpCreateSipRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSipRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateSipRule(response, &metadata) + } + output := &CreateSipRuleOutput{} + 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_deserializeOpDocumentCreateSipRuleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateSipRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSipRuleOutput(v **CreateSipRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateSipRuleOutput + if *v == nil { + sv = &CreateSipRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipRule": + if err := awsRestjson1_deserializeDocumentSipRule(&sv.SipRule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateVoiceConnector struct { +} + +func (*awsRestjson1_deserializeOpCreateVoiceConnector) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateVoiceConnector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateVoiceConnector(response, &metadata) + } + output := &CreateVoiceConnectorOutput{} + 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_deserializeOpDocumentCreateVoiceConnectorOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateVoiceConnector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateVoiceConnectorOutput(v **CreateVoiceConnectorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateVoiceConnectorOutput + if *v == nil { + sv = &CreateVoiceConnectorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VoiceConnector": + if err := awsRestjson1_deserializeDocumentVoiceConnector(&sv.VoiceConnector, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateVoiceConnectorGroup struct { +} + +func (*awsRestjson1_deserializeOpCreateVoiceConnectorGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateVoiceConnectorGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateVoiceConnectorGroup(response, &metadata) + } + output := &CreateVoiceConnectorGroupOutput{} + 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_deserializeOpDocumentCreateVoiceConnectorGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateVoiceConnectorGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateVoiceConnectorGroupOutput(v **CreateVoiceConnectorGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateVoiceConnectorGroupOutput + if *v == nil { + sv = &CreateVoiceConnectorGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VoiceConnectorGroup": + if err := awsRestjson1_deserializeDocumentVoiceConnectorGroup(&sv.VoiceConnectorGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeletePhoneNumber struct { +} + +func (*awsRestjson1_deserializeOpDeletePhoneNumber) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeletePhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeletePhoneNumber(response, &metadata) + } + output := &DeletePhoneNumberOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeletePhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteProxySession struct { +} + +func (*awsRestjson1_deserializeOpDeleteProxySession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteProxySession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteProxySession(response, &metadata) + } + output := &DeleteProxySessionOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteProxySession(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteSipMediaApplication struct { +} + +func (*awsRestjson1_deserializeOpDeleteSipMediaApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSipMediaApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteSipMediaApplication(response, &metadata) + } + output := &DeleteSipMediaApplicationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSipMediaApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteSipRule struct { +} + +func (*awsRestjson1_deserializeOpDeleteSipRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSipRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteSipRule(response, &metadata) + } + output := &DeleteSipRuleOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSipRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteVoiceConnector struct { +} + +func (*awsRestjson1_deserializeOpDeleteVoiceConnector) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVoiceConnector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVoiceConnector(response, &metadata) + } + output := &DeleteVoiceConnectorOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteVoiceConnector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpDeleteVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVoiceConnectorEmergencyCallingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVoiceConnectorEmergencyCallingConfiguration(response, &metadata) + } + output := &DeleteVoiceConnectorEmergencyCallingConfigurationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteVoiceConnectorEmergencyCallingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteVoiceConnectorGroup struct { +} + +func (*awsRestjson1_deserializeOpDeleteVoiceConnectorGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVoiceConnectorGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVoiceConnectorGroup(response, &metadata) + } + output := &DeleteVoiceConnectorGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteVoiceConnectorGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteVoiceConnectorOrigination struct { +} + +func (*awsRestjson1_deserializeOpDeleteVoiceConnectorOrigination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVoiceConnectorOrigination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVoiceConnectorOrigination(response, &metadata) + } + output := &DeleteVoiceConnectorOriginationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteVoiceConnectorOrigination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteVoiceConnectorProxy struct { +} + +func (*awsRestjson1_deserializeOpDeleteVoiceConnectorProxy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVoiceConnectorProxy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVoiceConnectorProxy(response, &metadata) + } + output := &DeleteVoiceConnectorProxyOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteVoiceConnectorProxy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteVoiceConnectorStreamingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpDeleteVoiceConnectorStreamingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVoiceConnectorStreamingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVoiceConnectorStreamingConfiguration(response, &metadata) + } + output := &DeleteVoiceConnectorStreamingConfigurationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteVoiceConnectorStreamingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteVoiceConnectorTermination struct { +} + +func (*awsRestjson1_deserializeOpDeleteVoiceConnectorTermination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVoiceConnectorTermination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVoiceConnectorTermination(response, &metadata) + } + output := &DeleteVoiceConnectorTerminationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteVoiceConnectorTermination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteVoiceConnectorTerminationCredentials struct { +} + +func (*awsRestjson1_deserializeOpDeleteVoiceConnectorTerminationCredentials) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteVoiceConnectorTerminationCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteVoiceConnectorTerminationCredentials(response, &metadata) + } + output := &DeleteVoiceConnectorTerminationCredentialsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteVoiceConnectorTerminationCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDisassociatePhoneNumbersFromVoiceConnector struct { +} + +func (*awsRestjson1_deserializeOpDisassociatePhoneNumbersFromVoiceConnector) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociatePhoneNumbersFromVoiceConnector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDisassociatePhoneNumbersFromVoiceConnector(response, &metadata) + } + output := &DisassociatePhoneNumbersFromVoiceConnectorOutput{} + 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_deserializeOpDocumentDisassociatePhoneNumbersFromVoiceConnectorOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociatePhoneNumbersFromVoiceConnector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDisassociatePhoneNumbersFromVoiceConnectorOutput(v **DisassociatePhoneNumbersFromVoiceConnectorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *DisassociatePhoneNumbersFromVoiceConnectorOutput + if *v == nil { + sv = &DisassociatePhoneNumbersFromVoiceConnectorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberErrors": + if err := awsRestjson1_deserializeDocumentPhoneNumberErrorList(&sv.PhoneNumberErrors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDisassociatePhoneNumbersFromVoiceConnectorGroup struct { +} + +func (*awsRestjson1_deserializeOpDisassociatePhoneNumbersFromVoiceConnectorGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociatePhoneNumbersFromVoiceConnectorGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDisassociatePhoneNumbersFromVoiceConnectorGroup(response, &metadata) + } + output := &DisassociatePhoneNumbersFromVoiceConnectorGroupOutput{} + 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_deserializeOpDocumentDisassociatePhoneNumbersFromVoiceConnectorGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociatePhoneNumbersFromVoiceConnectorGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDisassociatePhoneNumbersFromVoiceConnectorGroupOutput(v **DisassociatePhoneNumbersFromVoiceConnectorGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *DisassociatePhoneNumbersFromVoiceConnectorGroupOutput + if *v == nil { + sv = &DisassociatePhoneNumbersFromVoiceConnectorGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberErrors": + if err := awsRestjson1_deserializeDocumentPhoneNumberErrorList(&sv.PhoneNumberErrors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetGlobalSettings struct { +} + +func (*awsRestjson1_deserializeOpGetGlobalSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetGlobalSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetGlobalSettings(response, &metadata) + } + output := &GetGlobalSettingsOutput{} + 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_deserializeOpDocumentGetGlobalSettingsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetGlobalSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetGlobalSettingsOutput(v **GetGlobalSettingsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetGlobalSettingsOutput + if *v == nil { + sv = &GetGlobalSettingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VoiceConnector": + if err := awsRestjson1_deserializeDocumentVoiceConnectorSettings(&sv.VoiceConnector, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetPhoneNumber struct { +} + +func (*awsRestjson1_deserializeOpGetPhoneNumber) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetPhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetPhoneNumber(response, &metadata) + } + output := &GetPhoneNumberOutput{} + 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_deserializeOpDocumentGetPhoneNumberOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetPhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetPhoneNumberOutput(v **GetPhoneNumberOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetPhoneNumberOutput + if *v == nil { + sv = &GetPhoneNumberOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumber": + if err := awsRestjson1_deserializeDocumentPhoneNumber(&sv.PhoneNumber, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetPhoneNumberOrder struct { +} + +func (*awsRestjson1_deserializeOpGetPhoneNumberOrder) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetPhoneNumberOrder) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetPhoneNumberOrder(response, &metadata) + } + output := &GetPhoneNumberOrderOutput{} + 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_deserializeOpDocumentGetPhoneNumberOrderOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetPhoneNumberOrder(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetPhoneNumberOrderOutput(v **GetPhoneNumberOrderOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetPhoneNumberOrderOutput + if *v == nil { + sv = &GetPhoneNumberOrderOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberOrder": + if err := awsRestjson1_deserializeDocumentPhoneNumberOrder(&sv.PhoneNumberOrder, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetPhoneNumberSettings struct { +} + +func (*awsRestjson1_deserializeOpGetPhoneNumberSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetPhoneNumberSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetPhoneNumberSettings(response, &metadata) + } + output := &GetPhoneNumberSettingsOutput{} + 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_deserializeOpDocumentGetPhoneNumberSettingsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetPhoneNumberSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetPhoneNumberSettingsOutput(v **GetPhoneNumberSettingsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetPhoneNumberSettingsOutput + if *v == nil { + sv = &GetPhoneNumberSettingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CallingName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CallingName to be of type string, got %T instead", value) + } + sv.CallingName = ptr.String(jtv) + } + + case "CallingNameUpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CallingNameUpdatedTimestamp = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetProxySession struct { +} + +func (*awsRestjson1_deserializeOpGetProxySession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetProxySession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetProxySession(response, &metadata) + } + output := &GetProxySessionOutput{} + 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_deserializeOpDocumentGetProxySessionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetProxySession(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetProxySessionOutput(v **GetProxySessionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetProxySessionOutput + if *v == nil { + sv = &GetProxySessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProxySession": + if err := awsRestjson1_deserializeDocumentProxySession(&sv.ProxySession, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSipMediaApplication struct { +} + +func (*awsRestjson1_deserializeOpGetSipMediaApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSipMediaApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetSipMediaApplication(response, &metadata) + } + output := &GetSipMediaApplicationOutput{} + 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_deserializeOpDocumentGetSipMediaApplicationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSipMediaApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSipMediaApplicationOutput(v **GetSipMediaApplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetSipMediaApplicationOutput + if *v == nil { + sv = &GetSipMediaApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplication": + if err := awsRestjson1_deserializeDocumentSipMediaApplication(&sv.SipMediaApplication, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSipMediaApplicationAlexaSkillConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetSipMediaApplicationAlexaSkillConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSipMediaApplicationAlexaSkillConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetSipMediaApplicationAlexaSkillConfiguration(response, &metadata) + } + output := &GetSipMediaApplicationAlexaSkillConfigurationOutput{} + 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_deserializeOpDocumentGetSipMediaApplicationAlexaSkillConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSipMediaApplicationAlexaSkillConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSipMediaApplicationAlexaSkillConfigurationOutput(v **GetSipMediaApplicationAlexaSkillConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetSipMediaApplicationAlexaSkillConfigurationOutput + if *v == nil { + sv = &GetSipMediaApplicationAlexaSkillConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplicationAlexaSkillConfiguration": + if err := awsRestjson1_deserializeDocumentSipMediaApplicationAlexaSkillConfiguration(&sv.SipMediaApplicationAlexaSkillConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSipMediaApplicationLoggingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetSipMediaApplicationLoggingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSipMediaApplicationLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetSipMediaApplicationLoggingConfiguration(response, &metadata) + } + output := &GetSipMediaApplicationLoggingConfigurationOutput{} + 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_deserializeOpDocumentGetSipMediaApplicationLoggingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSipMediaApplicationLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSipMediaApplicationLoggingConfigurationOutput(v **GetSipMediaApplicationLoggingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetSipMediaApplicationLoggingConfigurationOutput + if *v == nil { + sv = &GetSipMediaApplicationLoggingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplicationLoggingConfiguration": + if err := awsRestjson1_deserializeDocumentSipMediaApplicationLoggingConfiguration(&sv.SipMediaApplicationLoggingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSipRule struct { +} + +func (*awsRestjson1_deserializeOpGetSipRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSipRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetSipRule(response, &metadata) + } + output := &GetSipRuleOutput{} + 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_deserializeOpDocumentGetSipRuleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSipRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSipRuleOutput(v **GetSipRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetSipRuleOutput + if *v == nil { + sv = &GetSipRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipRule": + if err := awsRestjson1_deserializeDocumentSipRule(&sv.SipRule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnector struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnector) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnector(response, &metadata) + } + output := &GetVoiceConnectorOutput{} + 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_deserializeOpDocumentGetVoiceConnectorOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorOutput(v **GetVoiceConnectorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorOutput + if *v == nil { + sv = &GetVoiceConnectorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VoiceConnector": + if err := awsRestjson1_deserializeDocumentVoiceConnector(&sv.VoiceConnector, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnectorEmergencyCallingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnectorEmergencyCallingConfiguration(response, &metadata) + } + output := &GetVoiceConnectorEmergencyCallingConfigurationOutput{} + 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_deserializeOpDocumentGetVoiceConnectorEmergencyCallingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnectorEmergencyCallingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorEmergencyCallingConfigurationOutput(v **GetVoiceConnectorEmergencyCallingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorEmergencyCallingConfigurationOutput + if *v == nil { + sv = &GetVoiceConnectorEmergencyCallingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EmergencyCallingConfiguration": + if err := awsRestjson1_deserializeDocumentEmergencyCallingConfiguration(&sv.EmergencyCallingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnectorGroup struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnectorGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnectorGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnectorGroup(response, &metadata) + } + output := &GetVoiceConnectorGroupOutput{} + 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_deserializeOpDocumentGetVoiceConnectorGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnectorGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorGroupOutput(v **GetVoiceConnectorGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorGroupOutput + if *v == nil { + sv = &GetVoiceConnectorGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VoiceConnectorGroup": + if err := awsRestjson1_deserializeDocumentVoiceConnectorGroup(&sv.VoiceConnectorGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnectorLoggingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnectorLoggingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnectorLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnectorLoggingConfiguration(response, &metadata) + } + output := &GetVoiceConnectorLoggingConfigurationOutput{} + 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_deserializeOpDocumentGetVoiceConnectorLoggingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnectorLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorLoggingConfigurationOutput(v **GetVoiceConnectorLoggingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorLoggingConfigurationOutput + if *v == nil { + sv = &GetVoiceConnectorLoggingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LoggingConfiguration": + if err := awsRestjson1_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnectorOrigination struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnectorOrigination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnectorOrigination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnectorOrigination(response, &metadata) + } + output := &GetVoiceConnectorOriginationOutput{} + 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_deserializeOpDocumentGetVoiceConnectorOriginationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnectorOrigination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorOriginationOutput(v **GetVoiceConnectorOriginationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorOriginationOutput + if *v == nil { + sv = &GetVoiceConnectorOriginationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Origination": + if err := awsRestjson1_deserializeDocumentOrigination(&sv.Origination, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnectorProxy struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnectorProxy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnectorProxy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnectorProxy(response, &metadata) + } + output := &GetVoiceConnectorProxyOutput{} + 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_deserializeOpDocumentGetVoiceConnectorProxyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnectorProxy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorProxyOutput(v **GetVoiceConnectorProxyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorProxyOutput + if *v == nil { + sv = &GetVoiceConnectorProxyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Proxy": + if err := awsRestjson1_deserializeDocumentProxy(&sv.Proxy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnectorStreamingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnectorStreamingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnectorStreamingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnectorStreamingConfiguration(response, &metadata) + } + output := &GetVoiceConnectorStreamingConfigurationOutput{} + 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_deserializeOpDocumentGetVoiceConnectorStreamingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnectorStreamingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorStreamingConfigurationOutput(v **GetVoiceConnectorStreamingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorStreamingConfigurationOutput + if *v == nil { + sv = &GetVoiceConnectorStreamingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "StreamingConfiguration": + if err := awsRestjson1_deserializeDocumentStreamingConfiguration(&sv.StreamingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnectorTermination struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnectorTermination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnectorTermination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnectorTermination(response, &metadata) + } + output := &GetVoiceConnectorTerminationOutput{} + 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_deserializeOpDocumentGetVoiceConnectorTerminationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnectorTermination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorTerminationOutput(v **GetVoiceConnectorTerminationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorTerminationOutput + if *v == nil { + sv = &GetVoiceConnectorTerminationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Termination": + if err := awsRestjson1_deserializeDocumentTermination(&sv.Termination, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetVoiceConnectorTerminationHealth struct { +} + +func (*awsRestjson1_deserializeOpGetVoiceConnectorTerminationHealth) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetVoiceConnectorTerminationHealth) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetVoiceConnectorTerminationHealth(response, &metadata) + } + output := &GetVoiceConnectorTerminationHealthOutput{} + 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_deserializeOpDocumentGetVoiceConnectorTerminationHealthOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetVoiceConnectorTerminationHealth(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetVoiceConnectorTerminationHealthOutput(v **GetVoiceConnectorTerminationHealthOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetVoiceConnectorTerminationHealthOutput + if *v == nil { + sv = &GetVoiceConnectorTerminationHealthOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TerminationHealth": + if err := awsRestjson1_deserializeDocumentTerminationHealth(&sv.TerminationHealth, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAvailableVoiceConnectorRegions struct { +} + +func (*awsRestjson1_deserializeOpListAvailableVoiceConnectorRegions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAvailableVoiceConnectorRegions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListAvailableVoiceConnectorRegions(response, &metadata) + } + output := &ListAvailableVoiceConnectorRegionsOutput{} + 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_deserializeOpDocumentListAvailableVoiceConnectorRegionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListAvailableVoiceConnectorRegions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAvailableVoiceConnectorRegionsOutput(v **ListAvailableVoiceConnectorRegionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListAvailableVoiceConnectorRegionsOutput + if *v == nil { + sv = &ListAvailableVoiceConnectorRegionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VoiceConnectorRegions": + if err := awsRestjson1_deserializeDocumentVoiceConnectorAwsRegionList(&sv.VoiceConnectorRegions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListPhoneNumberOrders struct { +} + +func (*awsRestjson1_deserializeOpListPhoneNumberOrders) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPhoneNumberOrders) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListPhoneNumberOrders(response, &metadata) + } + output := &ListPhoneNumberOrdersOutput{} + 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_deserializeOpDocumentListPhoneNumberOrdersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListPhoneNumberOrders(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListPhoneNumberOrdersOutput(v **ListPhoneNumberOrdersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListPhoneNumberOrdersOutput + if *v == nil { + sv = &ListPhoneNumberOrdersOutput{} + } 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 String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "PhoneNumberOrders": + if err := awsRestjson1_deserializeDocumentPhoneNumberOrderList(&sv.PhoneNumberOrders, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListPhoneNumbers struct { +} + +func (*awsRestjson1_deserializeOpListPhoneNumbers) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListPhoneNumbers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListPhoneNumbers(response, &metadata) + } + output := &ListPhoneNumbersOutput{} + 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_deserializeOpDocumentListPhoneNumbersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListPhoneNumbers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListPhoneNumbersOutput(v **ListPhoneNumbersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListPhoneNumbersOutput + if *v == nil { + sv = &ListPhoneNumbersOutput{} + } 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 String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "PhoneNumbers": + if err := awsRestjson1_deserializeDocumentPhoneNumberList(&sv.PhoneNumbers, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListProxySessions struct { +} + +func (*awsRestjson1_deserializeOpListProxySessions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListProxySessions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListProxySessions(response, &metadata) + } + output := &ListProxySessionsOutput{} + 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_deserializeOpDocumentListProxySessionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListProxySessions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListProxySessionsOutput(v **ListProxySessionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListProxySessionsOutput + if *v == nil { + sv = &ListProxySessionsOutput{} + } 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 NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "ProxySessions": + if err := awsRestjson1_deserializeDocumentProxySessions(&sv.ProxySessions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSipMediaApplications struct { +} + +func (*awsRestjson1_deserializeOpListSipMediaApplications) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSipMediaApplications) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListSipMediaApplications(response, &metadata) + } + output := &ListSipMediaApplicationsOutput{} + 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_deserializeOpDocumentListSipMediaApplicationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListSipMediaApplications(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSipMediaApplicationsOutput(v **ListSipMediaApplicationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListSipMediaApplicationsOutput + if *v == nil { + sv = &ListSipMediaApplicationsOutput{} + } 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 NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SipMediaApplications": + if err := awsRestjson1_deserializeDocumentSipMediaApplicationList(&sv.SipMediaApplications, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSipRules struct { +} + +func (*awsRestjson1_deserializeOpListSipRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSipRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListSipRules(response, &metadata) + } + output := &ListSipRulesOutput{} + 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_deserializeOpDocumentListSipRulesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListSipRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSipRulesOutput(v **ListSipRulesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListSipRulesOutput + if *v == nil { + sv = &ListSipRulesOutput{} + } 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 NextTokenString to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "SipRules": + if err := awsRestjson1_deserializeDocumentSipRuleList(&sv.SipRules, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSupportedPhoneNumberCountries struct { +} + +func (*awsRestjson1_deserializeOpListSupportedPhoneNumberCountries) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSupportedPhoneNumberCountries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListSupportedPhoneNumberCountries(response, &metadata) + } + output := &ListSupportedPhoneNumberCountriesOutput{} + 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_deserializeOpDocumentListSupportedPhoneNumberCountriesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListSupportedPhoneNumberCountries(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSupportedPhoneNumberCountriesOutput(v **ListSupportedPhoneNumberCountriesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListSupportedPhoneNumberCountriesOutput + if *v == nil { + sv = &ListSupportedPhoneNumberCountriesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumberCountries": + if err := awsRestjson1_deserializeDocumentPhoneNumberCountriesList(&sv.PhoneNumberCountries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListVoiceConnectorGroups struct { +} + +func (*awsRestjson1_deserializeOpListVoiceConnectorGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListVoiceConnectorGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListVoiceConnectorGroups(response, &metadata) + } + output := &ListVoiceConnectorGroupsOutput{} + 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_deserializeOpDocumentListVoiceConnectorGroupsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListVoiceConnectorGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListVoiceConnectorGroupsOutput(v **ListVoiceConnectorGroupsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListVoiceConnectorGroupsOutput + if *v == nil { + sv = &ListVoiceConnectorGroupsOutput{} + } 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 String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "VoiceConnectorGroups": + if err := awsRestjson1_deserializeDocumentVoiceConnectorGroupList(&sv.VoiceConnectorGroups, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListVoiceConnectors struct { +} + +func (*awsRestjson1_deserializeOpListVoiceConnectors) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListVoiceConnectors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListVoiceConnectors(response, &metadata) + } + output := &ListVoiceConnectorsOutput{} + 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_deserializeOpDocumentListVoiceConnectorsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListVoiceConnectors(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListVoiceConnectorsOutput(v **ListVoiceConnectorsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListVoiceConnectorsOutput + if *v == nil { + sv = &ListVoiceConnectorsOutput{} + } 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 String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "VoiceConnectors": + if err := awsRestjson1_deserializeDocumentVoiceConnectorList(&sv.VoiceConnectors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListVoiceConnectorTerminationCredentials struct { +} + +func (*awsRestjson1_deserializeOpListVoiceConnectorTerminationCredentials) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListVoiceConnectorTerminationCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListVoiceConnectorTerminationCredentials(response, &metadata) + } + output := &ListVoiceConnectorTerminationCredentialsOutput{} + 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_deserializeOpDocumentListVoiceConnectorTerminationCredentialsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListVoiceConnectorTerminationCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListVoiceConnectorTerminationCredentialsOutput(v **ListVoiceConnectorTerminationCredentialsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListVoiceConnectorTerminationCredentialsOutput + if *v == nil { + sv = &ListVoiceConnectorTerminationCredentialsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Usernames": + if err := awsRestjson1_deserializeDocumentSensitiveStringList(&sv.Usernames, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutSipMediaApplicationAlexaSkillConfiguration struct { +} + +func (*awsRestjson1_deserializeOpPutSipMediaApplicationAlexaSkillConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutSipMediaApplicationAlexaSkillConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutSipMediaApplicationAlexaSkillConfiguration(response, &metadata) + } + output := &PutSipMediaApplicationAlexaSkillConfigurationOutput{} + 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_deserializeOpDocumentPutSipMediaApplicationAlexaSkillConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutSipMediaApplicationAlexaSkillConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutSipMediaApplicationAlexaSkillConfigurationOutput(v **PutSipMediaApplicationAlexaSkillConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *PutSipMediaApplicationAlexaSkillConfigurationOutput + if *v == nil { + sv = &PutSipMediaApplicationAlexaSkillConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplicationAlexaSkillConfiguration": + if err := awsRestjson1_deserializeDocumentSipMediaApplicationAlexaSkillConfiguration(&sv.SipMediaApplicationAlexaSkillConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutSipMediaApplicationLoggingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpPutSipMediaApplicationLoggingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutSipMediaApplicationLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutSipMediaApplicationLoggingConfiguration(response, &metadata) + } + output := &PutSipMediaApplicationLoggingConfigurationOutput{} + 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_deserializeOpDocumentPutSipMediaApplicationLoggingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutSipMediaApplicationLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutSipMediaApplicationLoggingConfigurationOutput(v **PutSipMediaApplicationLoggingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *PutSipMediaApplicationLoggingConfigurationOutput + if *v == nil { + sv = &PutSipMediaApplicationLoggingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplicationLoggingConfiguration": + if err := awsRestjson1_deserializeDocumentSipMediaApplicationLoggingConfiguration(&sv.SipMediaApplicationLoggingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpPutVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutVoiceConnectorEmergencyCallingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutVoiceConnectorEmergencyCallingConfiguration(response, &metadata) + } + output := &PutVoiceConnectorEmergencyCallingConfigurationOutput{} + 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_deserializeOpDocumentPutVoiceConnectorEmergencyCallingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutVoiceConnectorEmergencyCallingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutVoiceConnectorEmergencyCallingConfigurationOutput(v **PutVoiceConnectorEmergencyCallingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *PutVoiceConnectorEmergencyCallingConfigurationOutput + if *v == nil { + sv = &PutVoiceConnectorEmergencyCallingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EmergencyCallingConfiguration": + if err := awsRestjson1_deserializeDocumentEmergencyCallingConfiguration(&sv.EmergencyCallingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutVoiceConnectorLoggingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpPutVoiceConnectorLoggingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutVoiceConnectorLoggingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutVoiceConnectorLoggingConfiguration(response, &metadata) + } + output := &PutVoiceConnectorLoggingConfigurationOutput{} + 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_deserializeOpDocumentPutVoiceConnectorLoggingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutVoiceConnectorLoggingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutVoiceConnectorLoggingConfigurationOutput(v **PutVoiceConnectorLoggingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *PutVoiceConnectorLoggingConfigurationOutput + if *v == nil { + sv = &PutVoiceConnectorLoggingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LoggingConfiguration": + if err := awsRestjson1_deserializeDocumentLoggingConfiguration(&sv.LoggingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutVoiceConnectorOrigination struct { +} + +func (*awsRestjson1_deserializeOpPutVoiceConnectorOrigination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutVoiceConnectorOrigination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutVoiceConnectorOrigination(response, &metadata) + } + output := &PutVoiceConnectorOriginationOutput{} + 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_deserializeOpDocumentPutVoiceConnectorOriginationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutVoiceConnectorOrigination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutVoiceConnectorOriginationOutput(v **PutVoiceConnectorOriginationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *PutVoiceConnectorOriginationOutput + if *v == nil { + sv = &PutVoiceConnectorOriginationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Origination": + if err := awsRestjson1_deserializeDocumentOrigination(&sv.Origination, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutVoiceConnectorProxy struct { +} + +func (*awsRestjson1_deserializeOpPutVoiceConnectorProxy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutVoiceConnectorProxy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutVoiceConnectorProxy(response, &metadata) + } + output := &PutVoiceConnectorProxyOutput{} + 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_deserializeOpDocumentPutVoiceConnectorProxyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutVoiceConnectorProxy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutVoiceConnectorProxyOutput(v **PutVoiceConnectorProxyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *PutVoiceConnectorProxyOutput + if *v == nil { + sv = &PutVoiceConnectorProxyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Proxy": + if err := awsRestjson1_deserializeDocumentProxy(&sv.Proxy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutVoiceConnectorStreamingConfiguration struct { +} + +func (*awsRestjson1_deserializeOpPutVoiceConnectorStreamingConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutVoiceConnectorStreamingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutVoiceConnectorStreamingConfiguration(response, &metadata) + } + output := &PutVoiceConnectorStreamingConfigurationOutput{} + 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_deserializeOpDocumentPutVoiceConnectorStreamingConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutVoiceConnectorStreamingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutVoiceConnectorStreamingConfigurationOutput(v **PutVoiceConnectorStreamingConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *PutVoiceConnectorStreamingConfigurationOutput + if *v == nil { + sv = &PutVoiceConnectorStreamingConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "StreamingConfiguration": + if err := awsRestjson1_deserializeDocumentStreamingConfiguration(&sv.StreamingConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutVoiceConnectorTermination struct { +} + +func (*awsRestjson1_deserializeOpPutVoiceConnectorTermination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutVoiceConnectorTermination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutVoiceConnectorTermination(response, &metadata) + } + output := &PutVoiceConnectorTerminationOutput{} + 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_deserializeOpDocumentPutVoiceConnectorTerminationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutVoiceConnectorTermination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutVoiceConnectorTerminationOutput(v **PutVoiceConnectorTerminationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *PutVoiceConnectorTerminationOutput + if *v == nil { + sv = &PutVoiceConnectorTerminationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Termination": + if err := awsRestjson1_deserializeDocumentTermination(&sv.Termination, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpPutVoiceConnectorTerminationCredentials struct { +} + +func (*awsRestjson1_deserializeOpPutVoiceConnectorTerminationCredentials) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutVoiceConnectorTerminationCredentials) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorPutVoiceConnectorTerminationCredentials(response, &metadata) + } + output := &PutVoiceConnectorTerminationCredentialsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutVoiceConnectorTerminationCredentials(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpRestorePhoneNumber struct { +} + +func (*awsRestjson1_deserializeOpRestorePhoneNumber) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRestorePhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorRestorePhoneNumber(response, &metadata) + } + output := &RestorePhoneNumberOutput{} + 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_deserializeOpDocumentRestorePhoneNumberOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRestorePhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentRestorePhoneNumberOutput(v **RestorePhoneNumberOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *RestorePhoneNumberOutput + if *v == nil { + sv = &RestorePhoneNumberOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumber": + if err := awsRestjson1_deserializeDocumentPhoneNumber(&sv.PhoneNumber, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchAvailablePhoneNumbers struct { +} + +func (*awsRestjson1_deserializeOpSearchAvailablePhoneNumbers) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchAvailablePhoneNumbers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchAvailablePhoneNumbers(response, &metadata) + } + output := &SearchAvailablePhoneNumbersOutput{} + 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_deserializeOpDocumentSearchAvailablePhoneNumbersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchAvailablePhoneNumbers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentSearchAvailablePhoneNumbersOutput(v **SearchAvailablePhoneNumbersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *SearchAvailablePhoneNumbersOutput + if *v == nil { + sv = &SearchAvailablePhoneNumbersOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "E164PhoneNumbers": + if err := awsRestjson1_deserializeDocumentE164PhoneNumberList(&sv.E164PhoneNumbers, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateGlobalSettings struct { +} + +func (*awsRestjson1_deserializeOpUpdateGlobalSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateGlobalSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response, &metadata) + } + output := &UpdateGlobalSettingsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateGlobalSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdatePhoneNumber struct { +} + +func (*awsRestjson1_deserializeOpUpdatePhoneNumber) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePhoneNumber) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePhoneNumber(response, &metadata) + } + output := &UpdatePhoneNumberOutput{} + 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_deserializeOpDocumentUpdatePhoneNumberOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdatePhoneNumber(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdatePhoneNumberOutput(v **UpdatePhoneNumberOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdatePhoneNumberOutput + if *v == nil { + sv = &UpdatePhoneNumberOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumber": + if err := awsRestjson1_deserializeDocumentPhoneNumber(&sv.PhoneNumber, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdatePhoneNumberSettings struct { +} + +func (*awsRestjson1_deserializeOpUpdatePhoneNumberSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePhoneNumberSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePhoneNumberSettings(response, &metadata) + } + output := &UpdatePhoneNumberSettingsOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdatePhoneNumberSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateProxySession struct { +} + +func (*awsRestjson1_deserializeOpUpdateProxySession) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateProxySession) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateProxySession(response, &metadata) + } + output := &UpdateProxySessionOutput{} + 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_deserializeOpDocumentUpdateProxySessionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateProxySession(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateProxySessionOutput(v **UpdateProxySessionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateProxySessionOutput + if *v == nil { + sv = &UpdateProxySessionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ProxySession": + if err := awsRestjson1_deserializeDocumentProxySession(&sv.ProxySession, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSipMediaApplication struct { +} + +func (*awsRestjson1_deserializeOpUpdateSipMediaApplication) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSipMediaApplication) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateSipMediaApplication(response, &metadata) + } + output := &UpdateSipMediaApplicationOutput{} + 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_deserializeOpDocumentUpdateSipMediaApplicationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSipMediaApplication(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSipMediaApplicationOutput(v **UpdateSipMediaApplicationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateSipMediaApplicationOutput + if *v == nil { + sv = &UpdateSipMediaApplicationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplication": + if err := awsRestjson1_deserializeDocumentSipMediaApplication(&sv.SipMediaApplication, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSipMediaApplicationCall struct { +} + +func (*awsRestjson1_deserializeOpUpdateSipMediaApplicationCall) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSipMediaApplicationCall) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateSipMediaApplicationCall(response, &metadata) + } + output := &UpdateSipMediaApplicationCallOutput{} + 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_deserializeOpDocumentUpdateSipMediaApplicationCallOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSipMediaApplicationCall(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSipMediaApplicationCallOutput(v **UpdateSipMediaApplicationCallOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateSipMediaApplicationCallOutput + if *v == nil { + sv = &UpdateSipMediaApplicationCallOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipMediaApplicationCall": + if err := awsRestjson1_deserializeDocumentSipMediaApplicationCall(&sv.SipMediaApplicationCall, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSipRule struct { +} + +func (*awsRestjson1_deserializeOpUpdateSipRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSipRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateSipRule(response, &metadata) + } + output := &UpdateSipRuleOutput{} + 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_deserializeOpDocumentUpdateSipRuleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSipRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorResourceLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSipRuleOutput(v **UpdateSipRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateSipRuleOutput + if *v == nil { + sv = &UpdateSipRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SipRule": + if err := awsRestjson1_deserializeDocumentSipRule(&sv.SipRule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateVoiceConnector struct { +} + +func (*awsRestjson1_deserializeOpUpdateVoiceConnector) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateVoiceConnector) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateVoiceConnector(response, &metadata) + } + output := &UpdateVoiceConnectorOutput{} + 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_deserializeOpDocumentUpdateVoiceConnectorOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateVoiceConnector(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateVoiceConnectorOutput(v **UpdateVoiceConnectorOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateVoiceConnectorOutput + if *v == nil { + sv = &UpdateVoiceConnectorOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VoiceConnector": + if err := awsRestjson1_deserializeDocumentVoiceConnector(&sv.VoiceConnector, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateVoiceConnectorGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateVoiceConnectorGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateVoiceConnectorGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateVoiceConnectorGroup(response, &metadata) + } + output := &UpdateVoiceConnectorGroupOutput{} + 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_deserializeOpDocumentUpdateVoiceConnectorGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateVoiceConnectorGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateVoiceConnectorGroupOutput(v **UpdateVoiceConnectorGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateVoiceConnectorGroupOutput + if *v == nil { + sv = &UpdateVoiceConnectorGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "VoiceConnectorGroup": + if err := awsRestjson1_deserializeDocumentVoiceConnectorGroup(&sv.VoiceConnectorGroup, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpValidateE911Address struct { +} + +func (*awsRestjson1_deserializeOpValidateE911Address) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpValidateE911Address) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorValidateE911Address(response, &metadata) + } + output := &ValidateE911AddressOutput{} + 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_deserializeOpDocumentValidateE911AddressOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorValidateE911Address(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ForbiddenException", errorCode): + return awsRestjson1_deserializeErrorForbiddenException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceFailureException", errorCode): + return awsRestjson1_deserializeErrorServiceFailureException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottledClientException", errorCode): + return awsRestjson1_deserializeErrorThrottledClientException(response, errorBody) + + case strings.EqualFold("UnauthorizedClientException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentValidateE911AddressOutput(v **ValidateE911AddressOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ValidateE911AddressOutput + if *v == nil { + sv = &ValidateE911AddressOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Address": + if err := awsRestjson1_deserializeDocumentAddress(&sv.Address, value); err != nil { + return err + } + + case "AddressExternalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AddressExternalId = ptr.String(jtv) + } + + case "CandidateAddressList": + if err := awsRestjson1_deserializeDocumentCandidateAddressList(&sv.CandidateAddressList, value); err != nil { + return err + } + + case "ValidationResult": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ValidationResult to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ValidationResult = int32(i64) + } + + 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_deserializeErrorBadRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.BadRequestException{} + 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_deserializeDocumentBadRequestException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorForbiddenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ForbiddenException{} + 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_deserializeDocumentForbiddenException(&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_deserializeErrorNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.NotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorResourceLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceLimitExceededException{} + 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_deserializeDocumentResourceLimitExceededException(&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_deserializeErrorServiceFailureException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceFailureException{} + 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_deserializeDocumentServiceFailureException(&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_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceUnavailableException{} + 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_deserializeDocumentServiceUnavailableException(&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_deserializeErrorThrottledClientException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottledClientException{} + 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_deserializeDocumentThrottledClientException(&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_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 "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAddress(v **types.Address, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Address + if *v == nil { + sv = &types.Address{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "city": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.City = ptr.String(jtv) + } + + case "country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + case "postalCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.PostalCode = ptr.String(jtv) + } + + case "postalCodePlus4": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.PostalCodePlus4 = ptr.String(jtv) + } + + case "postDirectional": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.PostDirectional = ptr.String(jtv) + } + + case "preDirectional": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.PreDirectional = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + case "streetName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.StreetName = ptr.String(jtv) + } + + case "streetNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.StreetNumber = ptr.String(jtv) + } + + case "streetSuffix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.StreetSuffix = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAlexaSkillIdList(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 AlexaSkillId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentBadRequestException(v **types.BadRequestException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.BadRequestException + if *v == nil { + sv = &types.BadRequestException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCallingRegionList(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 CallingRegion to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCandidateAddress(v **types.CandidateAddress, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.CandidateAddress + if *v == nil { + sv = &types.CandidateAddress{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "city": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.City = ptr.String(jtv) + } + + case "country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + case "postalCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.PostalCode = ptr.String(jtv) + } + + case "postalCodePlus4": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.PostalCodePlus4 = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.State = ptr.String(jtv) + } + + case "streetInfo": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.StreetInfo = ptr.String(jtv) + } + + case "streetNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.StreetNumber = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCandidateAddressList(v *[]types.CandidateAddress, 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.CandidateAddress + if *v == nil { + cv = []types.CandidateAddress{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.CandidateAddress + destAddr := &col + if err := awsRestjson1_deserializeDocumentCandidateAddress(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCapabilityList(v *[]types.Capability, 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.Capability + if *v == nil { + cv = []types.Capability{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Capability + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Capability to be of type string, got %T instead", value) + } + col = types.Capability(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDNISEmergencyCallingConfiguration(v **types.DNISEmergencyCallingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.DNISEmergencyCallingConfiguration + if *v == nil { + sv = &types.DNISEmergencyCallingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CallingCountry": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Alpha2CountryCode to be of type string, got %T instead", value) + } + sv.CallingCountry = ptr.String(jtv) + } + + case "EmergencyPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected E164PhoneNumber to be of type string, got %T instead", value) + } + sv.EmergencyPhoneNumber = ptr.String(jtv) + } + + case "TestPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected E164PhoneNumber to be of type string, got %T instead", value) + } + sv.TestPhoneNumber = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDNISEmergencyCallingConfigurationList(v *[]types.DNISEmergencyCallingConfiguration, 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.DNISEmergencyCallingConfiguration + if *v == nil { + cv = []types.DNISEmergencyCallingConfiguration{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DNISEmergencyCallingConfiguration + destAddr := &col + if err := awsRestjson1_deserializeDocumentDNISEmergencyCallingConfiguration(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentE164PhoneNumberList(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 E164PhoneNumber to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEmergencyCallingConfiguration(v **types.EmergencyCallingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.EmergencyCallingConfiguration + if *v == nil { + sv = &types.EmergencyCallingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DNIS": + if err := awsRestjson1_deserializeDocumentDNISEmergencyCallingConfigurationList(&sv.DNIS, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentForbiddenException(v **types.ForbiddenException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ForbiddenException + if *v == nil { + sv = &types.ForbiddenException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentGeoMatchParams(v **types.GeoMatchParams, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.GeoMatchParams + if *v == nil { + sv = &types.GeoMatchParams{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AreaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AreaCode to be of type string, got %T instead", value) + } + sv.AreaCode = ptr.String(jtv) + } + + case "Country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Country to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentLoggingConfiguration(v **types.LoggingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.LoggingConfiguration + if *v == nil { + sv = &types.LoggingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnableSIPLogs": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableSIPLogs = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotFoundException(v **types.NotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.NotFoundException + if *v == nil { + sv = &types.NotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOrderedPhoneNumber(v **types.OrderedPhoneNumber, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.OrderedPhoneNumber + if *v == nil { + sv = &types.OrderedPhoneNumber{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "E164PhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected E164PhoneNumber to be of type string, got %T instead", value) + } + sv.E164PhoneNumber = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OrderedPhoneNumberStatus to be of type string, got %T instead", value) + } + sv.Status = types.OrderedPhoneNumberStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOrderedPhoneNumberList(v *[]types.OrderedPhoneNumber, 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.OrderedPhoneNumber + if *v == nil { + cv = []types.OrderedPhoneNumber{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OrderedPhoneNumber + destAddr := &col + if err := awsRestjson1_deserializeDocumentOrderedPhoneNumber(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentOrigination(v **types.Origination, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Origination + if *v == nil { + sv = &types.Origination{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Disabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Disabled = ptr.Bool(jtv) + } + + case "Routes": + if err := awsRestjson1_deserializeDocumentOriginationRouteList(&sv.Routes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOriginationRoute(v **types.OriginationRoute, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.OriginationRoute + if *v == nil { + sv = &types.OriginationRoute{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Host": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Host = ptr.String(jtv) + } + + case "Port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = ptr.Int32(int32(i64)) + } + + case "Priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected OriginationRoutePriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = ptr.Int32(int32(i64)) + } + + case "Protocol": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OriginationRouteProtocol to be of type string, got %T instead", value) + } + sv.Protocol = types.OriginationRouteProtocol(jtv) + } + + case "Weight": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected OriginationRouteWeight to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Weight = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOriginationRouteList(v *[]types.OriginationRoute, 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.OriginationRoute + if *v == nil { + cv = []types.OriginationRoute{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.OriginationRoute + destAddr := &col + if err := awsRestjson1_deserializeDocumentOriginationRoute(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentParticipant(v **types.Participant, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Participant + if *v == nil { + sv = &types.Participant{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected E164PhoneNumber to be of type string, got %T instead", value) + } + sv.PhoneNumber = ptr.String(jtv) + } + + case "ProxyPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected E164PhoneNumber to be of type string, got %T instead", value) + } + sv.ProxyPhoneNumber = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentParticipants(v *[]types.Participant, 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.Participant + if *v == nil { + cv = []types.Participant{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Participant + destAddr := &col + if err := awsRestjson1_deserializeDocumentParticipant(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumber(v **types.PhoneNumber, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.PhoneNumber + if *v == nil { + sv = &types.PhoneNumber{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Associations": + if err := awsRestjson1_deserializeDocumentPhoneNumberAssociationList(&sv.Associations, value); err != nil { + return err + } + + case "CallingName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CallingName to be of type string, got %T instead", value) + } + sv.CallingName = ptr.String(jtv) + } + + case "CallingNameStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CallingNameStatus to be of type string, got %T instead", value) + } + sv.CallingNameStatus = types.CallingNameStatus(jtv) + } + + case "Capabilities": + if err := awsRestjson1_deserializeDocumentPhoneNumberCapabilities(&sv.Capabilities, value); err != nil { + return err + } + + case "Country": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Alpha2CountryCode to be of type string, got %T instead", value) + } + sv.Country = ptr.String(jtv) + } + + case "CreatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case "DeletionTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.DeletionTimestamp = ptr.Time(t) + } + + case "E164PhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected E164PhoneNumber to be of type string, got %T instead", value) + } + sv.E164PhoneNumber = ptr.String(jtv) + } + + case "OrderId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) + } + sv.OrderId = ptr.String(jtv) + } + + case "PhoneNumberId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.PhoneNumberId = ptr.String(jtv) + } + + case "ProductType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberProductType to be of type string, got %T instead", value) + } + sv.ProductType = types.PhoneNumberProductType(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberStatus to be of type string, got %T instead", value) + } + sv.Status = types.PhoneNumberStatus(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberType to be of type string, got %T instead", value) + } + sv.Type = types.PhoneNumberType(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberAssociation(v **types.PhoneNumberAssociation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.PhoneNumberAssociation + if *v == nil { + sv = &types.PhoneNumberAssociation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AssociatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.AssociatedTimestamp = ptr.Time(t) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberAssociationName to be of type string, got %T instead", value) + } + sv.Name = types.PhoneNumberAssociationName(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberAssociationList(v *[]types.PhoneNumberAssociation, 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.PhoneNumberAssociation + if *v == nil { + cv = []types.PhoneNumberAssociation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhoneNumberAssociation + destAddr := &col + if err := awsRestjson1_deserializeDocumentPhoneNumberAssociation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberCapabilities(v **types.PhoneNumberCapabilities, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.PhoneNumberCapabilities + if *v == nil { + sv = &types.PhoneNumberCapabilities{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "InboundCall": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.InboundCall = ptr.Bool(jtv) + } + + case "InboundMMS": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.InboundMMS = ptr.Bool(jtv) + } + + case "InboundSMS": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.InboundSMS = ptr.Bool(jtv) + } + + case "OutboundCall": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.OutboundCall = ptr.Bool(jtv) + } + + case "OutboundMMS": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.OutboundMMS = ptr.Bool(jtv) + } + + case "OutboundSMS": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.OutboundSMS = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberCountriesList(v *[]types.PhoneNumberCountry, 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.PhoneNumberCountry + if *v == nil { + cv = []types.PhoneNumberCountry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhoneNumberCountry + destAddr := &col + if err := awsRestjson1_deserializeDocumentPhoneNumberCountry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberCountry(v **types.PhoneNumberCountry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.PhoneNumberCountry + if *v == nil { + sv = &types.PhoneNumberCountry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CountryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Alpha2CountryCode to be of type string, got %T instead", value) + } + sv.CountryCode = ptr.String(jtv) + } + + case "SupportedPhoneNumberTypes": + if err := awsRestjson1_deserializeDocumentPhoneNumberTypeList(&sv.SupportedPhoneNumberTypes, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberError(v **types.PhoneNumberError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.PhoneNumberError + if *v == nil { + sv = &types.PhoneNumberError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ErrorCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.ErrorCode = types.ErrorCode(jtv) + } + + case "ErrorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "PhoneNumberId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveNonEmptyString to be of type string, got %T instead", value) + } + sv.PhoneNumberId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberErrorList(v *[]types.PhoneNumberError, 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.PhoneNumberError + if *v == nil { + cv = []types.PhoneNumberError{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhoneNumberError + destAddr := &col + if err := awsRestjson1_deserializeDocumentPhoneNumberError(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberList(v *[]types.PhoneNumber, 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.PhoneNumber + if *v == nil { + cv = []types.PhoneNumber{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhoneNumber + destAddr := &col + if err := awsRestjson1_deserializeDocumentPhoneNumber(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberOrder(v **types.PhoneNumberOrder, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.PhoneNumberOrder + if *v == nil { + sv = &types.PhoneNumberOrder{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case "OrderedPhoneNumbers": + if err := awsRestjson1_deserializeDocumentOrderedPhoneNumberList(&sv.OrderedPhoneNumbers, value); err != nil { + return err + } + + case "OrderType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberOrderType to be of type string, got %T instead", value) + } + sv.OrderType = types.PhoneNumberOrderType(jtv) + } + + case "PhoneNumberOrderId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) + } + sv.PhoneNumberOrderId = ptr.String(jtv) + } + + case "ProductType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberProductType to be of type string, got %T instead", value) + } + sv.ProductType = types.PhoneNumberProductType(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberOrderStatus to be of type string, got %T instead", value) + } + sv.Status = types.PhoneNumberOrderStatus(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberOrderList(v *[]types.PhoneNumberOrder, 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.PhoneNumberOrder + if *v == nil { + cv = []types.PhoneNumberOrder{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhoneNumberOrder + destAddr := &col + if err := awsRestjson1_deserializeDocumentPhoneNumberOrder(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentPhoneNumberTypeList(v *[]types.PhoneNumberType, 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.PhoneNumberType + if *v == nil { + cv = []types.PhoneNumberType{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PhoneNumberType + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PhoneNumberType to be of type string, got %T instead", value) + } + col = types.PhoneNumberType(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentProxy(v **types.Proxy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Proxy + if *v == nil { + sv = &types.Proxy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DefaultSessionExpiryMinutes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DefaultSessionExpiryMinutes = ptr.Int32(int32(i64)) + } + + case "Disabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Disabled = ptr.Bool(jtv) + } + + case "FallBackPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected E164PhoneNumber to be of type string, got %T instead", value) + } + sv.FallBackPhoneNumber = ptr.String(jtv) + } + + case "PhoneNumberCountries": + if err := awsRestjson1_deserializeDocumentStringList(&sv.PhoneNumberCountries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentProxySession(v **types.ProxySession, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ProxySession + if *v == nil { + sv = &types.ProxySession{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Capabilities": + if err := awsRestjson1_deserializeDocumentCapabilityList(&sv.Capabilities, value); err != nil { + return err + } + + case "CreatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case "EndedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndedTimestamp = ptr.Time(t) + } + + case "ExpiryMinutes": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected PositiveInteger to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiryMinutes = ptr.Int32(int32(i64)) + } + + case "GeoMatchLevel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GeoMatchLevel to be of type string, got %T instead", value) + } + sv.GeoMatchLevel = types.GeoMatchLevel(jtv) + } + + case "GeoMatchParams": + if err := awsRestjson1_deserializeDocumentGeoMatchParams(&sv.GeoMatchParams, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String128 to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "NumberSelectionBehavior": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NumberSelectionBehavior to be of type string, got %T instead", value) + } + sv.NumberSelectionBehavior = types.NumberSelectionBehavior(jtv) + } + + case "Participants": + if err := awsRestjson1_deserializeDocumentParticipants(&sv.Participants, value); err != nil { + return err + } + + case "ProxySessionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString128 to be of type string, got %T instead", value) + } + sv.ProxySessionId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ProxySessionStatus to be of type string, got %T instead", value) + } + sv.Status = types.ProxySessionStatus(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) + } + + case "VoiceConnectorId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString128 to be of type string, got %T instead", value) + } + sv.VoiceConnectorId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentProxySessions(v *[]types.ProxySession, 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.ProxySession + if *v == nil { + cv = []types.ProxySession{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ProxySession + destAddr := &col + if err := awsRestjson1_deserializeDocumentProxySession(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentResourceLimitExceededException(v **types.ResourceLimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ResourceLimitExceededException + if *v == nil { + sv = &types.ResourceLimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSensitiveStringList(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 SensitiveString to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentServiceFailureException(v **types.ServiceFailureException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ServiceFailureException + if *v == nil { + sv = &types.ServiceFailureException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ServiceUnavailableException + if *v == nil { + sv = &types.ServiceUnavailableException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSipMediaApplication(v **types.SipMediaApplication, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SipMediaApplication + if *v == nil { + sv = &types.SipMediaApplication{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AwsRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AwsRegion = ptr.String(jtv) + } + + case "CreatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case "Endpoints": + if err := awsRestjson1_deserializeDocumentSipMediaApplicationEndpointList(&sv.Endpoints, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SipMediaApplicationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "SipMediaApplicationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SipMediaApplicationId = ptr.String(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSipMediaApplicationAlexaSkillConfiguration(v **types.SipMediaApplicationAlexaSkillConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SipMediaApplicationAlexaSkillConfiguration + if *v == nil { + sv = &types.SipMediaApplicationAlexaSkillConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AlexaSkillIds": + if err := awsRestjson1_deserializeDocumentAlexaSkillIdList(&sv.AlexaSkillIds, value); err != nil { + return err + } + + case "AlexaSkillStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AlexaSkillStatus to be of type string, got %T instead", value) + } + sv.AlexaSkillStatus = types.AlexaSkillStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSipMediaApplicationCall(v **types.SipMediaApplicationCall, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SipMediaApplicationCall + if *v == nil { + sv = &types.SipMediaApplicationCall{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "TransactionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GuidString to be of type string, got %T instead", value) + } + sv.TransactionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSipMediaApplicationEndpoint(v **types.SipMediaApplicationEndpoint, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SipMediaApplicationEndpoint + if *v == nil { + sv = &types.SipMediaApplicationEndpoint{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LambdaArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FunctionArn to be of type string, got %T instead", value) + } + sv.LambdaArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSipMediaApplicationEndpointList(v *[]types.SipMediaApplicationEndpoint, 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.SipMediaApplicationEndpoint + if *v == nil { + cv = []types.SipMediaApplicationEndpoint{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SipMediaApplicationEndpoint + destAddr := &col + if err := awsRestjson1_deserializeDocumentSipMediaApplicationEndpoint(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSipMediaApplicationList(v *[]types.SipMediaApplication, 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.SipMediaApplication + if *v == nil { + cv = []types.SipMediaApplication{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SipMediaApplication + destAddr := &col + if err := awsRestjson1_deserializeDocumentSipMediaApplication(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSipMediaApplicationLoggingConfiguration(v **types.SipMediaApplicationLoggingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SipMediaApplicationLoggingConfiguration + if *v == nil { + sv = &types.SipMediaApplicationLoggingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EnableSipMediaApplicationMessageLogs": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableSipMediaApplicationMessageLogs = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSipRule(v **types.SipRule, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SipRule + if *v == nil { + sv = &types.SipRule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case "Disabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Disabled = ptr.Bool(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SipRuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "SipRuleId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SipRuleId = ptr.String(jtv) + } + + case "TargetApplications": + if err := awsRestjson1_deserializeDocumentSipRuleTargetApplicationList(&sv.TargetApplications, value); err != nil { + return err + } + + case "TriggerType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SipRuleTriggerType to be of type string, got %T instead", value) + } + sv.TriggerType = types.SipRuleTriggerType(jtv) + } + + case "TriggerValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.TriggerValue = ptr.String(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSipRuleList(v *[]types.SipRule, 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.SipRule + if *v == nil { + cv = []types.SipRule{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SipRule + destAddr := &col + if err := awsRestjson1_deserializeDocumentSipRule(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentSipRuleTargetApplication(v **types.SipRuleTargetApplication, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SipRuleTargetApplication + if *v == nil { + sv = &types.SipRuleTargetApplication{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AwsRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AwsRegion = ptr.String(jtv) + } + + case "Priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected SipApplicationPriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = ptr.Int32(int32(i64)) + } + + case "SipMediaApplicationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.SipMediaApplicationId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSipRuleTargetApplicationList(v *[]types.SipRuleTargetApplication, 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.SipRuleTargetApplication + if *v == nil { + cv = []types.SipRuleTargetApplication{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SipRuleTargetApplication + destAddr := &col + if err := awsRestjson1_deserializeDocumentSipRuleTargetApplication(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentStreamingConfiguration(v **types.StreamingConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.StreamingConfiguration + if *v == nil { + sv = &types.StreamingConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DataRetentionInHours": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DataRetentionInHours to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DataRetentionInHours = ptr.Int32(int32(i64)) + } + + case "Disabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Disabled = ptr.Bool(jtv) + } + + case "StreamingNotificationTargets": + if err := awsRestjson1_deserializeDocumentStreamingNotificationTargetList(&sv.StreamingNotificationTargets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStreamingNotificationTarget(v **types.StreamingNotificationTarget, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.StreamingNotificationTarget + if *v == nil { + sv = &types.StreamingNotificationTarget{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "NotificationTarget": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationTarget to be of type string, got %T instead", value) + } + sv.NotificationTarget = types.NotificationTarget(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStreamingNotificationTargetList(v *[]types.StreamingNotificationTarget, 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.StreamingNotificationTarget + if *v == nil { + cv = []types.StreamingNotificationTarget{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.StreamingNotificationTarget + destAddr := &col + if err := awsRestjson1_deserializeDocumentStreamingNotificationTarget(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentStringList(v *[]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []string + if *v == nil { + cv = []string{} + } else { + cv = *v + } + + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentTermination(v **types.Termination, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Termination + if *v == nil { + sv = &types.Termination{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CallingRegions": + if err := awsRestjson1_deserializeDocumentCallingRegionList(&sv.CallingRegions, value); err != nil { + return err + } + + case "CidrAllowedList": + if err := awsRestjson1_deserializeDocumentStringList(&sv.CidrAllowedList, value); err != nil { + return err + } + + case "CpsLimit": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CpsLimit to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CpsLimit = ptr.Int32(int32(i64)) + } + + case "DefaultPhoneNumber": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected E164PhoneNumber to be of type string, got %T instead", value) + } + sv.DefaultPhoneNumber = ptr.String(jtv) + } + + case "Disabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Disabled = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTerminationHealth(v **types.TerminationHealth, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.TerminationHealth + if *v == nil { + sv = &types.TerminationHealth{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "Timestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.Timestamp = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentThrottledClientException(v **types.ThrottledClientException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ThrottledClientException + if *v == nil { + sv = &types.ThrottledClientException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_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 "Code": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorCode to be of type string, got %T instead", value) + } + sv.Code = types.ErrorCode(jtv) + } + + case "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVoiceConnector(v **types.VoiceConnector, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.VoiceConnector + if *v == nil { + sv = &types.VoiceConnector{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AwsRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VoiceConnectorAwsRegion to be of type string, got %T instead", value) + } + sv.AwsRegion = types.VoiceConnectorAwsRegion(jtv) + } + + case "CreatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VoiceConnectorName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "OutboundHostName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.OutboundHostName = ptr.String(jtv) + } + + case "RequireEncryption": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.RequireEncryption = ptr.Bool(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) + } + + case "VoiceConnectorArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VoiceConnectorArn = ptr.String(jtv) + } + + case "VoiceConnectorId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VoiceConnectorId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVoiceConnectorAwsRegionList(v *[]types.VoiceConnectorAwsRegion, 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.VoiceConnectorAwsRegion + if *v == nil { + cv = []types.VoiceConnectorAwsRegion{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VoiceConnectorAwsRegion + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VoiceConnectorAwsRegion to be of type string, got %T instead", value) + } + col = types.VoiceConnectorAwsRegion(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVoiceConnectorGroup(v **types.VoiceConnectorGroup, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.VoiceConnectorGroup + if *v == nil { + sv = &types.VoiceConnectorGroup{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(t) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VoiceConnectorGroupName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Iso8601Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(t) + } + + case "VoiceConnectorGroupArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VoiceConnectorGroupArn = ptr.String(jtv) + } + + case "VoiceConnectorGroupId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VoiceConnectorGroupId = ptr.String(jtv) + } + + case "VoiceConnectorItems": + if err := awsRestjson1_deserializeDocumentVoiceConnectorItemList(&sv.VoiceConnectorItems, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVoiceConnectorGroupList(v *[]types.VoiceConnectorGroup, 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.VoiceConnectorGroup + if *v == nil { + cv = []types.VoiceConnectorGroup{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VoiceConnectorGroup + destAddr := &col + if err := awsRestjson1_deserializeDocumentVoiceConnectorGroup(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVoiceConnectorItem(v **types.VoiceConnectorItem, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.VoiceConnectorItem + if *v == nil { + sv = &types.VoiceConnectorItem{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Priority": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected VoiceConnectorItemPriority to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Priority = ptr.Int32(int32(i64)) + } + + case "VoiceConnectorId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonEmptyString to be of type string, got %T instead", value) + } + sv.VoiceConnectorId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVoiceConnectorItemList(v *[]types.VoiceConnectorItem, 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.VoiceConnectorItem + if *v == nil { + cv = []types.VoiceConnectorItem{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VoiceConnectorItem + destAddr := &col + if err := awsRestjson1_deserializeDocumentVoiceConnectorItem(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVoiceConnectorList(v *[]types.VoiceConnector, 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.VoiceConnector + if *v == nil { + cv = []types.VoiceConnector{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.VoiceConnector + destAddr := &col + if err := awsRestjson1_deserializeDocumentVoiceConnector(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentVoiceConnectorSettings(v **types.VoiceConnectorSettings, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.VoiceConnectorSettings + if *v == nil { + sv = &types.VoiceConnectorSettings{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CdrBucket": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.CdrBucket = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/chimesdkvoice/doc.go b/service/chimesdkvoice/doc.go new file mode 100644 index 00000000000..42cf4aa4e96 --- /dev/null +++ b/service/chimesdkvoice/doc.go @@ -0,0 +1,5 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package chimesdkvoice provides the API client, operations, and parameter types +// for Amazon Chime SDK Voice. +package chimesdkvoice diff --git a/service/chimesdkvoice/endpoints.go b/service/chimesdkvoice/endpoints.go new file mode 100644 index 00000000000..59f14868899 --- /dev/null +++ b/service/chimesdkvoice/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "chime" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} diff --git a/service/chimesdkvoice/generated.json b/service/chimesdkvoice/generated.json new file mode 100644 index 00000000000..be8303f66dd --- /dev/null +++ b/service/chimesdkvoice/generated.json @@ -0,0 +1,101 @@ +{ + "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_AssociatePhoneNumbersWithVoiceConnector.go", + "api_op_AssociatePhoneNumbersWithVoiceConnectorGroup.go", + "api_op_BatchDeletePhoneNumber.go", + "api_op_BatchUpdatePhoneNumber.go", + "api_op_CreatePhoneNumberOrder.go", + "api_op_CreateProxySession.go", + "api_op_CreateSipMediaApplication.go", + "api_op_CreateSipMediaApplicationCall.go", + "api_op_CreateSipRule.go", + "api_op_CreateVoiceConnector.go", + "api_op_CreateVoiceConnectorGroup.go", + "api_op_DeletePhoneNumber.go", + "api_op_DeleteProxySession.go", + "api_op_DeleteSipMediaApplication.go", + "api_op_DeleteSipRule.go", + "api_op_DeleteVoiceConnector.go", + "api_op_DeleteVoiceConnectorEmergencyCallingConfiguration.go", + "api_op_DeleteVoiceConnectorGroup.go", + "api_op_DeleteVoiceConnectorOrigination.go", + "api_op_DeleteVoiceConnectorProxy.go", + "api_op_DeleteVoiceConnectorStreamingConfiguration.go", + "api_op_DeleteVoiceConnectorTermination.go", + "api_op_DeleteVoiceConnectorTerminationCredentials.go", + "api_op_DisassociatePhoneNumbersFromVoiceConnector.go", + "api_op_DisassociatePhoneNumbersFromVoiceConnectorGroup.go", + "api_op_GetGlobalSettings.go", + "api_op_GetPhoneNumber.go", + "api_op_GetPhoneNumberOrder.go", + "api_op_GetPhoneNumberSettings.go", + "api_op_GetProxySession.go", + "api_op_GetSipMediaApplication.go", + "api_op_GetSipMediaApplicationAlexaSkillConfiguration.go", + "api_op_GetSipMediaApplicationLoggingConfiguration.go", + "api_op_GetSipRule.go", + "api_op_GetVoiceConnector.go", + "api_op_GetVoiceConnectorEmergencyCallingConfiguration.go", + "api_op_GetVoiceConnectorGroup.go", + "api_op_GetVoiceConnectorLoggingConfiguration.go", + "api_op_GetVoiceConnectorOrigination.go", + "api_op_GetVoiceConnectorProxy.go", + "api_op_GetVoiceConnectorStreamingConfiguration.go", + "api_op_GetVoiceConnectorTermination.go", + "api_op_GetVoiceConnectorTerminationHealth.go", + "api_op_ListAvailableVoiceConnectorRegions.go", + "api_op_ListPhoneNumberOrders.go", + "api_op_ListPhoneNumbers.go", + "api_op_ListProxySessions.go", + "api_op_ListSipMediaApplications.go", + "api_op_ListSipRules.go", + "api_op_ListSupportedPhoneNumberCountries.go", + "api_op_ListVoiceConnectorGroups.go", + "api_op_ListVoiceConnectorTerminationCredentials.go", + "api_op_ListVoiceConnectors.go", + "api_op_PutSipMediaApplicationAlexaSkillConfiguration.go", + "api_op_PutSipMediaApplicationLoggingConfiguration.go", + "api_op_PutVoiceConnectorEmergencyCallingConfiguration.go", + "api_op_PutVoiceConnectorLoggingConfiguration.go", + "api_op_PutVoiceConnectorOrigination.go", + "api_op_PutVoiceConnectorProxy.go", + "api_op_PutVoiceConnectorStreamingConfiguration.go", + "api_op_PutVoiceConnectorTermination.go", + "api_op_PutVoiceConnectorTerminationCredentials.go", + "api_op_RestorePhoneNumber.go", + "api_op_SearchAvailablePhoneNumbers.go", + "api_op_UpdateGlobalSettings.go", + "api_op_UpdatePhoneNumber.go", + "api_op_UpdatePhoneNumberSettings.go", + "api_op_UpdateProxySession.go", + "api_op_UpdateSipMediaApplication.go", + "api_op_UpdateSipMediaApplicationCall.go", + "api_op_UpdateSipRule.go", + "api_op_UpdateVoiceConnector.go", + "api_op_UpdateVoiceConnectorGroup.go", + "api_op_ValidateE911Address.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice", + "unstable": false +} diff --git a/service/chimesdkvoice/go.mod b/service/chimesdkvoice/go.mod new file mode 100644 index 00000000000..b2008bf027c --- /dev/null +++ b/service/chimesdkvoice/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/chimesdkvoice + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.17.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 + github.com/aws/smithy-go v1.13.4 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/chimesdkvoice/go.sum b/service/chimesdkvoice/go.sum new file mode 100644 index 00000000000..b5b882cefe7 --- /dev/null +++ b/service/chimesdkvoice/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk= +github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/chimesdkvoice/go_module_metadata.go b/service/chimesdkvoice/go_module_metadata.go new file mode 100644 index 00000000000..7594189c35b --- /dev/null +++ b/service/chimesdkvoice/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package chimesdkvoice + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/chimesdkvoice/internal/endpoints/endpoints.go b/service/chimesdkvoice/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..c31820c53f0 --- /dev/null +++ b/service/chimesdkvoice/internal/endpoints/endpoints.go @@ -0,0 +1,309 @@ +// 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 Chime SDK Voice endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "voice-chime.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "voice-chime-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "voice-chime-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "voice-chime.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "fips.voice-chime.us-east-1.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-east-1-fips", + }: endpoints.Endpoint{ + Hostname: "fips.voice-chime.us-east-1.amazonaws.com", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + Deprecated: aws.TrueTernary, + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant, + }: { + Hostname: "fips.voice-chime.us-west-2.amazonaws.com", + }, + endpoints.EndpointKey{ + Region: "us-west-2-fips", + }: endpoints.Endpoint{ + Hostname: "fips.voice-chime.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: "voice-chime.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "voice-chime-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "voice-chime-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "voice-chime.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "voice-chime-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "voice-chime.{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: "voice-chime-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "voice-chime.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "voice-chime.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "voice-chime-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "voice-chime-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "voice-chime.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/chimesdkvoice/internal/endpoints/endpoints_test.go b/service/chimesdkvoice/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/chimesdkvoice/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/chimesdkvoice/protocol_test.go b/service/chimesdkvoice/protocol_test.go new file mode 100644 index 00000000000..40a915b00ad --- /dev/null +++ b/service/chimesdkvoice/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice diff --git a/service/chimesdkvoice/serializers.go b/service/chimesdkvoice/serializers.go new file mode 100644 index 00000000000..2ccb77ba77e --- /dev/null +++ b/service/chimesdkvoice/serializers.go @@ -0,0 +1,5781 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpAssociatePhoneNumbersWithVoiceConnector struct { +} + +func (*awsRestjson1_serializeOpAssociatePhoneNumbersWithVoiceConnector) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociatePhoneNumbersWithVoiceConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociatePhoneNumbersWithVoiceConnectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}?operation=associate-phone-numbers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAssociatePhoneNumbersWithVoiceConnectorInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociatePhoneNumbersWithVoiceConnectorInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsAssociatePhoneNumbersWithVoiceConnectorInput(v *AssociatePhoneNumbersWithVoiceConnectorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociatePhoneNumbersWithVoiceConnectorInput(v *AssociatePhoneNumbersWithVoiceConnectorInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.E164PhoneNumbers != nil { + ok := object.Key("E164PhoneNumbers") + if err := awsRestjson1_serializeDocumentE164PhoneNumberList(v.E164PhoneNumbers, ok); err != nil { + return err + } + } + + if v.ForceAssociate != nil { + ok := object.Key("ForceAssociate") + ok.Boolean(*v.ForceAssociate) + } + + return nil +} + +type awsRestjson1_serializeOpAssociatePhoneNumbersWithVoiceConnectorGroup struct { +} + +func (*awsRestjson1_serializeOpAssociatePhoneNumbersWithVoiceConnectorGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociatePhoneNumbersWithVoiceConnectorGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociatePhoneNumbersWithVoiceConnectorGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connector-groups/{VoiceConnectorGroupId}?operation=associate-phone-numbers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAssociatePhoneNumbersWithVoiceConnectorGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociatePhoneNumbersWithVoiceConnectorGroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsAssociatePhoneNumbersWithVoiceConnectorGroupInput(v *AssociatePhoneNumbersWithVoiceConnectorGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorGroupId == nil || len(*v.VoiceConnectorGroupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorGroupId must not be empty")} + } + if v.VoiceConnectorGroupId != nil { + if err := encoder.SetURI("VoiceConnectorGroupId").String(*v.VoiceConnectorGroupId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociatePhoneNumbersWithVoiceConnectorGroupInput(v *AssociatePhoneNumbersWithVoiceConnectorGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.E164PhoneNumbers != nil { + ok := object.Key("E164PhoneNumbers") + if err := awsRestjson1_serializeDocumentE164PhoneNumberList(v.E164PhoneNumbers, ok); err != nil { + return err + } + } + + if v.ForceAssociate != nil { + ok := object.Key("ForceAssociate") + ok.Boolean(*v.ForceAssociate) + } + + return nil +} + +type awsRestjson1_serializeOpBatchDeletePhoneNumber struct { +} + +func (*awsRestjson1_serializeOpBatchDeletePhoneNumber) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchDeletePhoneNumber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchDeletePhoneNumberInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-numbers?operation=batch-delete") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchDeletePhoneNumberInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchDeletePhoneNumberInput(v *BatchDeletePhoneNumberInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchDeletePhoneNumberInput(v *BatchDeletePhoneNumberInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PhoneNumberIds != nil { + ok := object.Key("PhoneNumberIds") + if err := awsRestjson1_serializeDocumentNonEmptyStringList(v.PhoneNumberIds, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpBatchUpdatePhoneNumber struct { +} + +func (*awsRestjson1_serializeOpBatchUpdatePhoneNumber) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpBatchUpdatePhoneNumber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*BatchUpdatePhoneNumberInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-numbers?operation=batch-update") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentBatchUpdatePhoneNumberInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsBatchUpdatePhoneNumberInput(v *BatchUpdatePhoneNumberInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentBatchUpdatePhoneNumberInput(v *BatchUpdatePhoneNumberInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.UpdatePhoneNumberRequestItems != nil { + ok := object.Key("UpdatePhoneNumberRequestItems") + if err := awsRestjson1_serializeDocumentUpdatePhoneNumberRequestItemList(v.UpdatePhoneNumberRequestItems, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreatePhoneNumberOrder struct { +} + +func (*awsRestjson1_serializeOpCreatePhoneNumberOrder) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreatePhoneNumberOrder) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreatePhoneNumberOrderInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-number-orders") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreatePhoneNumberOrderInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreatePhoneNumberOrderInput(v *CreatePhoneNumberOrderInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreatePhoneNumberOrderInput(v *CreatePhoneNumberOrderInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.E164PhoneNumbers != nil { + ok := object.Key("E164PhoneNumbers") + if err := awsRestjson1_serializeDocumentE164PhoneNumberList(v.E164PhoneNumbers, ok); err != nil { + return err + } + } + + if len(v.ProductType) > 0 { + ok := object.Key("ProductType") + ok.String(string(v.ProductType)) + } + + return nil +} + +type awsRestjson1_serializeOpCreateProxySession struct { +} + +func (*awsRestjson1_serializeOpCreateProxySession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateProxySession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateProxySessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/proxy-sessions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateProxySessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateProxySessionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateProxySessionInput(v *CreateProxySessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateProxySessionInput(v *CreateProxySessionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Capabilities != nil { + ok := object.Key("Capabilities") + if err := awsRestjson1_serializeDocumentCapabilityList(v.Capabilities, ok); err != nil { + return err + } + } + + if v.ExpiryMinutes != nil { + ok := object.Key("ExpiryMinutes") + ok.Integer(*v.ExpiryMinutes) + } + + if len(v.GeoMatchLevel) > 0 { + ok := object.Key("GeoMatchLevel") + ok.String(string(v.GeoMatchLevel)) + } + + if v.GeoMatchParams != nil { + ok := object.Key("GeoMatchParams") + if err := awsRestjson1_serializeDocumentGeoMatchParams(v.GeoMatchParams, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if len(v.NumberSelectionBehavior) > 0 { + ok := object.Key("NumberSelectionBehavior") + ok.String(string(v.NumberSelectionBehavior)) + } + + if v.ParticipantPhoneNumbers != nil { + ok := object.Key("ParticipantPhoneNumbers") + if err := awsRestjson1_serializeDocumentParticipantPhoneNumberList(v.ParticipantPhoneNumbers, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateSipMediaApplication struct { +} + +func (*awsRestjson1_serializeOpCreateSipMediaApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSipMediaApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSipMediaApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSipMediaApplicationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateSipMediaApplicationInput(v *CreateSipMediaApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSipMediaApplicationInput(v *CreateSipMediaApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwsRegion != nil { + ok := object.Key("AwsRegion") + ok.String(*v.AwsRegion) + } + + if v.Endpoints != nil { + ok := object.Key("Endpoints") + if err := awsRestjson1_serializeDocumentSipMediaApplicationEndpointList(v.Endpoints, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpCreateSipMediaApplicationCall struct { +} + +func (*awsRestjson1_serializeOpCreateSipMediaApplicationCall) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSipMediaApplicationCall) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSipMediaApplicationCallInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}/calls") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateSipMediaApplicationCallInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSipMediaApplicationCallInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateSipMediaApplicationCallInput(v *CreateSipMediaApplicationCallInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSipMediaApplicationCallInput(v *CreateSipMediaApplicationCallInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ArgumentsMap != nil { + ok := object.Key("ArgumentsMap") + if err := awsRestjson1_serializeDocumentSMACreateCallArgumentsMap(v.ArgumentsMap, ok); err != nil { + return err + } + } + + if v.FromPhoneNumber != nil { + ok := object.Key("FromPhoneNumber") + ok.String(*v.FromPhoneNumber) + } + + if v.SipHeaders != nil { + ok := object.Key("SipHeaders") + if err := awsRestjson1_serializeDocumentSipHeadersMap(v.SipHeaders, ok); err != nil { + return err + } + } + + if v.ToPhoneNumber != nil { + ok := object.Key("ToPhoneNumber") + ok.String(*v.ToPhoneNumber) + } + + return nil +} + +type awsRestjson1_serializeOpCreateSipRule struct { +} + +func (*awsRestjson1_serializeOpCreateSipRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSipRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSipRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSipRuleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateSipRuleInput(v *CreateSipRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSipRuleInput(v *CreateSipRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Disabled != nil { + ok := object.Key("Disabled") + ok.Boolean(*v.Disabled) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.TargetApplications != nil { + ok := object.Key("TargetApplications") + if err := awsRestjson1_serializeDocumentSipRuleTargetApplicationList(v.TargetApplications, ok); err != nil { + return err + } + } + + if len(v.TriggerType) > 0 { + ok := object.Key("TriggerType") + ok.String(string(v.TriggerType)) + } + + if v.TriggerValue != nil { + ok := object.Key("TriggerValue") + ok.String(*v.TriggerValue) + } + + return nil +} + +type awsRestjson1_serializeOpCreateVoiceConnector struct { +} + +func (*awsRestjson1_serializeOpCreateVoiceConnector) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateVoiceConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateVoiceConnectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateVoiceConnectorInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateVoiceConnectorInput(v *CreateVoiceConnectorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateVoiceConnectorInput(v *CreateVoiceConnectorInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AwsRegion) > 0 { + ok := object.Key("AwsRegion") + ok.String(string(v.AwsRegion)) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RequireEncryption != nil { + ok := object.Key("RequireEncryption") + ok.Boolean(*v.RequireEncryption) + } + + return nil +} + +type awsRestjson1_serializeOpCreateVoiceConnectorGroup struct { +} + +func (*awsRestjson1_serializeOpCreateVoiceConnectorGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateVoiceConnectorGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateVoiceConnectorGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connector-groups") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateVoiceConnectorGroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateVoiceConnectorGroupInput(v *CreateVoiceConnectorGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateVoiceConnectorGroupInput(v *CreateVoiceConnectorGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.VoiceConnectorItems != nil { + ok := object.Key("VoiceConnectorItems") + if err := awsRestjson1_serializeDocumentVoiceConnectorItemList(v.VoiceConnectorItems, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeletePhoneNumber struct { +} + +func (*awsRestjson1_serializeOpDeletePhoneNumber) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeletePhoneNumber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeletePhoneNumberInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-numbers/{PhoneNumberId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeletePhoneNumberInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeletePhoneNumberInput(v *DeletePhoneNumberInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PhoneNumberId == nil || len(*v.PhoneNumberId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PhoneNumberId must not be empty")} + } + if v.PhoneNumberId != nil { + if err := encoder.SetURI("PhoneNumberId").String(*v.PhoneNumberId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteProxySession struct { +} + +func (*awsRestjson1_serializeOpDeleteProxySession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteProxySession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteProxySessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteProxySessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteProxySessionInput(v *DeleteProxySessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProxySessionId == nil || len(*v.ProxySessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProxySessionId must not be empty")} + } + if v.ProxySessionId != nil { + if err := encoder.SetURI("ProxySessionId").String(*v.ProxySessionId); err != nil { + return err + } + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteSipMediaApplication struct { +} + +func (*awsRestjson1_serializeOpDeleteSipMediaApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSipMediaApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSipMediaApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteSipMediaApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteSipMediaApplicationInput(v *DeleteSipMediaApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteSipRule struct { +} + +func (*awsRestjson1_serializeOpDeleteSipRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSipRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSipRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-rules/{SipRuleId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteSipRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteSipRuleInput(v *DeleteSipRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipRuleId == nil || len(*v.SipRuleId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipRuleId must not be empty")} + } + if v.SipRuleId != nil { + if err := encoder.SetURI("SipRuleId").String(*v.SipRuleId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteVoiceConnector struct { +} + +func (*awsRestjson1_serializeOpDeleteVoiceConnector) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVoiceConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVoiceConnectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorInput(v *DeleteVoiceConnectorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*awsRestjson1_serializeOpDeleteVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVoiceConnectorEmergencyCallingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVoiceConnectorEmergencyCallingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorEmergencyCallingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorEmergencyCallingConfigurationInput(v *DeleteVoiceConnectorEmergencyCallingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteVoiceConnectorGroup struct { +} + +func (*awsRestjson1_serializeOpDeleteVoiceConnectorGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVoiceConnectorGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVoiceConnectorGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connector-groups/{VoiceConnectorGroupId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorGroupInput(v *DeleteVoiceConnectorGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorGroupId == nil || len(*v.VoiceConnectorGroupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorGroupId must not be empty")} + } + if v.VoiceConnectorGroupId != nil { + if err := encoder.SetURI("VoiceConnectorGroupId").String(*v.VoiceConnectorGroupId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteVoiceConnectorOrigination struct { +} + +func (*awsRestjson1_serializeOpDeleteVoiceConnectorOrigination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVoiceConnectorOrigination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVoiceConnectorOriginationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/origination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorOriginationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorOriginationInput(v *DeleteVoiceConnectorOriginationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteVoiceConnectorProxy struct { +} + +func (*awsRestjson1_serializeOpDeleteVoiceConnectorProxy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVoiceConnectorProxy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVoiceConnectorProxyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorProxyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorProxyInput(v *DeleteVoiceConnectorProxyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteVoiceConnectorStreamingConfiguration struct { +} + +func (*awsRestjson1_serializeOpDeleteVoiceConnectorStreamingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVoiceConnectorStreamingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVoiceConnectorStreamingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/streaming-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorStreamingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorStreamingConfigurationInput(v *DeleteVoiceConnectorStreamingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteVoiceConnectorTermination struct { +} + +func (*awsRestjson1_serializeOpDeleteVoiceConnectorTermination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVoiceConnectorTermination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVoiceConnectorTerminationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/termination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorTerminationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorTerminationInput(v *DeleteVoiceConnectorTerminationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteVoiceConnectorTerminationCredentials struct { +} + +func (*awsRestjson1_serializeOpDeleteVoiceConnectorTerminationCredentials) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteVoiceConnectorTerminationCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteVoiceConnectorTerminationCredentialsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/termination/credentials?operation=delete") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorTerminationCredentialsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteVoiceConnectorTerminationCredentialsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteVoiceConnectorTerminationCredentialsInput(v *DeleteVoiceConnectorTerminationCredentialsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteVoiceConnectorTerminationCredentialsInput(v *DeleteVoiceConnectorTerminationCredentialsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Usernames != nil { + ok := object.Key("Usernames") + if err := awsRestjson1_serializeDocumentSensitiveStringList(v.Usernames, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDisassociatePhoneNumbersFromVoiceConnector struct { +} + +func (*awsRestjson1_serializeOpDisassociatePhoneNumbersFromVoiceConnector) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociatePhoneNumbersFromVoiceConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociatePhoneNumbersFromVoiceConnectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}?operation=disassociate-phone-numbers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDisassociatePhoneNumbersFromVoiceConnectorInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDisassociatePhoneNumbersFromVoiceConnectorInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDisassociatePhoneNumbersFromVoiceConnectorInput(v *DisassociatePhoneNumbersFromVoiceConnectorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDisassociatePhoneNumbersFromVoiceConnectorInput(v *DisassociatePhoneNumbersFromVoiceConnectorInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.E164PhoneNumbers != nil { + ok := object.Key("E164PhoneNumbers") + if err := awsRestjson1_serializeDocumentE164PhoneNumberList(v.E164PhoneNumbers, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDisassociatePhoneNumbersFromVoiceConnectorGroup struct { +} + +func (*awsRestjson1_serializeOpDisassociatePhoneNumbersFromVoiceConnectorGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociatePhoneNumbersFromVoiceConnectorGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociatePhoneNumbersFromVoiceConnectorGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connector-groups/{VoiceConnectorGroupId}?operation=disassociate-phone-numbers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDisassociatePhoneNumbersFromVoiceConnectorGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDisassociatePhoneNumbersFromVoiceConnectorGroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDisassociatePhoneNumbersFromVoiceConnectorGroupInput(v *DisassociatePhoneNumbersFromVoiceConnectorGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorGroupId == nil || len(*v.VoiceConnectorGroupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorGroupId must not be empty")} + } + if v.VoiceConnectorGroupId != nil { + if err := encoder.SetURI("VoiceConnectorGroupId").String(*v.VoiceConnectorGroupId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDisassociatePhoneNumbersFromVoiceConnectorGroupInput(v *DisassociatePhoneNumbersFromVoiceConnectorGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.E164PhoneNumbers != nil { + ok := object.Key("E164PhoneNumbers") + if err := awsRestjson1_serializeDocumentE164PhoneNumberList(v.E164PhoneNumbers, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetGlobalSettings struct { +} + +func (*awsRestjson1_serializeOpGetGlobalSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetGlobalSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetGlobalSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/settings") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetGlobalSettingsInput(v *GetGlobalSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpGetPhoneNumber struct { +} + +func (*awsRestjson1_serializeOpGetPhoneNumber) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetPhoneNumber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPhoneNumberInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-numbers/{PhoneNumberId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetPhoneNumberInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetPhoneNumberInput(v *GetPhoneNumberInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PhoneNumberId == nil || len(*v.PhoneNumberId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PhoneNumberId must not be empty")} + } + if v.PhoneNumberId != nil { + if err := encoder.SetURI("PhoneNumberId").String(*v.PhoneNumberId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetPhoneNumberOrder struct { +} + +func (*awsRestjson1_serializeOpGetPhoneNumberOrder) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetPhoneNumberOrder) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPhoneNumberOrderInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-number-orders/{PhoneNumberOrderId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetPhoneNumberOrderInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetPhoneNumberOrderInput(v *GetPhoneNumberOrderInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PhoneNumberOrderId == nil || len(*v.PhoneNumberOrderId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PhoneNumberOrderId must not be empty")} + } + if v.PhoneNumberOrderId != nil { + if err := encoder.SetURI("PhoneNumberOrderId").String(*v.PhoneNumberOrderId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetPhoneNumberSettings struct { +} + +func (*awsRestjson1_serializeOpGetPhoneNumberSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetPhoneNumberSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPhoneNumberSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/settings/phone-number") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetPhoneNumberSettingsInput(v *GetPhoneNumberSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpGetProxySession struct { +} + +func (*awsRestjson1_serializeOpGetProxySession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetProxySession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetProxySessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetProxySessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetProxySessionInput(v *GetProxySessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProxySessionId == nil || len(*v.ProxySessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProxySessionId must not be empty")} + } + if v.ProxySessionId != nil { + if err := encoder.SetURI("ProxySessionId").String(*v.ProxySessionId); err != nil { + return err + } + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSipMediaApplication struct { +} + +func (*awsRestjson1_serializeOpGetSipMediaApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSipMediaApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSipMediaApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSipMediaApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetSipMediaApplicationInput(v *GetSipMediaApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSipMediaApplicationAlexaSkillConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetSipMediaApplicationAlexaSkillConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSipMediaApplicationAlexaSkillConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSipMediaApplicationAlexaSkillConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}/alexa-skill-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSipMediaApplicationAlexaSkillConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetSipMediaApplicationAlexaSkillConfigurationInput(v *GetSipMediaApplicationAlexaSkillConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSipMediaApplicationLoggingConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetSipMediaApplicationLoggingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSipMediaApplicationLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSipMediaApplicationLoggingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}/logging-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSipMediaApplicationLoggingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetSipMediaApplicationLoggingConfigurationInput(v *GetSipMediaApplicationLoggingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetSipRule struct { +} + +func (*awsRestjson1_serializeOpGetSipRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSipRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSipRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-rules/{SipRuleId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSipRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetSipRuleInput(v *GetSipRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipRuleId == nil || len(*v.SipRuleId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipRuleId must not be empty")} + } + if v.SipRuleId != nil { + if err := encoder.SetURI("SipRuleId").String(*v.SipRuleId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnector struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnector) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorInput(v *GetVoiceConnectorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnectorEmergencyCallingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorEmergencyCallingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorEmergencyCallingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorEmergencyCallingConfigurationInput(v *GetVoiceConnectorEmergencyCallingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnectorGroup struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnectorGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnectorGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connector-groups/{VoiceConnectorGroupId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorGroupInput(v *GetVoiceConnectorGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorGroupId == nil || len(*v.VoiceConnectorGroupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorGroupId must not be empty")} + } + if v.VoiceConnectorGroupId != nil { + if err := encoder.SetURI("VoiceConnectorGroupId").String(*v.VoiceConnectorGroupId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnectorLoggingConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnectorLoggingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnectorLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorLoggingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/logging-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorLoggingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorLoggingConfigurationInput(v *GetVoiceConnectorLoggingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnectorOrigination struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnectorOrigination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnectorOrigination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorOriginationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/origination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorOriginationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorOriginationInput(v *GetVoiceConnectorOriginationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnectorProxy struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnectorProxy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnectorProxy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorProxyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorProxyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorProxyInput(v *GetVoiceConnectorProxyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnectorStreamingConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnectorStreamingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnectorStreamingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorStreamingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/streaming-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorStreamingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorStreamingConfigurationInput(v *GetVoiceConnectorStreamingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnectorTermination struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnectorTermination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnectorTermination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorTerminationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/termination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorTerminationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorTerminationInput(v *GetVoiceConnectorTerminationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetVoiceConnectorTerminationHealth struct { +} + +func (*awsRestjson1_serializeOpGetVoiceConnectorTerminationHealth) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetVoiceConnectorTerminationHealth) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetVoiceConnectorTerminationHealthInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/termination/health") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorTerminationHealthInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetVoiceConnectorTerminationHealthInput(v *GetVoiceConnectorTerminationHealthInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListAvailableVoiceConnectorRegions struct { +} + +func (*awsRestjson1_serializeOpListAvailableVoiceConnectorRegions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListAvailableVoiceConnectorRegions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListAvailableVoiceConnectorRegionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connector-regions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListAvailableVoiceConnectorRegionsInput(v *ListAvailableVoiceConnectorRegionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +type awsRestjson1_serializeOpListPhoneNumberOrders struct { +} + +func (*awsRestjson1_serializeOpListPhoneNumberOrders) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPhoneNumberOrders) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListPhoneNumberOrdersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-number-orders") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListPhoneNumberOrdersInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListPhoneNumberOrdersInput(v *ListPhoneNumberOrdersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListPhoneNumbers struct { +} + +func (*awsRestjson1_serializeOpListPhoneNumbers) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListPhoneNumbers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListPhoneNumbersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-numbers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListPhoneNumbersInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListPhoneNumbersInput(v *ListPhoneNumbersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.FilterName) > 0 { + encoder.SetQuery("filter-name").String(string(v.FilterName)) + } + + if v.FilterValue != nil { + encoder.SetQuery("filter-value").String(*v.FilterValue) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + if len(v.ProductType) > 0 { + encoder.SetQuery("product-type").String(string(v.ProductType)) + } + + if v.Status != nil { + encoder.SetQuery("status").String(*v.Status) + } + + return nil +} + +type awsRestjson1_serializeOpListProxySessions struct { +} + +func (*awsRestjson1_serializeOpListProxySessions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListProxySessions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListProxySessionsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/proxy-sessions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListProxySessionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListProxySessionsInput(v *ListProxySessionsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + if len(v.Status) > 0 { + encoder.SetQuery("status").String(string(v.Status)) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListSipMediaApplications struct { +} + +func (*awsRestjson1_serializeOpListSipMediaApplications) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSipMediaApplications) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSipMediaApplicationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSipMediaApplicationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListSipMediaApplicationsInput(v *ListSipMediaApplicationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListSipRules struct { +} + +func (*awsRestjson1_serializeOpListSipRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSipRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSipRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSipRulesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListSipRulesInput(v *ListSipRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + if v.SipMediaApplicationId != nil { + encoder.SetQuery("sip-media-application").String(*v.SipMediaApplicationId) + } + + return nil +} + +type awsRestjson1_serializeOpListSupportedPhoneNumberCountries struct { +} + +func (*awsRestjson1_serializeOpListSupportedPhoneNumberCountries) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSupportedPhoneNumberCountries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSupportedPhoneNumberCountriesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-number-countries") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSupportedPhoneNumberCountriesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListSupportedPhoneNumberCountriesInput(v *ListSupportedPhoneNumberCountriesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if len(v.ProductType) > 0 { + encoder.SetQuery("product-type").String(string(v.ProductType)) + } + + return nil +} + +type awsRestjson1_serializeOpListVoiceConnectorGroups struct { +} + +func (*awsRestjson1_serializeOpListVoiceConnectorGroups) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListVoiceConnectorGroups) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListVoiceConnectorGroupsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connector-groups") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListVoiceConnectorGroupsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListVoiceConnectorGroupsInput(v *ListVoiceConnectorGroupsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListVoiceConnectors struct { +} + +func (*awsRestjson1_serializeOpListVoiceConnectors) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListVoiceConnectors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListVoiceConnectorsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListVoiceConnectorsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListVoiceConnectorsInput(v *ListVoiceConnectorsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListVoiceConnectorTerminationCredentials struct { +} + +func (*awsRestjson1_serializeOpListVoiceConnectorTerminationCredentials) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListVoiceConnectorTerminationCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListVoiceConnectorTerminationCredentialsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/termination/credentials") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListVoiceConnectorTerminationCredentialsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListVoiceConnectorTerminationCredentialsInput(v *ListVoiceConnectorTerminationCredentialsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutSipMediaApplicationAlexaSkillConfiguration struct { +} + +func (*awsRestjson1_serializeOpPutSipMediaApplicationAlexaSkillConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutSipMediaApplicationAlexaSkillConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutSipMediaApplicationAlexaSkillConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}/alexa-skill-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutSipMediaApplicationAlexaSkillConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutSipMediaApplicationAlexaSkillConfigurationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutSipMediaApplicationAlexaSkillConfigurationInput(v *PutSipMediaApplicationAlexaSkillConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutSipMediaApplicationAlexaSkillConfigurationInput(v *PutSipMediaApplicationAlexaSkillConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SipMediaApplicationAlexaSkillConfiguration != nil { + ok := object.Key("SipMediaApplicationAlexaSkillConfiguration") + if err := awsRestjson1_serializeDocumentSipMediaApplicationAlexaSkillConfiguration(v.SipMediaApplicationAlexaSkillConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutSipMediaApplicationLoggingConfiguration struct { +} + +func (*awsRestjson1_serializeOpPutSipMediaApplicationLoggingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutSipMediaApplicationLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutSipMediaApplicationLoggingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}/logging-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutSipMediaApplicationLoggingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutSipMediaApplicationLoggingConfigurationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutSipMediaApplicationLoggingConfigurationInput(v *PutSipMediaApplicationLoggingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutSipMediaApplicationLoggingConfigurationInput(v *PutSipMediaApplicationLoggingConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SipMediaApplicationLoggingConfiguration != nil { + ok := object.Key("SipMediaApplicationLoggingConfiguration") + if err := awsRestjson1_serializeDocumentSipMediaApplicationLoggingConfiguration(v.SipMediaApplicationLoggingConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*awsRestjson1_serializeOpPutVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutVoiceConnectorEmergencyCallingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutVoiceConnectorEmergencyCallingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/emergency-calling-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorEmergencyCallingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutVoiceConnectorEmergencyCallingConfigurationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorEmergencyCallingConfigurationInput(v *PutVoiceConnectorEmergencyCallingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutVoiceConnectorEmergencyCallingConfigurationInput(v *PutVoiceConnectorEmergencyCallingConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EmergencyCallingConfiguration != nil { + ok := object.Key("EmergencyCallingConfiguration") + if err := awsRestjson1_serializeDocumentEmergencyCallingConfiguration(v.EmergencyCallingConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutVoiceConnectorLoggingConfiguration struct { +} + +func (*awsRestjson1_serializeOpPutVoiceConnectorLoggingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutVoiceConnectorLoggingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutVoiceConnectorLoggingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/logging-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorLoggingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutVoiceConnectorLoggingConfigurationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorLoggingConfigurationInput(v *PutVoiceConnectorLoggingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutVoiceConnectorLoggingConfigurationInput(v *PutVoiceConnectorLoggingConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LoggingConfiguration != nil { + ok := object.Key("LoggingConfiguration") + if err := awsRestjson1_serializeDocumentLoggingConfiguration(v.LoggingConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutVoiceConnectorOrigination struct { +} + +func (*awsRestjson1_serializeOpPutVoiceConnectorOrigination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutVoiceConnectorOrigination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutVoiceConnectorOriginationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/origination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorOriginationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutVoiceConnectorOriginationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorOriginationInput(v *PutVoiceConnectorOriginationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutVoiceConnectorOriginationInput(v *PutVoiceConnectorOriginationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Origination != nil { + ok := object.Key("Origination") + if err := awsRestjson1_serializeDocumentOrigination(v.Origination, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutVoiceConnectorProxy struct { +} + +func (*awsRestjson1_serializeOpPutVoiceConnectorProxy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutVoiceConnectorProxy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutVoiceConnectorProxyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/programmable-numbers/proxy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorProxyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutVoiceConnectorProxyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorProxyInput(v *PutVoiceConnectorProxyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutVoiceConnectorProxyInput(v *PutVoiceConnectorProxyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DefaultSessionExpiryMinutes != nil { + ok := object.Key("DefaultSessionExpiryMinutes") + ok.Integer(*v.DefaultSessionExpiryMinutes) + } + + if v.Disabled != nil { + ok := object.Key("Disabled") + ok.Boolean(*v.Disabled) + } + + if v.FallBackPhoneNumber != nil { + ok := object.Key("FallBackPhoneNumber") + ok.String(*v.FallBackPhoneNumber) + } + + if v.PhoneNumberPoolCountries != nil { + ok := object.Key("PhoneNumberPoolCountries") + if err := awsRestjson1_serializeDocumentCountryList(v.PhoneNumberPoolCountries, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutVoiceConnectorStreamingConfiguration struct { +} + +func (*awsRestjson1_serializeOpPutVoiceConnectorStreamingConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutVoiceConnectorStreamingConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutVoiceConnectorStreamingConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/streaming-configuration") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorStreamingConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutVoiceConnectorStreamingConfigurationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorStreamingConfigurationInput(v *PutVoiceConnectorStreamingConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutVoiceConnectorStreamingConfigurationInput(v *PutVoiceConnectorStreamingConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StreamingConfiguration != nil { + ok := object.Key("StreamingConfiguration") + if err := awsRestjson1_serializeDocumentStreamingConfiguration(v.StreamingConfiguration, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutVoiceConnectorTermination struct { +} + +func (*awsRestjson1_serializeOpPutVoiceConnectorTermination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutVoiceConnectorTermination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutVoiceConnectorTerminationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/termination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorTerminationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutVoiceConnectorTerminationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorTerminationInput(v *PutVoiceConnectorTerminationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutVoiceConnectorTerminationInput(v *PutVoiceConnectorTerminationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Termination != nil { + ok := object.Key("Termination") + if err := awsRestjson1_serializeDocumentTermination(v.Termination, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpPutVoiceConnectorTerminationCredentials struct { +} + +func (*awsRestjson1_serializeOpPutVoiceConnectorTerminationCredentials) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpPutVoiceConnectorTerminationCredentials) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutVoiceConnectorTerminationCredentialsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/termination/credentials?operation=put") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorTerminationCredentialsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentPutVoiceConnectorTerminationCredentialsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsPutVoiceConnectorTerminationCredentialsInput(v *PutVoiceConnectorTerminationCredentialsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentPutVoiceConnectorTerminationCredentialsInput(v *PutVoiceConnectorTerminationCredentialsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Credentials != nil { + ok := object.Key("Credentials") + if err := awsRestjson1_serializeDocumentCredentialList(v.Credentials, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpRestorePhoneNumber struct { +} + +func (*awsRestjson1_serializeOpRestorePhoneNumber) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRestorePhoneNumber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RestorePhoneNumberInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-numbers/{PhoneNumberId}?operation=restore") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsRestorePhoneNumberInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsRestorePhoneNumberInput(v *RestorePhoneNumberInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PhoneNumberId == nil || len(*v.PhoneNumberId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PhoneNumberId must not be empty")} + } + if v.PhoneNumberId != nil { + if err := encoder.SetURI("PhoneNumberId").String(*v.PhoneNumberId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpSearchAvailablePhoneNumbers struct { +} + +func (*awsRestjson1_serializeOpSearchAvailablePhoneNumbers) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchAvailablePhoneNumbers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchAvailablePhoneNumbersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/search?type=phone-numbers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchAvailablePhoneNumbersInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchAvailablePhoneNumbersInput(v *SearchAvailablePhoneNumbersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AreaCode != nil { + encoder.SetQuery("area-code").String(*v.AreaCode) + } + + if v.City != nil { + encoder.SetQuery("city").String(*v.City) + } + + if v.Country != nil { + encoder.SetQuery("country").String(*v.Country) + } + + if v.MaxResults != nil { + encoder.SetQuery("max-results").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("next-token").String(*v.NextToken) + } + + if len(v.PhoneNumberType) > 0 { + encoder.SetQuery("phone-number-type").String(string(v.PhoneNumberType)) + } + + if v.State != nil { + encoder.SetQuery("state").String(*v.State) + } + + if v.TollFreePrefix != nil { + encoder.SetQuery("toll-free-prefix").String(*v.TollFreePrefix) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateGlobalSettings struct { +} + +func (*awsRestjson1_serializeOpUpdateGlobalSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateGlobalSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateGlobalSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/settings") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateGlobalSettingsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateGlobalSettingsInput(v *UpdateGlobalSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateGlobalSettingsInput(v *UpdateGlobalSettingsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.VoiceConnector != nil { + ok := object.Key("VoiceConnector") + if err := awsRestjson1_serializeDocumentVoiceConnectorSettings(v.VoiceConnector, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdatePhoneNumber struct { +} + +func (*awsRestjson1_serializeOpUpdatePhoneNumber) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePhoneNumber) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePhoneNumberInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/phone-numbers/{PhoneNumberId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdatePhoneNumberInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePhoneNumberInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdatePhoneNumberInput(v *UpdatePhoneNumberInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.PhoneNumberId == nil || len(*v.PhoneNumberId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PhoneNumberId must not be empty")} + } + if v.PhoneNumberId != nil { + if err := encoder.SetURI("PhoneNumberId").String(*v.PhoneNumberId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePhoneNumberInput(v *UpdatePhoneNumberInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CallingName != nil { + ok := object.Key("CallingName") + ok.String(*v.CallingName) + } + + if len(v.ProductType) > 0 { + ok := object.Key("ProductType") + ok.String(string(v.ProductType)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdatePhoneNumberSettings struct { +} + +func (*awsRestjson1_serializeOpUpdatePhoneNumberSettings) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdatePhoneNumberSettings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdatePhoneNumberSettingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/settings/phone-number") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdatePhoneNumberSettingsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdatePhoneNumberSettingsInput(v *UpdatePhoneNumberSettingsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdatePhoneNumberSettingsInput(v *UpdatePhoneNumberSettingsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CallingName != nil { + ok := object.Key("CallingName") + ok.String(*v.CallingName) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateProxySession struct { +} + +func (*awsRestjson1_serializeOpUpdateProxySession) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateProxySession) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateProxySessionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}/proxy-sessions/{ProxySessionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateProxySessionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateProxySessionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateProxySessionInput(v *UpdateProxySessionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ProxySessionId == nil || len(*v.ProxySessionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ProxySessionId must not be empty")} + } + if v.ProxySessionId != nil { + if err := encoder.SetURI("ProxySessionId").String(*v.ProxySessionId); err != nil { + return err + } + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateProxySessionInput(v *UpdateProxySessionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Capabilities != nil { + ok := object.Key("Capabilities") + if err := awsRestjson1_serializeDocumentCapabilityList(v.Capabilities, ok); err != nil { + return err + } + } + + if v.ExpiryMinutes != nil { + ok := object.Key("ExpiryMinutes") + ok.Integer(*v.ExpiryMinutes) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSipMediaApplication struct { +} + +func (*awsRestjson1_serializeOpUpdateSipMediaApplication) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSipMediaApplication) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSipMediaApplicationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateSipMediaApplicationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSipMediaApplicationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateSipMediaApplicationInput(v *UpdateSipMediaApplicationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSipMediaApplicationInput(v *UpdateSipMediaApplicationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Endpoints != nil { + ok := object.Key("Endpoints") + if err := awsRestjson1_serializeDocumentSipMediaApplicationEndpointList(v.Endpoints, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSipMediaApplicationCall struct { +} + +func (*awsRestjson1_serializeOpUpdateSipMediaApplicationCall) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSipMediaApplicationCall) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSipMediaApplicationCallInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-media-applications/{SipMediaApplicationId}/calls/{TransactionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateSipMediaApplicationCallInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSipMediaApplicationCallInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateSipMediaApplicationCallInput(v *UpdateSipMediaApplicationCallInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipMediaApplicationId == nil || len(*v.SipMediaApplicationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipMediaApplicationId must not be empty")} + } + if v.SipMediaApplicationId != nil { + if err := encoder.SetURI("SipMediaApplicationId").String(*v.SipMediaApplicationId); err != nil { + return err + } + } + + if v.TransactionId == nil || len(*v.TransactionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member TransactionId must not be empty")} + } + if v.TransactionId != nil { + if err := encoder.SetURI("TransactionId").String(*v.TransactionId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSipMediaApplicationCallInput(v *UpdateSipMediaApplicationCallInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Arguments != nil { + ok := object.Key("Arguments") + if err := awsRestjson1_serializeDocumentSMAUpdateCallArgumentsMap(v.Arguments, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSipRule struct { +} + +func (*awsRestjson1_serializeOpUpdateSipRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSipRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSipRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/sip-rules/{SipRuleId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateSipRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSipRuleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateSipRuleInput(v *UpdateSipRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.SipRuleId == nil || len(*v.SipRuleId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member SipRuleId must not be empty")} + } + if v.SipRuleId != nil { + if err := encoder.SetURI("SipRuleId").String(*v.SipRuleId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSipRuleInput(v *UpdateSipRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Disabled != nil { + ok := object.Key("Disabled") + ok.Boolean(*v.Disabled) + } + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.TargetApplications != nil { + ok := object.Key("TargetApplications") + if err := awsRestjson1_serializeDocumentSipRuleTargetApplicationList(v.TargetApplications, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateVoiceConnector struct { +} + +func (*awsRestjson1_serializeOpUpdateVoiceConnector) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateVoiceConnector) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateVoiceConnectorInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connectors/{VoiceConnectorId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateVoiceConnectorInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateVoiceConnectorInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateVoiceConnectorInput(v *UpdateVoiceConnectorInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorId == nil || len(*v.VoiceConnectorId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorId must not be empty")} + } + if v.VoiceConnectorId != nil { + if err := encoder.SetURI("VoiceConnectorId").String(*v.VoiceConnectorId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateVoiceConnectorInput(v *UpdateVoiceConnectorInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RequireEncryption != nil { + ok := object.Key("RequireEncryption") + ok.Boolean(*v.RequireEncryption) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateVoiceConnectorGroup struct { +} + +func (*awsRestjson1_serializeOpUpdateVoiceConnectorGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateVoiceConnectorGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateVoiceConnectorGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/voice-connector-groups/{VoiceConnectorGroupId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateVoiceConnectorGroupInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateVoiceConnectorGroupInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateVoiceConnectorGroupInput(v *UpdateVoiceConnectorGroupInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.VoiceConnectorGroupId == nil || len(*v.VoiceConnectorGroupId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member VoiceConnectorGroupId must not be empty")} + } + if v.VoiceConnectorGroupId != nil { + if err := encoder.SetURI("VoiceConnectorGroupId").String(*v.VoiceConnectorGroupId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateVoiceConnectorGroupInput(v *UpdateVoiceConnectorGroupInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.VoiceConnectorItems != nil { + ok := object.Key("VoiceConnectorItems") + if err := awsRestjson1_serializeDocumentVoiceConnectorItemList(v.VoiceConnectorItems, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpValidateE911Address struct { +} + +func (*awsRestjson1_serializeOpValidateE911Address) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpValidateE911Address) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ValidateE911AddressInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/emergency-calling/address") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentValidateE911AddressInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsValidateE911AddressInput(v *ValidateE911AddressInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentValidateE911AddressInput(v *ValidateE911AddressInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwsAccountId != nil { + ok := object.Key("AwsAccountId") + ok.String(*v.AwsAccountId) + } + + if v.City != nil { + ok := object.Key("City") + ok.String(*v.City) + } + + if v.Country != nil { + ok := object.Key("Country") + ok.String(*v.Country) + } + + if v.PostalCode != nil { + ok := object.Key("PostalCode") + ok.String(*v.PostalCode) + } + + if v.State != nil { + ok := object.Key("State") + ok.String(*v.State) + } + + if v.StreetInfo != nil { + ok := object.Key("StreetInfo") + ok.String(*v.StreetInfo) + } + + if v.StreetNumber != nil { + ok := object.Key("StreetNumber") + ok.String(*v.StreetNumber) + } + + return nil +} + +func awsRestjson1_serializeDocumentAlexaSkillIdList(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_serializeDocumentCallingRegionList(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_serializeDocumentCapabilityList(v []types.Capability, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + +func awsRestjson1_serializeDocumentCountryList(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_serializeDocumentCredential(v *types.Credential, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Password != nil { + ok := object.Key("Password") + ok.String(*v.Password) + } + + if v.Username != nil { + ok := object.Key("Username") + ok.String(*v.Username) + } + + return nil +} + +func awsRestjson1_serializeDocumentCredentialList(v []types.Credential, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCredential(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentDNISEmergencyCallingConfiguration(v *types.DNISEmergencyCallingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CallingCountry != nil { + ok := object.Key("CallingCountry") + ok.String(*v.CallingCountry) + } + + if v.EmergencyPhoneNumber != nil { + ok := object.Key("EmergencyPhoneNumber") + ok.String(*v.EmergencyPhoneNumber) + } + + if v.TestPhoneNumber != nil { + ok := object.Key("TestPhoneNumber") + ok.String(*v.TestPhoneNumber) + } + + return nil +} + +func awsRestjson1_serializeDocumentDNISEmergencyCallingConfigurationList(v []types.DNISEmergencyCallingConfiguration, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDNISEmergencyCallingConfiguration(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentE164PhoneNumberList(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_serializeDocumentEmergencyCallingConfiguration(v *types.EmergencyCallingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DNIS != nil { + ok := object.Key("DNIS") + if err := awsRestjson1_serializeDocumentDNISEmergencyCallingConfigurationList(v.DNIS, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentGeoMatchParams(v *types.GeoMatchParams, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AreaCode != nil { + ok := object.Key("AreaCode") + ok.String(*v.AreaCode) + } + + if v.Country != nil { + ok := object.Key("Country") + ok.String(*v.Country) + } + + return nil +} + +func awsRestjson1_serializeDocumentLoggingConfiguration(v *types.LoggingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnableSIPLogs != nil { + ok := object.Key("EnableSIPLogs") + ok.Boolean(*v.EnableSIPLogs) + } + + return nil +} + +func awsRestjson1_serializeDocumentNonEmptyStringList(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_serializeDocumentOrigination(v *types.Origination, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Disabled != nil { + ok := object.Key("Disabled") + ok.Boolean(*v.Disabled) + } + + if v.Routes != nil { + ok := object.Key("Routes") + if err := awsRestjson1_serializeDocumentOriginationRouteList(v.Routes, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentOriginationRoute(v *types.OriginationRoute, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Host != nil { + ok := object.Key("Host") + ok.String(*v.Host) + } + + if v.Port != nil { + ok := object.Key("Port") + ok.Integer(*v.Port) + } + + if v.Priority != nil { + ok := object.Key("Priority") + ok.Integer(*v.Priority) + } + + if len(v.Protocol) > 0 { + ok := object.Key("Protocol") + ok.String(string(v.Protocol)) + } + + if v.Weight != nil { + ok := object.Key("Weight") + ok.Integer(*v.Weight) + } + + return nil +} + +func awsRestjson1_serializeDocumentOriginationRouteList(v []types.OriginationRoute, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentOriginationRoute(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentParticipantPhoneNumberList(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_serializeDocumentSensitiveStringList(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_serializeDocumentSipHeadersMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentSipMediaApplicationAlexaSkillConfiguration(v *types.SipMediaApplicationAlexaSkillConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AlexaSkillIds != nil { + ok := object.Key("AlexaSkillIds") + if err := awsRestjson1_serializeDocumentAlexaSkillIdList(v.AlexaSkillIds, ok); err != nil { + return err + } + } + + if len(v.AlexaSkillStatus) > 0 { + ok := object.Key("AlexaSkillStatus") + ok.String(string(v.AlexaSkillStatus)) + } + + return nil +} + +func awsRestjson1_serializeDocumentSipMediaApplicationEndpoint(v *types.SipMediaApplicationEndpoint, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LambdaArn != nil { + ok := object.Key("LambdaArn") + ok.String(*v.LambdaArn) + } + + return nil +} + +func awsRestjson1_serializeDocumentSipMediaApplicationEndpointList(v []types.SipMediaApplicationEndpoint, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSipMediaApplicationEndpoint(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSipMediaApplicationLoggingConfiguration(v *types.SipMediaApplicationLoggingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnableSipMediaApplicationMessageLogs != nil { + ok := object.Key("EnableSipMediaApplicationMessageLogs") + ok.Boolean(*v.EnableSipMediaApplicationMessageLogs) + } + + return nil +} + +func awsRestjson1_serializeDocumentSipRuleTargetApplication(v *types.SipRuleTargetApplication, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AwsRegion != nil { + ok := object.Key("AwsRegion") + ok.String(*v.AwsRegion) + } + + if v.Priority != nil { + ok := object.Key("Priority") + ok.Integer(*v.Priority) + } + + if v.SipMediaApplicationId != nil { + ok := object.Key("SipMediaApplicationId") + ok.String(*v.SipMediaApplicationId) + } + + return nil +} + +func awsRestjson1_serializeDocumentSipRuleTargetApplicationList(v []types.SipRuleTargetApplication, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSipRuleTargetApplication(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentSMACreateCallArgumentsMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentSMAUpdateCallArgumentsMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + +func awsRestjson1_serializeDocumentStreamingConfiguration(v *types.StreamingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataRetentionInHours != nil { + ok := object.Key("DataRetentionInHours") + ok.Integer(*v.DataRetentionInHours) + } + + if v.Disabled != nil { + ok := object.Key("Disabled") + ok.Boolean(*v.Disabled) + } + + if v.StreamingNotificationTargets != nil { + ok := object.Key("StreamingNotificationTargets") + if err := awsRestjson1_serializeDocumentStreamingNotificationTargetList(v.StreamingNotificationTargets, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentStreamingNotificationTarget(v *types.StreamingNotificationTarget, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.NotificationTarget) > 0 { + ok := object.Key("NotificationTarget") + ok.String(string(v.NotificationTarget)) + } + + return nil +} + +func awsRestjson1_serializeDocumentStreamingNotificationTargetList(v []types.StreamingNotificationTarget, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentStreamingNotificationTarget(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentStringList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsRestjson1_serializeDocumentTermination(v *types.Termination, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CallingRegions != nil { + ok := object.Key("CallingRegions") + if err := awsRestjson1_serializeDocumentCallingRegionList(v.CallingRegions, ok); err != nil { + return err + } + } + + if v.CidrAllowedList != nil { + ok := object.Key("CidrAllowedList") + if err := awsRestjson1_serializeDocumentStringList(v.CidrAllowedList, ok); err != nil { + return err + } + } + + if v.CpsLimit != nil { + ok := object.Key("CpsLimit") + ok.Integer(*v.CpsLimit) + } + + if v.DefaultPhoneNumber != nil { + ok := object.Key("DefaultPhoneNumber") + ok.String(*v.DefaultPhoneNumber) + } + + if v.Disabled != nil { + ok := object.Key("Disabled") + ok.Boolean(*v.Disabled) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePhoneNumberRequestItem(v *types.UpdatePhoneNumberRequestItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CallingName != nil { + ok := object.Key("CallingName") + ok.String(*v.CallingName) + } + + if v.PhoneNumberId != nil { + ok := object.Key("PhoneNumberId") + ok.String(*v.PhoneNumberId) + } + + if len(v.ProductType) > 0 { + ok := object.Key("ProductType") + ok.String(string(v.ProductType)) + } + + return nil +} + +func awsRestjson1_serializeDocumentUpdatePhoneNumberRequestItemList(v []types.UpdatePhoneNumberRequestItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentUpdatePhoneNumberRequestItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentVoiceConnectorItem(v *types.VoiceConnectorItem, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Priority != nil { + ok := object.Key("Priority") + ok.Integer(*v.Priority) + } + + if v.VoiceConnectorId != nil { + ok := object.Key("VoiceConnectorId") + ok.String(*v.VoiceConnectorId) + } + + return nil +} + +func awsRestjson1_serializeDocumentVoiceConnectorItemList(v []types.VoiceConnectorItem, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentVoiceConnectorItem(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentVoiceConnectorSettings(v *types.VoiceConnectorSettings, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CdrBucket != nil { + ok := object.Key("CdrBucket") + ok.String(*v.CdrBucket) + } + + return nil +} diff --git a/service/chimesdkvoice/types/enums.go b/service/chimesdkvoice/types/enums.go new file mode 100644 index 00000000000..40182cc457c --- /dev/null +++ b/service/chimesdkvoice/types/enums.go @@ -0,0 +1,419 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AlexaSkillStatus string + +// Enum values for AlexaSkillStatus +const ( + AlexaSkillStatusActive AlexaSkillStatus = "ACTIVE" + AlexaSkillStatusInactive AlexaSkillStatus = "INACTIVE" +) + +// Values returns all known values for AlexaSkillStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (AlexaSkillStatus) Values() []AlexaSkillStatus { + return []AlexaSkillStatus{ + "ACTIVE", + "INACTIVE", + } +} + +type CallingNameStatus string + +// Enum values for CallingNameStatus +const ( + CallingNameStatusUnassigned CallingNameStatus = "Unassigned" + CallingNameStatusUpdateInProgress CallingNameStatus = "UpdateInProgress" + CallingNameStatusUpdateSucceeded CallingNameStatus = "UpdateSucceeded" + CallingNameStatusUpdateFailed CallingNameStatus = "UpdateFailed" +) + +// Values returns all known values for CallingNameStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (CallingNameStatus) Values() []CallingNameStatus { + return []CallingNameStatus{ + "Unassigned", + "UpdateInProgress", + "UpdateSucceeded", + "UpdateFailed", + } +} + +type Capability string + +// Enum values for Capability +const ( + CapabilityVoice Capability = "Voice" + CapabilitySms Capability = "SMS" +) + +// Values returns all known values for Capability. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (Capability) Values() []Capability { + return []Capability{ + "Voice", + "SMS", + } +} + +type ErrorCode string + +// Enum values for ErrorCode +const ( + ErrorCodeBadRequest ErrorCode = "BadRequest" + ErrorCodeConflict ErrorCode = "Conflict" + ErrorCodeForbidden ErrorCode = "Forbidden" + ErrorCodeNotFound ErrorCode = "NotFound" + ErrorCodePreconditionFailed ErrorCode = "PreconditionFailed" + ErrorCodeResourceLimitExceeded ErrorCode = "ResourceLimitExceeded" + ErrorCodeServiceFailure ErrorCode = "ServiceFailure" + ErrorCodeAccessDenied ErrorCode = "AccessDenied" + ErrorCodeServiceUnavailable ErrorCode = "ServiceUnavailable" + ErrorCodeThrottled ErrorCode = "Throttled" + ErrorCodeThrottling ErrorCode = "Throttling" + ErrorCodeUnauthorized ErrorCode = "Unauthorized" + ErrorCodeUnprocessable ErrorCode = "Unprocessable" + ErrorCodeVoiceConnectorGroupAssociationsExist ErrorCode = "VoiceConnectorGroupAssociationsExist" + ErrorCodePhoneNumberAssociationsExist ErrorCode = "PhoneNumberAssociationsExist" + ErrorCodeGone ErrorCode = "Gone" +) + +// Values returns all known values for ErrorCode. Note that this can be expanded in +// the future, and so it is only as up to date as the client. The ordering of this +// slice is not guaranteed to be stable across updates. +func (ErrorCode) Values() []ErrorCode { + return []ErrorCode{ + "BadRequest", + "Conflict", + "Forbidden", + "NotFound", + "PreconditionFailed", + "ResourceLimitExceeded", + "ServiceFailure", + "AccessDenied", + "ServiceUnavailable", + "Throttled", + "Throttling", + "Unauthorized", + "Unprocessable", + "VoiceConnectorGroupAssociationsExist", + "PhoneNumberAssociationsExist", + "Gone", + } +} + +type GeoMatchLevel string + +// Enum values for GeoMatchLevel +const ( + GeoMatchLevelCountry GeoMatchLevel = "Country" + GeoMatchLevelAreaCode GeoMatchLevel = "AreaCode" +) + +// Values returns all known values for GeoMatchLevel. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (GeoMatchLevel) Values() []GeoMatchLevel { + return []GeoMatchLevel{ + "Country", + "AreaCode", + } +} + +type NotificationTarget string + +// Enum values for NotificationTarget +const ( + NotificationTargetEventBridge NotificationTarget = "EventBridge" + NotificationTargetSns NotificationTarget = "SNS" + NotificationTargetSqs NotificationTarget = "SQS" +) + +// Values returns all known values for NotificationTarget. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (NotificationTarget) Values() []NotificationTarget { + return []NotificationTarget{ + "EventBridge", + "SNS", + "SQS", + } +} + +type NumberSelectionBehavior string + +// Enum values for NumberSelectionBehavior +const ( + NumberSelectionBehaviorPreferSticky NumberSelectionBehavior = "PreferSticky" + NumberSelectionBehaviorAvoidSticky NumberSelectionBehavior = "AvoidSticky" +) + +// Values returns all known values for NumberSelectionBehavior. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (NumberSelectionBehavior) Values() []NumberSelectionBehavior { + return []NumberSelectionBehavior{ + "PreferSticky", + "AvoidSticky", + } +} + +type OrderedPhoneNumberStatus string + +// Enum values for OrderedPhoneNumberStatus +const ( + OrderedPhoneNumberStatusProcessing OrderedPhoneNumberStatus = "Processing" + OrderedPhoneNumberStatusAcquired OrderedPhoneNumberStatus = "Acquired" + OrderedPhoneNumberStatusFailed OrderedPhoneNumberStatus = "Failed" +) + +// Values returns all known values for OrderedPhoneNumberStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (OrderedPhoneNumberStatus) Values() []OrderedPhoneNumberStatus { + return []OrderedPhoneNumberStatus{ + "Processing", + "Acquired", + "Failed", + } +} + +type OriginationRouteProtocol string + +// Enum values for OriginationRouteProtocol +const ( + OriginationRouteProtocolTcp OriginationRouteProtocol = "TCP" + OriginationRouteProtocolUdp OriginationRouteProtocol = "UDP" +) + +// Values returns all known values for OriginationRouteProtocol. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (OriginationRouteProtocol) Values() []OriginationRouteProtocol { + return []OriginationRouteProtocol{ + "TCP", + "UDP", + } +} + +type PhoneNumberAssociationName string + +// Enum values for PhoneNumberAssociationName +const ( + PhoneNumberAssociationNameVoiceConnectorId PhoneNumberAssociationName = "VoiceConnectorId" + PhoneNumberAssociationNameVoiceConnectorGroupId PhoneNumberAssociationName = "VoiceConnectorGroupId" + PhoneNumberAssociationNameSipRuleId PhoneNumberAssociationName = "SipRuleId" +) + +// Values returns all known values for PhoneNumberAssociationName. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (PhoneNumberAssociationName) Values() []PhoneNumberAssociationName { + return []PhoneNumberAssociationName{ + "VoiceConnectorId", + "VoiceConnectorGroupId", + "SipRuleId", + } +} + +type PhoneNumberOrderStatus string + +// Enum values for PhoneNumberOrderStatus +const ( + PhoneNumberOrderStatusProcessing PhoneNumberOrderStatus = "Processing" + PhoneNumberOrderStatusSuccessful PhoneNumberOrderStatus = "Successful" + PhoneNumberOrderStatusFailed PhoneNumberOrderStatus = "Failed" + PhoneNumberOrderStatusPartial PhoneNumberOrderStatus = "Partial" + PhoneNumberOrderStatusPendingDocuments PhoneNumberOrderStatus = "PendingDocuments" + PhoneNumberOrderStatusSubmitted PhoneNumberOrderStatus = "Submitted" + PhoneNumberOrderStatusFoc PhoneNumberOrderStatus = "FOC" + PhoneNumberOrderStatusChangeRequested PhoneNumberOrderStatus = "ChangeRequested" + PhoneNumberOrderStatusException PhoneNumberOrderStatus = "Exception" + PhoneNumberOrderStatusCancelRequested PhoneNumberOrderStatus = "CancelRequested" + PhoneNumberOrderStatusCancelled PhoneNumberOrderStatus = "Cancelled" +) + +// Values returns all known values for PhoneNumberOrderStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PhoneNumberOrderStatus) Values() []PhoneNumberOrderStatus { + return []PhoneNumberOrderStatus{ + "Processing", + "Successful", + "Failed", + "Partial", + "PendingDocuments", + "Submitted", + "FOC", + "ChangeRequested", + "Exception", + "CancelRequested", + "Cancelled", + } +} + +type PhoneNumberOrderType string + +// Enum values for PhoneNumberOrderType +const ( + PhoneNumberOrderTypeNew PhoneNumberOrderType = "New" + PhoneNumberOrderTypePorting PhoneNumberOrderType = "Porting" +) + +// Values returns all known values for PhoneNumberOrderType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PhoneNumberOrderType) Values() []PhoneNumberOrderType { + return []PhoneNumberOrderType{ + "New", + "Porting", + } +} + +type PhoneNumberProductType string + +// Enum values for PhoneNumberProductType +const ( + PhoneNumberProductTypeVoiceConnector PhoneNumberProductType = "VoiceConnector" + PhoneNumberProductTypeSipMediaApplicationDialIn PhoneNumberProductType = "SipMediaApplicationDialIn" +) + +// Values returns all known values for PhoneNumberProductType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PhoneNumberProductType) Values() []PhoneNumberProductType { + return []PhoneNumberProductType{ + "VoiceConnector", + "SipMediaApplicationDialIn", + } +} + +type PhoneNumberStatus string + +// Enum values for PhoneNumberStatus +const ( + PhoneNumberStatusCancelled PhoneNumberStatus = "Cancelled" + PhoneNumberStatusPortinCancelRequested PhoneNumberStatus = "PortinCancelRequested" + PhoneNumberStatusPortinInProgress PhoneNumberStatus = "PortinInProgress" + PhoneNumberStatusAcquireInProgress PhoneNumberStatus = "AcquireInProgress" + PhoneNumberStatusAcquireFailed PhoneNumberStatus = "AcquireFailed" + PhoneNumberStatusUnassigned PhoneNumberStatus = "Unassigned" + PhoneNumberStatusAssigned PhoneNumberStatus = "Assigned" + PhoneNumberStatusReleaseInProgress PhoneNumberStatus = "ReleaseInProgress" + PhoneNumberStatusDeleteInProgress PhoneNumberStatus = "DeleteInProgress" + PhoneNumberStatusReleaseFailed PhoneNumberStatus = "ReleaseFailed" + PhoneNumberStatusDeleteFailed PhoneNumberStatus = "DeleteFailed" +) + +// Values returns all known values for PhoneNumberStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PhoneNumberStatus) Values() []PhoneNumberStatus { + return []PhoneNumberStatus{ + "Cancelled", + "PortinCancelRequested", + "PortinInProgress", + "AcquireInProgress", + "AcquireFailed", + "Unassigned", + "Assigned", + "ReleaseInProgress", + "DeleteInProgress", + "ReleaseFailed", + "DeleteFailed", + } +} + +type PhoneNumberType string + +// Enum values for PhoneNumberType +const ( + PhoneNumberTypeLocal PhoneNumberType = "Local" + PhoneNumberTypeTollFree PhoneNumberType = "TollFree" +) + +// Values returns all known values for PhoneNumberType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (PhoneNumberType) Values() []PhoneNumberType { + return []PhoneNumberType{ + "Local", + "TollFree", + } +} + +type ProxySessionStatus string + +// Enum values for ProxySessionStatus +const ( + ProxySessionStatusOpen ProxySessionStatus = "Open" + ProxySessionStatusInProgress ProxySessionStatus = "InProgress" + ProxySessionStatusClosed ProxySessionStatus = "Closed" +) + +// Values returns all known values for ProxySessionStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (ProxySessionStatus) Values() []ProxySessionStatus { + return []ProxySessionStatus{ + "Open", + "InProgress", + "Closed", + } +} + +type SipRuleTriggerType string + +// Enum values for SipRuleTriggerType +const ( + SipRuleTriggerTypeToPhoneNumber SipRuleTriggerType = "ToPhoneNumber" + SipRuleTriggerTypeRequestUriHostname SipRuleTriggerType = "RequestUriHostname" +) + +// Values returns all known values for SipRuleTriggerType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (SipRuleTriggerType) Values() []SipRuleTriggerType { + return []SipRuleTriggerType{ + "ToPhoneNumber", + "RequestUriHostname", + } +} + +type VoiceConnectorAwsRegion string + +// Enum values for VoiceConnectorAwsRegion +const ( + VoiceConnectorAwsRegionUsEast1 VoiceConnectorAwsRegion = "us-east-1" + VoiceConnectorAwsRegionUsWest2 VoiceConnectorAwsRegion = "us-west-2" + VoiceConnectorAwsRegionCaCentral1 VoiceConnectorAwsRegion = "ca-central-1" + VoiceConnectorAwsRegionEuCentral1 VoiceConnectorAwsRegion = "eu-central-1" + VoiceConnectorAwsRegionEuWest1 VoiceConnectorAwsRegion = "eu-west-1" + VoiceConnectorAwsRegionEuWest2 VoiceConnectorAwsRegion = "eu-west-2" + VoiceConnectorAwsRegionApNortheast2 VoiceConnectorAwsRegion = "ap-northeast-2" + VoiceConnectorAwsRegionApNortheast1 VoiceConnectorAwsRegion = "ap-northeast-1" + VoiceConnectorAwsRegionApSoutheast1 VoiceConnectorAwsRegion = "ap-southeast-1" + VoiceConnectorAwsRegionApSoutheast2 VoiceConnectorAwsRegion = "ap-southeast-2" +) + +// Values returns all known values for VoiceConnectorAwsRegion. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (VoiceConnectorAwsRegion) Values() []VoiceConnectorAwsRegion { + return []VoiceConnectorAwsRegion{ + "us-east-1", + "us-west-2", + "ca-central-1", + "eu-central-1", + "eu-west-1", + "eu-west-2", + "ap-northeast-2", + "ap-northeast-1", + "ap-southeast-1", + "ap-southeast-2", + } +} diff --git a/service/chimesdkvoice/types/errors.go b/service/chimesdkvoice/types/errors.go new file mode 100644 index 00000000000..70461f3ab75 --- /dev/null +++ b/service/chimesdkvoice/types/errors.go @@ -0,0 +1,208 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +type AccessDeniedException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +type BadRequestException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *BadRequestException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *BadRequestException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *BadRequestException) ErrorCode() string { return "BadRequestException" } +func (e *BadRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +type ConflictException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +type ForbiddenException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *ForbiddenException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ForbiddenException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ForbiddenException) ErrorCode() string { return "ForbiddenException" } +func (e *ForbiddenException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +type NotFoundException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *NotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *NotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *NotFoundException) ErrorCode() string { return "NotFoundException" } +func (e *NotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +type ResourceLimitExceededException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *ResourceLimitExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceLimitExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceLimitExceededException) ErrorCode() string { return "ResourceLimitExceededException" } +func (e *ResourceLimitExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +type ServiceFailureException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *ServiceFailureException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceFailureException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceFailureException) ErrorCode() string { return "ServiceFailureException" } +func (e *ServiceFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +type ServiceUnavailableException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *ServiceUnavailableException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceUnavailableException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceUnavailableException) ErrorCode() string { return "ServiceUnavailableException" } +func (e *ServiceUnavailableException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +type ThrottledClientException struct { + Message *string + + Code ErrorCode + + noSmithyDocumentSerde +} + +func (e *ThrottledClientException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottledClientException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottledClientException) ErrorCode() string { return "ThrottledClientException" } +func (e *ThrottledClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +type UnauthorizedClientException struct { + Message *string + + Code ErrorCode + + 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 { return "UnauthorizedClientException" } +func (e *UnauthorizedClientException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/chimesdkvoice/types/types.go b/service/chimesdkvoice/types/types.go new file mode 100644 index 00000000000..14c330aab35 --- /dev/null +++ b/service/chimesdkvoice/types/types.go @@ -0,0 +1,451 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +type Address struct { + City *string + + Country *string + + PostDirectional *string + + PostalCode *string + + PostalCodePlus4 *string + + PreDirectional *string + + State *string + + StreetName *string + + StreetNumber *string + + StreetSuffix *string + + noSmithyDocumentSerde +} + +type CandidateAddress struct { + City *string + + Country *string + + PostalCode *string + + PostalCodePlus4 *string + + State *string + + StreetInfo *string + + StreetNumber *string + + noSmithyDocumentSerde +} + +type Credential struct { + Password *string + + Username *string + + noSmithyDocumentSerde +} + +type DNISEmergencyCallingConfiguration struct { + + // This member is required. + CallingCountry *string + + // This member is required. + EmergencyPhoneNumber *string + + TestPhoneNumber *string + + noSmithyDocumentSerde +} + +type EmergencyCallingConfiguration struct { + DNIS []DNISEmergencyCallingConfiguration + + noSmithyDocumentSerde +} + +type GeoMatchParams struct { + + // This member is required. + AreaCode *string + + // This member is required. + Country *string + + noSmithyDocumentSerde +} + +type LoggingConfiguration struct { + EnableSIPLogs *bool + + noSmithyDocumentSerde +} + +type OrderedPhoneNumber struct { + E164PhoneNumber *string + + Status OrderedPhoneNumberStatus + + noSmithyDocumentSerde +} + +type Origination struct { + Disabled *bool + + Routes []OriginationRoute + + noSmithyDocumentSerde +} + +type OriginationRoute struct { + Host *string + + Port *int32 + + Priority *int32 + + Protocol OriginationRouteProtocol + + Weight *int32 + + noSmithyDocumentSerde +} + +type Participant struct { + PhoneNumber *string + + ProxyPhoneNumber *string + + noSmithyDocumentSerde +} + +type PhoneNumber struct { + Associations []PhoneNumberAssociation + + CallingName *string + + CallingNameStatus CallingNameStatus + + Capabilities *PhoneNumberCapabilities + + Country *string + + CreatedTimestamp *time.Time + + DeletionTimestamp *time.Time + + E164PhoneNumber *string + + OrderId *string + + PhoneNumberId *string + + ProductType PhoneNumberProductType + + Status PhoneNumberStatus + + Type PhoneNumberType + + UpdatedTimestamp *time.Time + + noSmithyDocumentSerde +} + +type PhoneNumberAssociation struct { + AssociatedTimestamp *time.Time + + Name PhoneNumberAssociationName + + Value *string + + noSmithyDocumentSerde +} + +type PhoneNumberCapabilities struct { + InboundCall *bool + + InboundMMS *bool + + InboundSMS *bool + + OutboundCall *bool + + OutboundMMS *bool + + OutboundSMS *bool + + noSmithyDocumentSerde +} + +type PhoneNumberCountry struct { + CountryCode *string + + SupportedPhoneNumberTypes []PhoneNumberType + + noSmithyDocumentSerde +} + +type PhoneNumberError struct { + ErrorCode ErrorCode + + ErrorMessage *string + + PhoneNumberId *string + + noSmithyDocumentSerde +} + +type PhoneNumberOrder struct { + CreatedTimestamp *time.Time + + OrderType PhoneNumberOrderType + + OrderedPhoneNumbers []OrderedPhoneNumber + + PhoneNumberOrderId *string + + ProductType PhoneNumberProductType + + Status PhoneNumberOrderStatus + + UpdatedTimestamp *time.Time + + noSmithyDocumentSerde +} + +type Proxy struct { + DefaultSessionExpiryMinutes *int32 + + Disabled *bool + + FallBackPhoneNumber *string + + PhoneNumberCountries []string + + noSmithyDocumentSerde +} + +type ProxySession struct { + Capabilities []Capability + + CreatedTimestamp *time.Time + + EndedTimestamp *time.Time + + ExpiryMinutes *int32 + + GeoMatchLevel GeoMatchLevel + + GeoMatchParams *GeoMatchParams + + Name *string + + NumberSelectionBehavior NumberSelectionBehavior + + Participants []Participant + + ProxySessionId *string + + Status ProxySessionStatus + + UpdatedTimestamp *time.Time + + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type SipMediaApplication struct { + AwsRegion *string + + CreatedTimestamp *time.Time + + Endpoints []SipMediaApplicationEndpoint + + Name *string + + SipMediaApplicationId *string + + UpdatedTimestamp *time.Time + + noSmithyDocumentSerde +} + +type SipMediaApplicationAlexaSkillConfiguration struct { + + // This member is required. + AlexaSkillIds []string + + // This member is required. + AlexaSkillStatus AlexaSkillStatus + + noSmithyDocumentSerde +} + +type SipMediaApplicationCall struct { + TransactionId *string + + noSmithyDocumentSerde +} + +type SipMediaApplicationEndpoint struct { + LambdaArn *string + + noSmithyDocumentSerde +} + +type SipMediaApplicationLoggingConfiguration struct { + EnableSipMediaApplicationMessageLogs *bool + + noSmithyDocumentSerde +} + +type SipRule struct { + CreatedTimestamp *time.Time + + Disabled *bool + + Name *string + + SipRuleId *string + + TargetApplications []SipRuleTargetApplication + + TriggerType SipRuleTriggerType + + TriggerValue *string + + UpdatedTimestamp *time.Time + + noSmithyDocumentSerde +} + +type SipRuleTargetApplication struct { + AwsRegion *string + + Priority *int32 + + SipMediaApplicationId *string + + noSmithyDocumentSerde +} + +type StreamingConfiguration struct { + + // This member is required. + DataRetentionInHours *int32 + + // This member is required. + Disabled *bool + + StreamingNotificationTargets []StreamingNotificationTarget + + noSmithyDocumentSerde +} + +type StreamingNotificationTarget struct { + NotificationTarget NotificationTarget + + noSmithyDocumentSerde +} + +type Termination struct { + CallingRegions []string + + CidrAllowedList []string + + CpsLimit *int32 + + DefaultPhoneNumber *string + + Disabled *bool + + noSmithyDocumentSerde +} + +type TerminationHealth struct { + Source *string + + Timestamp *time.Time + + noSmithyDocumentSerde +} + +type UpdatePhoneNumberRequestItem struct { + + // This member is required. + PhoneNumberId *string + + CallingName *string + + ProductType PhoneNumberProductType + + noSmithyDocumentSerde +} + +type VoiceConnector struct { + AwsRegion VoiceConnectorAwsRegion + + CreatedTimestamp *time.Time + + Name *string + + OutboundHostName *string + + RequireEncryption *bool + + UpdatedTimestamp *time.Time + + VoiceConnectorArn *string + + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type VoiceConnectorGroup struct { + CreatedTimestamp *time.Time + + Name *string + + UpdatedTimestamp *time.Time + + VoiceConnectorGroupArn *string + + VoiceConnectorGroupId *string + + VoiceConnectorItems []VoiceConnectorItem + + noSmithyDocumentSerde +} + +type VoiceConnectorItem struct { + + // This member is required. + Priority *int32 + + // This member is required. + VoiceConnectorId *string + + noSmithyDocumentSerde +} + +type VoiceConnectorSettings struct { + CdrBucket *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/chimesdkvoice/validators.go b/service/chimesdkvoice/validators.go new file mode 100644 index 00000000000..8a0b115bdd8 --- /dev/null +++ b/service/chimesdkvoice/validators.go @@ -0,0 +1,2789 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package chimesdkvoice + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/chimesdkvoice/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAssociatePhoneNumbersWithVoiceConnectorGroup struct { +} + +func (*validateOpAssociatePhoneNumbersWithVoiceConnectorGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociatePhoneNumbersWithVoiceConnectorGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociatePhoneNumbersWithVoiceConnectorGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociatePhoneNumbersWithVoiceConnectorGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpAssociatePhoneNumbersWithVoiceConnector struct { +} + +func (*validateOpAssociatePhoneNumbersWithVoiceConnector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociatePhoneNumbersWithVoiceConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociatePhoneNumbersWithVoiceConnectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociatePhoneNumbersWithVoiceConnectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchDeletePhoneNumber struct { +} + +func (*validateOpBatchDeletePhoneNumber) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchDeletePhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchDeletePhoneNumberInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchDeletePhoneNumberInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpBatchUpdatePhoneNumber struct { +} + +func (*validateOpBatchUpdatePhoneNumber) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpBatchUpdatePhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*BatchUpdatePhoneNumberInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpBatchUpdatePhoneNumberInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreatePhoneNumberOrder struct { +} + +func (*validateOpCreatePhoneNumberOrder) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreatePhoneNumberOrder) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreatePhoneNumberOrderInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreatePhoneNumberOrderInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateProxySession struct { +} + +func (*validateOpCreateProxySession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateProxySession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateProxySessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateProxySessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSipMediaApplicationCall struct { +} + +func (*validateOpCreateSipMediaApplicationCall) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSipMediaApplicationCall) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSipMediaApplicationCallInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSipMediaApplicationCallInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSipMediaApplication struct { +} + +func (*validateOpCreateSipMediaApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSipMediaApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSipMediaApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSipMediaApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSipRule struct { +} + +func (*validateOpCreateSipRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSipRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSipRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSipRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateVoiceConnectorGroup struct { +} + +func (*validateOpCreateVoiceConnectorGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateVoiceConnectorGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateVoiceConnectorGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateVoiceConnectorGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateVoiceConnector struct { +} + +func (*validateOpCreateVoiceConnector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateVoiceConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateVoiceConnectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateVoiceConnectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeletePhoneNumber struct { +} + +func (*validateOpDeletePhoneNumber) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeletePhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeletePhoneNumberInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeletePhoneNumberInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteProxySession struct { +} + +func (*validateOpDeleteProxySession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteProxySession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteProxySessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteProxySessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSipMediaApplication struct { +} + +func (*validateOpDeleteSipMediaApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSipMediaApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSipMediaApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSipMediaApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSipRule struct { +} + +func (*validateOpDeleteSipRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSipRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSipRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSipRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*validateOpDeleteVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVoiceConnectorEmergencyCallingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVoiceConnectorEmergencyCallingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVoiceConnectorEmergencyCallingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVoiceConnectorGroup struct { +} + +func (*validateOpDeleteVoiceConnectorGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVoiceConnectorGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVoiceConnectorGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVoiceConnectorGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVoiceConnector struct { +} + +func (*validateOpDeleteVoiceConnector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVoiceConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVoiceConnectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVoiceConnectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVoiceConnectorOrigination struct { +} + +func (*validateOpDeleteVoiceConnectorOrigination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVoiceConnectorOrigination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVoiceConnectorOriginationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVoiceConnectorOriginationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVoiceConnectorProxy struct { +} + +func (*validateOpDeleteVoiceConnectorProxy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVoiceConnectorProxy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVoiceConnectorProxyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVoiceConnectorProxyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVoiceConnectorStreamingConfiguration struct { +} + +func (*validateOpDeleteVoiceConnectorStreamingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVoiceConnectorStreamingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVoiceConnectorStreamingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVoiceConnectorStreamingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVoiceConnectorTerminationCredentials struct { +} + +func (*validateOpDeleteVoiceConnectorTerminationCredentials) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVoiceConnectorTerminationCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVoiceConnectorTerminationCredentialsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVoiceConnectorTerminationCredentialsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteVoiceConnectorTermination struct { +} + +func (*validateOpDeleteVoiceConnectorTermination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteVoiceConnectorTermination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteVoiceConnectorTerminationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteVoiceConnectorTerminationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisassociatePhoneNumbersFromVoiceConnectorGroup struct { +} + +func (*validateOpDisassociatePhoneNumbersFromVoiceConnectorGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociatePhoneNumbersFromVoiceConnectorGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociatePhoneNumbersFromVoiceConnectorGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociatePhoneNumbersFromVoiceConnectorGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisassociatePhoneNumbersFromVoiceConnector struct { +} + +func (*validateOpDisassociatePhoneNumbersFromVoiceConnector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociatePhoneNumbersFromVoiceConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociatePhoneNumbersFromVoiceConnectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociatePhoneNumbersFromVoiceConnectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetPhoneNumber struct { +} + +func (*validateOpGetPhoneNumber) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPhoneNumberInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPhoneNumberInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetPhoneNumberOrder struct { +} + +func (*validateOpGetPhoneNumberOrder) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPhoneNumberOrder) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPhoneNumberOrderInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPhoneNumberOrderInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetProxySession struct { +} + +func (*validateOpGetProxySession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetProxySession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetProxySessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetProxySessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSipMediaApplicationAlexaSkillConfiguration struct { +} + +func (*validateOpGetSipMediaApplicationAlexaSkillConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSipMediaApplicationAlexaSkillConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSipMediaApplicationAlexaSkillConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSipMediaApplicationAlexaSkillConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSipMediaApplication struct { +} + +func (*validateOpGetSipMediaApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSipMediaApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSipMediaApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSipMediaApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSipMediaApplicationLoggingConfiguration struct { +} + +func (*validateOpGetSipMediaApplicationLoggingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSipMediaApplicationLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSipMediaApplicationLoggingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSipMediaApplicationLoggingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSipRule struct { +} + +func (*validateOpGetSipRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSipRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSipRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSipRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*validateOpGetVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnectorEmergencyCallingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorEmergencyCallingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorEmergencyCallingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnectorGroup struct { +} + +func (*validateOpGetVoiceConnectorGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnectorGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnector struct { +} + +func (*validateOpGetVoiceConnector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnectorLoggingConfiguration struct { +} + +func (*validateOpGetVoiceConnectorLoggingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnectorLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorLoggingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorLoggingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnectorOrigination struct { +} + +func (*validateOpGetVoiceConnectorOrigination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnectorOrigination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorOriginationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorOriginationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnectorProxy struct { +} + +func (*validateOpGetVoiceConnectorProxy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnectorProxy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorProxyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorProxyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnectorStreamingConfiguration struct { +} + +func (*validateOpGetVoiceConnectorStreamingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnectorStreamingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorStreamingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorStreamingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnectorTerminationHealth struct { +} + +func (*validateOpGetVoiceConnectorTerminationHealth) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnectorTerminationHealth) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorTerminationHealthInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorTerminationHealthInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetVoiceConnectorTermination struct { +} + +func (*validateOpGetVoiceConnectorTermination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetVoiceConnectorTermination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetVoiceConnectorTerminationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetVoiceConnectorTerminationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListProxySessions struct { +} + +func (*validateOpListProxySessions) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListProxySessions) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListProxySessionsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListProxySessionsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListSupportedPhoneNumberCountries struct { +} + +func (*validateOpListSupportedPhoneNumberCountries) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListSupportedPhoneNumberCountries) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListSupportedPhoneNumberCountriesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListSupportedPhoneNumberCountriesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListVoiceConnectorTerminationCredentials struct { +} + +func (*validateOpListVoiceConnectorTerminationCredentials) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListVoiceConnectorTerminationCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListVoiceConnectorTerminationCredentialsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListVoiceConnectorTerminationCredentialsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutSipMediaApplicationAlexaSkillConfiguration struct { +} + +func (*validateOpPutSipMediaApplicationAlexaSkillConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutSipMediaApplicationAlexaSkillConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutSipMediaApplicationAlexaSkillConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutSipMediaApplicationAlexaSkillConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutSipMediaApplicationLoggingConfiguration struct { +} + +func (*validateOpPutSipMediaApplicationLoggingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutSipMediaApplicationLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutSipMediaApplicationLoggingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutSipMediaApplicationLoggingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutVoiceConnectorEmergencyCallingConfiguration struct { +} + +func (*validateOpPutVoiceConnectorEmergencyCallingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutVoiceConnectorEmergencyCallingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutVoiceConnectorEmergencyCallingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutVoiceConnectorEmergencyCallingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutVoiceConnectorLoggingConfiguration struct { +} + +func (*validateOpPutVoiceConnectorLoggingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutVoiceConnectorLoggingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutVoiceConnectorLoggingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutVoiceConnectorLoggingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutVoiceConnectorOrigination struct { +} + +func (*validateOpPutVoiceConnectorOrigination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutVoiceConnectorOrigination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutVoiceConnectorOriginationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutVoiceConnectorOriginationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutVoiceConnectorProxy struct { +} + +func (*validateOpPutVoiceConnectorProxy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutVoiceConnectorProxy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutVoiceConnectorProxyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutVoiceConnectorProxyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutVoiceConnectorStreamingConfiguration struct { +} + +func (*validateOpPutVoiceConnectorStreamingConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutVoiceConnectorStreamingConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutVoiceConnectorStreamingConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutVoiceConnectorStreamingConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutVoiceConnectorTerminationCredentials struct { +} + +func (*validateOpPutVoiceConnectorTerminationCredentials) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutVoiceConnectorTerminationCredentials) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutVoiceConnectorTerminationCredentialsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutVoiceConnectorTerminationCredentialsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpPutVoiceConnectorTermination struct { +} + +func (*validateOpPutVoiceConnectorTermination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutVoiceConnectorTermination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutVoiceConnectorTerminationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutVoiceConnectorTerminationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRestorePhoneNumber struct { +} + +func (*validateOpRestorePhoneNumber) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRestorePhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RestorePhoneNumberInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRestorePhoneNumberInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdatePhoneNumber struct { +} + +func (*validateOpUpdatePhoneNumber) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePhoneNumber) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePhoneNumberInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePhoneNumberInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdatePhoneNumberSettings struct { +} + +func (*validateOpUpdatePhoneNumberSettings) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdatePhoneNumberSettings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdatePhoneNumberSettingsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdatePhoneNumberSettingsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateProxySession struct { +} + +func (*validateOpUpdateProxySession) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateProxySession) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateProxySessionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateProxySessionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSipMediaApplicationCall struct { +} + +func (*validateOpUpdateSipMediaApplicationCall) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSipMediaApplicationCall) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSipMediaApplicationCallInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSipMediaApplicationCallInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSipMediaApplication struct { +} + +func (*validateOpUpdateSipMediaApplication) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSipMediaApplication) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSipMediaApplicationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSipMediaApplicationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSipRule struct { +} + +func (*validateOpUpdateSipRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSipRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSipRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSipRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateVoiceConnectorGroup struct { +} + +func (*validateOpUpdateVoiceConnectorGroup) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateVoiceConnectorGroup) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateVoiceConnectorGroupInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateVoiceConnectorGroupInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateVoiceConnector struct { +} + +func (*validateOpUpdateVoiceConnector) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateVoiceConnector) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateVoiceConnectorInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateVoiceConnectorInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpValidateE911Address struct { +} + +func (*validateOpValidateE911Address) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpValidateE911Address) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ValidateE911AddressInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpValidateE911AddressInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAssociatePhoneNumbersWithVoiceConnectorGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociatePhoneNumbersWithVoiceConnectorGroup{}, middleware.After) +} + +func addOpAssociatePhoneNumbersWithVoiceConnectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociatePhoneNumbersWithVoiceConnector{}, middleware.After) +} + +func addOpBatchDeletePhoneNumberValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchDeletePhoneNumber{}, middleware.After) +} + +func addOpBatchUpdatePhoneNumberValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpBatchUpdatePhoneNumber{}, middleware.After) +} + +func addOpCreatePhoneNumberOrderValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreatePhoneNumberOrder{}, middleware.After) +} + +func addOpCreateProxySessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateProxySession{}, middleware.After) +} + +func addOpCreateSipMediaApplicationCallValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSipMediaApplicationCall{}, middleware.After) +} + +func addOpCreateSipMediaApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSipMediaApplication{}, middleware.After) +} + +func addOpCreateSipRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSipRule{}, middleware.After) +} + +func addOpCreateVoiceConnectorGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateVoiceConnectorGroup{}, middleware.After) +} + +func addOpCreateVoiceConnectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateVoiceConnector{}, middleware.After) +} + +func addOpDeletePhoneNumberValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeletePhoneNumber{}, middleware.After) +} + +func addOpDeleteProxySessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteProxySession{}, middleware.After) +} + +func addOpDeleteSipMediaApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSipMediaApplication{}, middleware.After) +} + +func addOpDeleteSipRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSipRule{}, middleware.After) +} + +func addOpDeleteVoiceConnectorEmergencyCallingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) +} + +func addOpDeleteVoiceConnectorGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVoiceConnectorGroup{}, middleware.After) +} + +func addOpDeleteVoiceConnectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVoiceConnector{}, middleware.After) +} + +func addOpDeleteVoiceConnectorOriginationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVoiceConnectorOrigination{}, middleware.After) +} + +func addOpDeleteVoiceConnectorProxyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVoiceConnectorProxy{}, middleware.After) +} + +func addOpDeleteVoiceConnectorStreamingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVoiceConnectorStreamingConfiguration{}, middleware.After) +} + +func addOpDeleteVoiceConnectorTerminationCredentialsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVoiceConnectorTerminationCredentials{}, middleware.After) +} + +func addOpDeleteVoiceConnectorTerminationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteVoiceConnectorTermination{}, middleware.After) +} + +func addOpDisassociatePhoneNumbersFromVoiceConnectorGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociatePhoneNumbersFromVoiceConnectorGroup{}, middleware.After) +} + +func addOpDisassociatePhoneNumbersFromVoiceConnectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociatePhoneNumbersFromVoiceConnector{}, middleware.After) +} + +func addOpGetPhoneNumberValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPhoneNumber{}, middleware.After) +} + +func addOpGetPhoneNumberOrderValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPhoneNumberOrder{}, middleware.After) +} + +func addOpGetProxySessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetProxySession{}, middleware.After) +} + +func addOpGetSipMediaApplicationAlexaSkillConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSipMediaApplicationAlexaSkillConfiguration{}, middleware.After) +} + +func addOpGetSipMediaApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSipMediaApplication{}, middleware.After) +} + +func addOpGetSipMediaApplicationLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSipMediaApplicationLoggingConfiguration{}, middleware.After) +} + +func addOpGetSipRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSipRule{}, middleware.After) +} + +func addOpGetVoiceConnectorEmergencyCallingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) +} + +func addOpGetVoiceConnectorGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnectorGroup{}, middleware.After) +} + +func addOpGetVoiceConnectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnector{}, middleware.After) +} + +func addOpGetVoiceConnectorLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnectorLoggingConfiguration{}, middleware.After) +} + +func addOpGetVoiceConnectorOriginationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnectorOrigination{}, middleware.After) +} + +func addOpGetVoiceConnectorProxyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnectorProxy{}, middleware.After) +} + +func addOpGetVoiceConnectorStreamingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnectorStreamingConfiguration{}, middleware.After) +} + +func addOpGetVoiceConnectorTerminationHealthValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnectorTerminationHealth{}, middleware.After) +} + +func addOpGetVoiceConnectorTerminationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetVoiceConnectorTermination{}, middleware.After) +} + +func addOpListProxySessionsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListProxySessions{}, middleware.After) +} + +func addOpListSupportedPhoneNumberCountriesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListSupportedPhoneNumberCountries{}, middleware.After) +} + +func addOpListVoiceConnectorTerminationCredentialsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListVoiceConnectorTerminationCredentials{}, middleware.After) +} + +func addOpPutSipMediaApplicationAlexaSkillConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutSipMediaApplicationAlexaSkillConfiguration{}, middleware.After) +} + +func addOpPutSipMediaApplicationLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutSipMediaApplicationLoggingConfiguration{}, middleware.After) +} + +func addOpPutVoiceConnectorEmergencyCallingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutVoiceConnectorEmergencyCallingConfiguration{}, middleware.After) +} + +func addOpPutVoiceConnectorLoggingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutVoiceConnectorLoggingConfiguration{}, middleware.After) +} + +func addOpPutVoiceConnectorOriginationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutVoiceConnectorOrigination{}, middleware.After) +} + +func addOpPutVoiceConnectorProxyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutVoiceConnectorProxy{}, middleware.After) +} + +func addOpPutVoiceConnectorStreamingConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutVoiceConnectorStreamingConfiguration{}, middleware.After) +} + +func addOpPutVoiceConnectorTerminationCredentialsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutVoiceConnectorTerminationCredentials{}, middleware.After) +} + +func addOpPutVoiceConnectorTerminationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutVoiceConnectorTermination{}, middleware.After) +} + +func addOpRestorePhoneNumberValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRestorePhoneNumber{}, middleware.After) +} + +func addOpUpdatePhoneNumberValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePhoneNumber{}, middleware.After) +} + +func addOpUpdatePhoneNumberSettingsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdatePhoneNumberSettings{}, middleware.After) +} + +func addOpUpdateProxySessionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateProxySession{}, middleware.After) +} + +func addOpUpdateSipMediaApplicationCallValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSipMediaApplicationCall{}, middleware.After) +} + +func addOpUpdateSipMediaApplicationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSipMediaApplication{}, middleware.After) +} + +func addOpUpdateSipRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSipRule{}, middleware.After) +} + +func addOpUpdateVoiceConnectorGroupValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateVoiceConnectorGroup{}, middleware.After) +} + +func addOpUpdateVoiceConnectorValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateVoiceConnector{}, middleware.After) +} + +func addOpValidateE911AddressValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpValidateE911Address{}, middleware.After) +} + +func validateDNISEmergencyCallingConfiguration(v *types.DNISEmergencyCallingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DNISEmergencyCallingConfiguration"} + if v.EmergencyPhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmergencyPhoneNumber")) + } + if v.CallingCountry == nil { + invalidParams.Add(smithy.NewErrParamRequired("CallingCountry")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDNISEmergencyCallingConfigurationList(v []types.DNISEmergencyCallingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DNISEmergencyCallingConfigurationList"} + for i := range v { + if err := validateDNISEmergencyCallingConfiguration(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateEmergencyCallingConfiguration(v *types.EmergencyCallingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "EmergencyCallingConfiguration"} + if v.DNIS != nil { + if err := validateDNISEmergencyCallingConfigurationList(v.DNIS); err != nil { + invalidParams.AddNested("DNIS", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateGeoMatchParams(v *types.GeoMatchParams) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GeoMatchParams"} + if v.Country == nil { + invalidParams.Add(smithy.NewErrParamRequired("Country")) + } + if v.AreaCode == nil { + invalidParams.Add(smithy.NewErrParamRequired("AreaCode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSipMediaApplicationAlexaSkillConfiguration(v *types.SipMediaApplicationAlexaSkillConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SipMediaApplicationAlexaSkillConfiguration"} + if len(v.AlexaSkillStatus) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AlexaSkillStatus")) + } + if v.AlexaSkillIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("AlexaSkillIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStreamingConfiguration(v *types.StreamingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StreamingConfiguration"} + if v.DataRetentionInHours == nil { + invalidParams.Add(smithy.NewErrParamRequired("DataRetentionInHours")) + } + if v.Disabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("Disabled")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdatePhoneNumberRequestItem(v *types.UpdatePhoneNumberRequestItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePhoneNumberRequestItem"} + if v.PhoneNumberId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpdatePhoneNumberRequestItemList(v []types.UpdatePhoneNumberRequestItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePhoneNumberRequestItemList"} + for i := range v { + if err := validateUpdatePhoneNumberRequestItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVoiceConnectorItem(v *types.VoiceConnectorItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VoiceConnectorItem"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.Priority == nil { + invalidParams.Add(smithy.NewErrParamRequired("Priority")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVoiceConnectorItemList(v []types.VoiceConnectorItem) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VoiceConnectorItemList"} + for i := range v { + if err := validateVoiceConnectorItem(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociatePhoneNumbersWithVoiceConnectorGroupInput(v *AssociatePhoneNumbersWithVoiceConnectorGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociatePhoneNumbersWithVoiceConnectorGroupInput"} + if v.VoiceConnectorGroupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorGroupId")) + } + if v.E164PhoneNumbers == nil { + invalidParams.Add(smithy.NewErrParamRequired("E164PhoneNumbers")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociatePhoneNumbersWithVoiceConnectorInput(v *AssociatePhoneNumbersWithVoiceConnectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociatePhoneNumbersWithVoiceConnectorInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.E164PhoneNumbers == nil { + invalidParams.Add(smithy.NewErrParamRequired("E164PhoneNumbers")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchDeletePhoneNumberInput(v *BatchDeletePhoneNumberInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchDeletePhoneNumberInput"} + if v.PhoneNumberIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberIds")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpBatchUpdatePhoneNumberInput(v *BatchUpdatePhoneNumberInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "BatchUpdatePhoneNumberInput"} + if v.UpdatePhoneNumberRequestItems == nil { + invalidParams.Add(smithy.NewErrParamRequired("UpdatePhoneNumberRequestItems")) + } else if v.UpdatePhoneNumberRequestItems != nil { + if err := validateUpdatePhoneNumberRequestItemList(v.UpdatePhoneNumberRequestItems); err != nil { + invalidParams.AddNested("UpdatePhoneNumberRequestItems", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreatePhoneNumberOrderInput(v *CreatePhoneNumberOrderInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreatePhoneNumberOrderInput"} + if len(v.ProductType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ProductType")) + } + if v.E164PhoneNumbers == nil { + invalidParams.Add(smithy.NewErrParamRequired("E164PhoneNumbers")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateProxySessionInput(v *CreateProxySessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateProxySessionInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.ParticipantPhoneNumbers == nil { + invalidParams.Add(smithy.NewErrParamRequired("ParticipantPhoneNumbers")) + } + if v.Capabilities == nil { + invalidParams.Add(smithy.NewErrParamRequired("Capabilities")) + } + if v.GeoMatchParams != nil { + if err := validateGeoMatchParams(v.GeoMatchParams); err != nil { + invalidParams.AddNested("GeoMatchParams", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateSipMediaApplicationCallInput(v *CreateSipMediaApplicationCallInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSipMediaApplicationCallInput"} + if v.FromPhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("FromPhoneNumber")) + } + if v.ToPhoneNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("ToPhoneNumber")) + } + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateSipMediaApplicationInput(v *CreateSipMediaApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSipMediaApplicationInput"} + if v.AwsRegion == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsRegion")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Endpoints == nil { + invalidParams.Add(smithy.NewErrParamRequired("Endpoints")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateSipRuleInput(v *CreateSipRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSipRuleInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if len(v.TriggerType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("TriggerType")) + } + if v.TriggerValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("TriggerValue")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateVoiceConnectorGroupInput(v *CreateVoiceConnectorGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateVoiceConnectorGroupInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.VoiceConnectorItems != nil { + if err := validateVoiceConnectorItemList(v.VoiceConnectorItems); err != nil { + invalidParams.AddNested("VoiceConnectorItems", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateVoiceConnectorInput(v *CreateVoiceConnectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateVoiceConnectorInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.RequireEncryption == nil { + invalidParams.Add(smithy.NewErrParamRequired("RequireEncryption")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeletePhoneNumberInput(v *DeletePhoneNumberInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeletePhoneNumberInput"} + if v.PhoneNumberId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteProxySessionInput(v *DeleteProxySessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteProxySessionInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.ProxySessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProxySessionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSipMediaApplicationInput(v *DeleteSipMediaApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSipMediaApplicationInput"} + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSipRuleInput(v *DeleteSipRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSipRuleInput"} + if v.SipRuleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipRuleId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVoiceConnectorEmergencyCallingConfigurationInput(v *DeleteVoiceConnectorEmergencyCallingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVoiceConnectorEmergencyCallingConfigurationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVoiceConnectorGroupInput(v *DeleteVoiceConnectorGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVoiceConnectorGroupInput"} + if v.VoiceConnectorGroupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorGroupId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVoiceConnectorInput(v *DeleteVoiceConnectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVoiceConnectorInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVoiceConnectorOriginationInput(v *DeleteVoiceConnectorOriginationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVoiceConnectorOriginationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVoiceConnectorProxyInput(v *DeleteVoiceConnectorProxyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVoiceConnectorProxyInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVoiceConnectorStreamingConfigurationInput(v *DeleteVoiceConnectorStreamingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVoiceConnectorStreamingConfigurationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVoiceConnectorTerminationCredentialsInput(v *DeleteVoiceConnectorTerminationCredentialsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVoiceConnectorTerminationCredentialsInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.Usernames == nil { + invalidParams.Add(smithy.NewErrParamRequired("Usernames")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteVoiceConnectorTerminationInput(v *DeleteVoiceConnectorTerminationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteVoiceConnectorTerminationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisassociatePhoneNumbersFromVoiceConnectorGroupInput(v *DisassociatePhoneNumbersFromVoiceConnectorGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociatePhoneNumbersFromVoiceConnectorGroupInput"} + if v.VoiceConnectorGroupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorGroupId")) + } + if v.E164PhoneNumbers == nil { + invalidParams.Add(smithy.NewErrParamRequired("E164PhoneNumbers")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisassociatePhoneNumbersFromVoiceConnectorInput(v *DisassociatePhoneNumbersFromVoiceConnectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociatePhoneNumbersFromVoiceConnectorInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.E164PhoneNumbers == nil { + invalidParams.Add(smithy.NewErrParamRequired("E164PhoneNumbers")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetPhoneNumberInput(v *GetPhoneNumberInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPhoneNumberInput"} + if v.PhoneNumberId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetPhoneNumberOrderInput(v *GetPhoneNumberOrderInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPhoneNumberOrderInput"} + if v.PhoneNumberOrderId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberOrderId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetProxySessionInput(v *GetProxySessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetProxySessionInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.ProxySessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProxySessionId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSipMediaApplicationAlexaSkillConfigurationInput(v *GetSipMediaApplicationAlexaSkillConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSipMediaApplicationAlexaSkillConfigurationInput"} + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSipMediaApplicationInput(v *GetSipMediaApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSipMediaApplicationInput"} + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSipMediaApplicationLoggingConfigurationInput(v *GetSipMediaApplicationLoggingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSipMediaApplicationLoggingConfigurationInput"} + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSipRuleInput(v *GetSipRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSipRuleInput"} + if v.SipRuleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipRuleId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorEmergencyCallingConfigurationInput(v *GetVoiceConnectorEmergencyCallingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorEmergencyCallingConfigurationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorGroupInput(v *GetVoiceConnectorGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorGroupInput"} + if v.VoiceConnectorGroupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorGroupId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorInput(v *GetVoiceConnectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorLoggingConfigurationInput(v *GetVoiceConnectorLoggingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorLoggingConfigurationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorOriginationInput(v *GetVoiceConnectorOriginationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorOriginationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorProxyInput(v *GetVoiceConnectorProxyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorProxyInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorStreamingConfigurationInput(v *GetVoiceConnectorStreamingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorStreamingConfigurationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorTerminationHealthInput(v *GetVoiceConnectorTerminationHealthInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorTerminationHealthInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetVoiceConnectorTerminationInput(v *GetVoiceConnectorTerminationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetVoiceConnectorTerminationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListProxySessionsInput(v *ListProxySessionsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListProxySessionsInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListSupportedPhoneNumberCountriesInput(v *ListSupportedPhoneNumberCountriesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListSupportedPhoneNumberCountriesInput"} + if len(v.ProductType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ProductType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListVoiceConnectorTerminationCredentialsInput(v *ListVoiceConnectorTerminationCredentialsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListVoiceConnectorTerminationCredentialsInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutSipMediaApplicationAlexaSkillConfigurationInput(v *PutSipMediaApplicationAlexaSkillConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutSipMediaApplicationAlexaSkillConfigurationInput"} + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if v.SipMediaApplicationAlexaSkillConfiguration != nil { + if err := validateSipMediaApplicationAlexaSkillConfiguration(v.SipMediaApplicationAlexaSkillConfiguration); err != nil { + invalidParams.AddNested("SipMediaApplicationAlexaSkillConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutSipMediaApplicationLoggingConfigurationInput(v *PutSipMediaApplicationLoggingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutSipMediaApplicationLoggingConfigurationInput"} + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutVoiceConnectorEmergencyCallingConfigurationInput(v *PutVoiceConnectorEmergencyCallingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutVoiceConnectorEmergencyCallingConfigurationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.EmergencyCallingConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmergencyCallingConfiguration")) + } else if v.EmergencyCallingConfiguration != nil { + if err := validateEmergencyCallingConfiguration(v.EmergencyCallingConfiguration); err != nil { + invalidParams.AddNested("EmergencyCallingConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutVoiceConnectorLoggingConfigurationInput(v *PutVoiceConnectorLoggingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutVoiceConnectorLoggingConfigurationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.LoggingConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("LoggingConfiguration")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutVoiceConnectorOriginationInput(v *PutVoiceConnectorOriginationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutVoiceConnectorOriginationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.Origination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Origination")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutVoiceConnectorProxyInput(v *PutVoiceConnectorProxyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutVoiceConnectorProxyInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.DefaultSessionExpiryMinutes == nil { + invalidParams.Add(smithy.NewErrParamRequired("DefaultSessionExpiryMinutes")) + } + if v.PhoneNumberPoolCountries == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberPoolCountries")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutVoiceConnectorStreamingConfigurationInput(v *PutVoiceConnectorStreamingConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutVoiceConnectorStreamingConfigurationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.StreamingConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("StreamingConfiguration")) + } else if v.StreamingConfiguration != nil { + if err := validateStreamingConfiguration(v.StreamingConfiguration); err != nil { + invalidParams.AddNested("StreamingConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutVoiceConnectorTerminationCredentialsInput(v *PutVoiceConnectorTerminationCredentialsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutVoiceConnectorTerminationCredentialsInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpPutVoiceConnectorTerminationInput(v *PutVoiceConnectorTerminationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutVoiceConnectorTerminationInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.Termination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Termination")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRestorePhoneNumberInput(v *RestorePhoneNumberInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RestorePhoneNumberInput"} + if v.PhoneNumberId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdatePhoneNumberInput(v *UpdatePhoneNumberInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePhoneNumberInput"} + if v.PhoneNumberId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PhoneNumberId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdatePhoneNumberSettingsInput(v *UpdatePhoneNumberSettingsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdatePhoneNumberSettingsInput"} + if v.CallingName == nil { + invalidParams.Add(smithy.NewErrParamRequired("CallingName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateProxySessionInput(v *UpdateProxySessionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateProxySessionInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.ProxySessionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ProxySessionId")) + } + if v.Capabilities == nil { + invalidParams.Add(smithy.NewErrParamRequired("Capabilities")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSipMediaApplicationCallInput(v *UpdateSipMediaApplicationCallInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSipMediaApplicationCallInput"} + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if v.TransactionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TransactionId")) + } + if v.Arguments == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arguments")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSipMediaApplicationInput(v *UpdateSipMediaApplicationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSipMediaApplicationInput"} + if v.SipMediaApplicationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipMediaApplicationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSipRuleInput(v *UpdateSipRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSipRuleInput"} + if v.SipRuleId == nil { + invalidParams.Add(smithy.NewErrParamRequired("SipRuleId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateVoiceConnectorGroupInput(v *UpdateVoiceConnectorGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateVoiceConnectorGroupInput"} + if v.VoiceConnectorGroupId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorGroupId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.VoiceConnectorItems == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorItems")) + } else if v.VoiceConnectorItems != nil { + if err := validateVoiceConnectorItemList(v.VoiceConnectorItems); err != nil { + invalidParams.AddNested("VoiceConnectorItems", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateVoiceConnectorInput(v *UpdateVoiceConnectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateVoiceConnectorInput"} + if v.VoiceConnectorId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VoiceConnectorId")) + } + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.RequireEncryption == nil { + invalidParams.Add(smithy.NewErrParamRequired("RequireEncryption")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpValidateE911AddressInput(v *ValidateE911AddressInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ValidateE911AddressInput"} + if v.AwsAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsAccountId")) + } + if v.StreetNumber == nil { + invalidParams.Add(smithy.NewErrParamRequired("StreetNumber")) + } + if v.StreetInfo == nil { + invalidParams.Add(smithy.NewErrParamRequired("StreetInfo")) + } + if v.City == nil { + invalidParams.Add(smithy.NewErrParamRequired("City")) + } + if v.State == nil { + invalidParams.Add(smithy.NewErrParamRequired("State")) + } + if v.Country == nil { + invalidParams.Add(smithy.NewErrParamRequired("Country")) + } + if v.PostalCode == nil { + invalidParams.Add(smithy.NewErrParamRequired("PostalCode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/cloudfront/api_op_CopyDistribution.go b/service/cloudfront/api_op_CopyDistribution.go new file mode 100644 index 00000000000..02a854263c2 --- /dev/null +++ b/service/cloudfront/api_op_CopyDistribution.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a staging distribution using the configuration of the provided primary +// distribution. A staging distribution is a copy of an existing distribution +// (called the primary distribution) that you can use in a continuous deployment +// workflow. After you create a staging distribution, you can use +// UpdateDistribution to modify the staging distribution’s configuration. Then you +// can use CreateContinuousDeploymentPolicy to incrementally move traffic to the +// staging distribution. +func (c *Client) CopyDistribution(ctx context.Context, params *CopyDistributionInput, optFns ...func(*Options)) (*CopyDistributionOutput, error) { + if params == nil { + params = &CopyDistributionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CopyDistribution", params, optFns, c.addOperationCopyDistributionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CopyDistributionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CopyDistributionInput struct { + + // A value that uniquely identifies a request to create a resource. This helps to + // prevent CloudFront from creating a duplicate resource if you accidentally + // resubmit an identical request. + // + // This member is required. + CallerReference *string + + // The identifier of the primary distribution whose configuration you are copying. + // To get a distribution ID, use ListDistributions. + // + // This member is required. + PrimaryDistributionId *string + + // The version identifier of the primary distribution whose configuration you are + // copying. This is the ETag value returned in the response to GetDistribution and + // GetDistributionConfig. + IfMatch *string + + // The type of distribution that your primary distribution will be copied to. The + // only valid value is True, indicating that you are copying to a staging + // distribution. + Staging *bool + + noSmithyDocumentSerde +} + +type CopyDistributionOutput struct { + + // A distribution tells CloudFront where you want content to be delivered from, and + // the details about how to track and manage content delivery. + Distribution *types.Distribution + + // The version identifier for the current version of the staging distribution. + ETag *string + + // The URL of the staging distribution. + Location *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCopyDistributionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpCopyDistribution{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpCopyDistribution{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCopyDistributionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCopyDistribution(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCopyDistribution(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudfront", + OperationName: "CopyDistribution", + } +} diff --git a/service/cloudfront/api_op_CreateContinuousDeploymentPolicy.go b/service/cloudfront/api_op_CreateContinuousDeploymentPolicy.go new file mode 100644 index 00000000000..81f3363f8fd --- /dev/null +++ b/service/cloudfront/api_op_CreateContinuousDeploymentPolicy.go @@ -0,0 +1,135 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a continuous deployment policy that distributes traffic for a custom +// domain name to two different CloudFront distributions. To use a continuous +// deployment policy, first use CopyDistribution to create a staging distribution, +// then use UpdateDistribution to modify the staging distribution’s configuration. +// After you create and update a staging distribution, you can use a continuous +// deployment policy to incrementally move traffic to the staging distribution. +// This workflow enables you to test changes to a distribution’s configuration +// before moving all of your domain’s production traffic to the new configuration. +func (c *Client) CreateContinuousDeploymentPolicy(ctx context.Context, params *CreateContinuousDeploymentPolicyInput, optFns ...func(*Options)) (*CreateContinuousDeploymentPolicyOutput, error) { + if params == nil { + params = &CreateContinuousDeploymentPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateContinuousDeploymentPolicy", params, optFns, c.addOperationCreateContinuousDeploymentPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateContinuousDeploymentPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateContinuousDeploymentPolicyInput struct { + + // Contains the configuration for a continuous deployment policy. + // + // This member is required. + ContinuousDeploymentPolicyConfig *types.ContinuousDeploymentPolicyConfig + + noSmithyDocumentSerde +} + +type CreateContinuousDeploymentPolicyOutput struct { + + // A continuous deployment policy. + ContinuousDeploymentPolicy *types.ContinuousDeploymentPolicy + + // The version identifier for the current version of the continuous deployment + // policy. + ETag *string + + // The location of the continuous deployment policy. + Location *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateContinuousDeploymentPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpCreateContinuousDeploymentPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpCreateContinuousDeploymentPolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpCreateContinuousDeploymentPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateContinuousDeploymentPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateContinuousDeploymentPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudfront", + OperationName: "CreateContinuousDeploymentPolicy", + } +} diff --git a/service/cloudfront/api_op_CreateDistribution.go b/service/cloudfront/api_op_CreateDistribution.go index c8193c6cc1e..f038994e975 100644 --- a/service/cloudfront/api_op_CreateDistribution.go +++ b/service/cloudfront/api_op_CreateDistribution.go @@ -11,19 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates a new web distribution. You create a CloudFront distribution to tell -// CloudFront where you want content to be delivered from, and the details about -// how to track and manage content delivery. Send a POST request to the /CloudFront -// API version/distribution/distribution ID resource. When you update a -// distribution, there are more required fields than when you create a -// distribution. When you update your distribution by using UpdateDistribution -// (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_UpdateDistribution.html), -// follow the steps included in the documentation to get the current configuration -// and then make your updates. This helps to make sure that you include all of the -// required fields. To view a summary, see Required Fields for Create Distribution -// and Update Distribution -// (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-overview-required-fields.html) -// in the Amazon CloudFront Developer Guide. +// Creates a CloudFront distribution. func (c *Client) CreateDistribution(ctx context.Context, params *CreateDistributionInput, optFns ...func(*Options)) (*CreateDistributionOutput, error) { if params == nil { params = &CreateDistributionInput{} diff --git a/service/cloudfront/api_op_DeleteContinuousDeploymentPolicy.go b/service/cloudfront/api_op_DeleteContinuousDeploymentPolicy.go new file mode 100644 index 00000000000..dd1779ade75 --- /dev/null +++ b/service/cloudfront/api_op_DeleteContinuousDeploymentPolicy.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a continuous deployment policy. You cannot delete a continuous +// deployment policy that’s attached to a primary distribution. First update your +// distribution to remove the continuous deployment policy, then you can delete the +// policy. +func (c *Client) DeleteContinuousDeploymentPolicy(ctx context.Context, params *DeleteContinuousDeploymentPolicyInput, optFns ...func(*Options)) (*DeleteContinuousDeploymentPolicyOutput, error) { + if params == nil { + params = &DeleteContinuousDeploymentPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteContinuousDeploymentPolicy", params, optFns, c.addOperationDeleteContinuousDeploymentPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteContinuousDeploymentPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteContinuousDeploymentPolicyInput struct { + + // The identifier of the continuous deployment policy that you are deleting. + // + // This member is required. + Id *string + + // The current version (ETag value) of the continuous deployment policy that you + // are deleting. + IfMatch *string + + noSmithyDocumentSerde +} + +type DeleteContinuousDeploymentPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteContinuousDeploymentPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpDeleteContinuousDeploymentPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpDeleteContinuousDeploymentPolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteContinuousDeploymentPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteContinuousDeploymentPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteContinuousDeploymentPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudfront", + OperationName: "DeleteContinuousDeploymentPolicy", + } +} diff --git a/service/cloudfront/api_op_GetContinuousDeploymentPolicy.go b/service/cloudfront/api_op_GetContinuousDeploymentPolicy.go new file mode 100644 index 00000000000..02e3e78a2cb --- /dev/null +++ b/service/cloudfront/api_op_GetContinuousDeploymentPolicy.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets a continuous deployment policy, including metadata (the policy’s identifier +// and the date and time when the policy was last modified). +func (c *Client) GetContinuousDeploymentPolicy(ctx context.Context, params *GetContinuousDeploymentPolicyInput, optFns ...func(*Options)) (*GetContinuousDeploymentPolicyOutput, error) { + if params == nil { + params = &GetContinuousDeploymentPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetContinuousDeploymentPolicy", params, optFns, c.addOperationGetContinuousDeploymentPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetContinuousDeploymentPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetContinuousDeploymentPolicyInput struct { + + // The identifier of the continuous deployment policy that you are getting. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetContinuousDeploymentPolicyOutput struct { + + // A continuous deployment policy. + ContinuousDeploymentPolicy *types.ContinuousDeploymentPolicy + + // The version identifier for the current version of the continuous deployment + // policy. + ETag *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetContinuousDeploymentPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpGetContinuousDeploymentPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetContinuousDeploymentPolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetContinuousDeploymentPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContinuousDeploymentPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetContinuousDeploymentPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudfront", + OperationName: "GetContinuousDeploymentPolicy", + } +} diff --git a/service/cloudfront/api_op_GetContinuousDeploymentPolicyConfig.go b/service/cloudfront/api_op_GetContinuousDeploymentPolicyConfig.go new file mode 100644 index 00000000000..4257261411d --- /dev/null +++ b/service/cloudfront/api_op_GetContinuousDeploymentPolicyConfig.go @@ -0,0 +1,126 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets configuration information about a continuous deployment policy. +func (c *Client) GetContinuousDeploymentPolicyConfig(ctx context.Context, params *GetContinuousDeploymentPolicyConfigInput, optFns ...func(*Options)) (*GetContinuousDeploymentPolicyConfigOutput, error) { + if params == nil { + params = &GetContinuousDeploymentPolicyConfigInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetContinuousDeploymentPolicyConfig", params, optFns, c.addOperationGetContinuousDeploymentPolicyConfigMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetContinuousDeploymentPolicyConfigOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetContinuousDeploymentPolicyConfigInput struct { + + // The identifier of the continuous deployment policy whose configuration you are + // getting. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetContinuousDeploymentPolicyConfigOutput struct { + + // Contains the configuration for a continuous deployment policy. + ContinuousDeploymentPolicyConfig *types.ContinuousDeploymentPolicyConfig + + // The version identifier for the current version of the continuous deployment + // policy. + ETag *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetContinuousDeploymentPolicyConfigMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpGetContinuousDeploymentPolicyConfig{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpGetContinuousDeploymentPolicyConfig{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetContinuousDeploymentPolicyConfigValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetContinuousDeploymentPolicyConfig(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetContinuousDeploymentPolicyConfig(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudfront", + OperationName: "GetContinuousDeploymentPolicyConfig", + } +} diff --git a/service/cloudfront/api_op_ListContinuousDeploymentPolicies.go b/service/cloudfront/api_op_ListContinuousDeploymentPolicies.go new file mode 100644 index 00000000000..173b1947442 --- /dev/null +++ b/service/cloudfront/api_op_ListContinuousDeploymentPolicies.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Gets a list of the continuous deployment policies in your Amazon Web Services +// account. You can optionally specify the maximum number of items to receive in +// the response. If the total number of items in the list exceeds the maximum that +// you specify, or the default maximum, the response is paginated. To get the next +// page of items, send a subsequent request that specifies the NextMarker value +// from the current response as the Marker value in the subsequent request. +func (c *Client) ListContinuousDeploymentPolicies(ctx context.Context, params *ListContinuousDeploymentPoliciesInput, optFns ...func(*Options)) (*ListContinuousDeploymentPoliciesOutput, error) { + if params == nil { + params = &ListContinuousDeploymentPoliciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListContinuousDeploymentPolicies", params, optFns, c.addOperationListContinuousDeploymentPoliciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListContinuousDeploymentPoliciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListContinuousDeploymentPoliciesInput struct { + + // Use this field when paginating results to indicate where to begin in your list + // of continuous deployment policies. The response includes policies in the list + // that occur after the marker. To get the next page of the list, set this field’s + // value to the value of NextMarker from the current page’s response. + Marker *string + + // The maximum number of continuous deployment policies that you want returned in + // the response. + MaxItems *int32 + + noSmithyDocumentSerde +} + +type ListContinuousDeploymentPoliciesOutput struct { + + // A list of continuous deployment policies. + ContinuousDeploymentPolicyList *types.ContinuousDeploymentPolicyList + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListContinuousDeploymentPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpListContinuousDeploymentPolicies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpListContinuousDeploymentPolicies{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListContinuousDeploymentPolicies(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListContinuousDeploymentPolicies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudfront", + OperationName: "ListContinuousDeploymentPolicies", + } +} diff --git a/service/cloudfront/api_op_UpdateContinuousDeploymentPolicy.go b/service/cloudfront/api_op_UpdateContinuousDeploymentPolicy.go new file mode 100644 index 00000000000..3ef8681cfac --- /dev/null +++ b/service/cloudfront/api_op_UpdateContinuousDeploymentPolicy.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudfront + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/cloudfront/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a continuous deployment policy. You can update a continuous deployment +// policy to enable or disable it, to change the percentage of traffic that it +// sends to the staging distribution, or to change the staging distribution that it +// sends traffic to. When you update a continuous deployment policy configuration, +// all the fields are updated with the values that are provided in the request. You +// cannot update some fields independent of others. To update a continuous +// deployment policy configuration: +// +// * Use GetContinuousDeploymentPolicyConfig to +// get the current configuration. +// +// * Locally modify the fields in the continuous +// deployment policy configuration that you want to update. +// +// * Use +// UpdateContinuousDeploymentPolicy, providing the entire continuous deployment +// policy configuration, including the fields that you modified and those that you +// didn’t. +func (c *Client) UpdateContinuousDeploymentPolicy(ctx context.Context, params *UpdateContinuousDeploymentPolicyInput, optFns ...func(*Options)) (*UpdateContinuousDeploymentPolicyOutput, error) { + if params == nil { + params = &UpdateContinuousDeploymentPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateContinuousDeploymentPolicy", params, optFns, c.addOperationUpdateContinuousDeploymentPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateContinuousDeploymentPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateContinuousDeploymentPolicyInput struct { + + // The continuous deployment policy configuration. + // + // This member is required. + ContinuousDeploymentPolicyConfig *types.ContinuousDeploymentPolicyConfig + + // The identifier of the continuous deployment policy that you are updating. + // + // This member is required. + Id *string + + // The current version (ETag value) of the continuous deployment policy that you + // are updating. + IfMatch *string + + noSmithyDocumentSerde +} + +type UpdateContinuousDeploymentPolicyOutput struct { + + // A continuous deployment policy. + ContinuousDeploymentPolicy *types.ContinuousDeploymentPolicy + + // The version identifier for the current version of the continuous deployment + // policy. + ETag *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateContinuousDeploymentPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestxml_serializeOpUpdateContinuousDeploymentPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestxml_deserializeOpUpdateContinuousDeploymentPolicy{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateContinuousDeploymentPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateContinuousDeploymentPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateContinuousDeploymentPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "cloudfront", + OperationName: "UpdateContinuousDeploymentPolicy", + } +} diff --git a/service/cloudfront/api_op_UpdateDistribution.go b/service/cloudfront/api_op_UpdateDistribution.go index 117a4aa369d..8ce980d6a6f 100644 --- a/service/cloudfront/api_op_UpdateDistribution.go +++ b/service/cloudfront/api_op_UpdateDistribution.go @@ -11,84 +11,30 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the configuration for a web distribution. When you update a -// distribution, there are more required fields than when you create a -// distribution. When you update your distribution by using this API action, follow -// the steps here to get the current configuration and then make your updates, to -// make sure that you include all of the required fields. To view a summary, see -// Required Fields for Create Distribution and Update Distribution -// (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-overview-required-fields.html) -// in the Amazon CloudFront Developer Guide. The update process includes getting -// the current distribution configuration, updating the XML document that is -// returned to make your changes, and then submitting an UpdateDistribution request -// to make the updates. For information about updating a distribution using the -// CloudFront console instead, see Creating a Distribution -// (https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/distribution-web-creating-console.html) -// in the Amazon CloudFront Developer Guide. To update a web distribution using the -// CloudFront API -// -// * Submit a GetDistributionConfig -// (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_GetDistributionConfig.html) -// request to get the current configuration and an Etag header -// -// for the -// distribution. If you update the distribution again, you must get a new Etag -// header. -// -// * Update the XML document that was returned in the response to your -// GetDistributionConfig request to include your changes. When you edit the XML -// file, be aware of the following: -// -// * You must strip out the ETag parameter that -// is returned. -// -// * Additional fields are required when you update a distribution. -// There may be fields included in the XML file for features that you haven't -// configured for your distribution. This is expected and required to successfully -// update the distribution. -// -// * You can't change the value of CallerReference. If -// you try to change this value, CloudFront returns an -// -// IllegalUpdate error. -// -// * The -// new configuration replaces the existing configuration; the values that you -// specify in an UpdateDistribution request are not merged into your existing -// configuration. When you add, delete, or replace values in an element that allows -// multiple values (for example, CNAME), you must specify all of the values that -// you want to appear in the updated distribution. In addition, -// -// you must update -// the corresponding Quantity element. -// -// * Submit an UpdateDistribution request to -// update the configuration for your distribution: -// -// * In the request body, include -// the XML document that you updated in Step 2. The request body must include -// an -// -// XML document with a DistributionConfig element. -// -// * Set the value of the HTTP -// If-Match header to the value of the ETag header that CloudFront returned -// -// when -// you submitted the GetDistributionConfig request in Step 1. -// -// * Review the -// response to the UpdateDistribution request to confirm that the configuration -// was -// -// successfully updated. -// -// * Optional: Submit a GetDistribution -// (https://docs.aws.amazon.com/cloudfront/latest/APIReference/API_GetDistribution.html) -// request to confirm that your changes have propagated. -// -// When propagation is -// complete, the value of Status is Deployed. +// Updates the configuration for a CloudFront distribution. The update process +// includes getting the current distribution configuration, updating it to make +// your changes, and then submitting an UpdateDistribution request to make the +// updates. To update a web distribution using the CloudFront API +// +// * Use +// GetDistributionConfig to get the current configuration, including the version +// identifier (ETag). +// +// * Update the distribution configuration that was returned in +// the response. Note the following important requirements and restrictions: +// +// * You +// must rename the ETag field to IfMatch, leaving the value unchanged. (Set the +// value of IfMatch to the value of ETag, then remove the ETag field.) +// +// * You can’t +// change the value of CallerReference. +// +// * Submit an UpdateDistribution request, +// providing the distribution configuration. The new configuration replaces the +// existing configuration. The values that you specify in an UpdateDistribution +// request are not merged into your existing configuration. Make sure to include +// all fields: the ones that you modified and also the ones that you didn’t. func (c *Client) UpdateDistribution(ctx context.Context, params *UpdateDistributionInput, optFns ...func(*Options)) (*UpdateDistributionOutput, error) { if params == nil { params = &UpdateDistributionInput{} diff --git a/service/cloudfront/deserializers.go b/service/cloudfront/deserializers.go index 82cfc3d190b..392493d9b44 100644 --- a/service/cloudfront/deserializers.go +++ b/service/cloudfront/deserializers.go @@ -108,6 +108,351 @@ func awsRestxml_deserializeOpErrorAssociateAlias(response *smithyhttp.Response, } } +type awsRestxml_deserializeOpCopyDistribution struct { +} + +func (*awsRestxml_deserializeOpCopyDistribution) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpCopyDistribution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorCopyDistribution(response, &metadata) + } + output := &CopyDistributionOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsCopyDistributionOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentDistribution(&output.Distribution, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorCopyDistribution(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("CNAMEAlreadyExists", errorCode): + return awsRestxml_deserializeErrorCNAMEAlreadyExists(response, errorBody) + + case strings.EqualFold("DistributionAlreadyExists", errorCode): + return awsRestxml_deserializeErrorDistributionAlreadyExists(response, errorBody) + + case strings.EqualFold("IllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior", errorCode): + return awsRestxml_deserializeErrorIllegalFieldLevelEncryptionConfigAssociationWithCacheBehavior(response, errorBody) + + case strings.EqualFold("InconsistentQuantities", errorCode): + return awsRestxml_deserializeErrorInconsistentQuantities(response, errorBody) + + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("InvalidDefaultRootObject", errorCode): + return awsRestxml_deserializeErrorInvalidDefaultRootObject(response, errorBody) + + case strings.EqualFold("InvalidErrorCode", errorCode): + return awsRestxml_deserializeErrorInvalidErrorCode(response, errorBody) + + case strings.EqualFold("InvalidForwardCookies", errorCode): + return awsRestxml_deserializeErrorInvalidForwardCookies(response, errorBody) + + case strings.EqualFold("InvalidFunctionAssociation", errorCode): + return awsRestxml_deserializeErrorInvalidFunctionAssociation(response, errorBody) + + case strings.EqualFold("InvalidGeoRestrictionParameter", errorCode): + return awsRestxml_deserializeErrorInvalidGeoRestrictionParameter(response, errorBody) + + case strings.EqualFold("InvalidHeadersForS3Origin", errorCode): + return awsRestxml_deserializeErrorInvalidHeadersForS3Origin(response, errorBody) + + case strings.EqualFold("InvalidIfMatchVersion", errorCode): + return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) + + case strings.EqualFold("InvalidLambdaFunctionAssociation", errorCode): + return awsRestxml_deserializeErrorInvalidLambdaFunctionAssociation(response, errorBody) + + case strings.EqualFold("InvalidLocationCode", errorCode): + return awsRestxml_deserializeErrorInvalidLocationCode(response, errorBody) + + case strings.EqualFold("InvalidMinimumProtocolVersion", errorCode): + return awsRestxml_deserializeErrorInvalidMinimumProtocolVersion(response, errorBody) + + case strings.EqualFold("InvalidOrigin", errorCode): + return awsRestxml_deserializeErrorInvalidOrigin(response, errorBody) + + case strings.EqualFold("InvalidOriginAccessControl", errorCode): + return awsRestxml_deserializeErrorInvalidOriginAccessControl(response, errorBody) + + case strings.EqualFold("InvalidOriginAccessIdentity", errorCode): + return awsRestxml_deserializeErrorInvalidOriginAccessIdentity(response, errorBody) + + case strings.EqualFold("InvalidOriginKeepaliveTimeout", errorCode): + return awsRestxml_deserializeErrorInvalidOriginKeepaliveTimeout(response, errorBody) + + case strings.EqualFold("InvalidOriginReadTimeout", errorCode): + return awsRestxml_deserializeErrorInvalidOriginReadTimeout(response, errorBody) + + case strings.EqualFold("InvalidProtocolSettings", errorCode): + return awsRestxml_deserializeErrorInvalidProtocolSettings(response, errorBody) + + case strings.EqualFold("InvalidQueryStringParameters", errorCode): + return awsRestxml_deserializeErrorInvalidQueryStringParameters(response, errorBody) + + case strings.EqualFold("InvalidRelativePath", errorCode): + return awsRestxml_deserializeErrorInvalidRelativePath(response, errorBody) + + case strings.EqualFold("InvalidRequiredProtocol", errorCode): + return awsRestxml_deserializeErrorInvalidRequiredProtocol(response, errorBody) + + case strings.EqualFold("InvalidResponseCode", errorCode): + return awsRestxml_deserializeErrorInvalidResponseCode(response, errorBody) + + case strings.EqualFold("InvalidTTLOrder", errorCode): + return awsRestxml_deserializeErrorInvalidTTLOrder(response, errorBody) + + case strings.EqualFold("InvalidViewerCertificate", errorCode): + return awsRestxml_deserializeErrorInvalidViewerCertificate(response, errorBody) + + case strings.EqualFold("InvalidWebACLId", errorCode): + return awsRestxml_deserializeErrorInvalidWebACLId(response, errorBody) + + case strings.EqualFold("MissingBody", errorCode): + return awsRestxml_deserializeErrorMissingBody(response, errorBody) + + case strings.EqualFold("NoSuchCachePolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + + case strings.EqualFold("NoSuchDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) + + case strings.EqualFold("NoSuchFieldLevelEncryptionConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionConfig(response, errorBody) + + case strings.EqualFold("NoSuchOrigin", errorCode): + return awsRestxml_deserializeErrorNoSuchOrigin(response, errorBody) + + case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + + case strings.EqualFold("NoSuchRealtimeLogConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchRealtimeLogConfig(response, errorBody) + + case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) + + case strings.EqualFold("PreconditionFailed", errorCode): + return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) + + case strings.EqualFold("RealtimeLogConfigOwnerMismatch", errorCode): + return awsRestxml_deserializeErrorRealtimeLogConfigOwnerMismatch(response, errorBody) + + case strings.EqualFold("TooManyCacheBehaviors", errorCode): + return awsRestxml_deserializeErrorTooManyCacheBehaviors(response, errorBody) + + case strings.EqualFold("TooManyCertificates", errorCode): + return awsRestxml_deserializeErrorTooManyCertificates(response, errorBody) + + case strings.EqualFold("TooManyCookieNamesInWhiteList", errorCode): + return awsRestxml_deserializeErrorTooManyCookieNamesInWhiteList(response, errorBody) + + case strings.EqualFold("TooManyDistributionCNAMEs", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionCNAMEs(response, errorBody) + + case strings.EqualFold("TooManyDistributions", errorCode): + return awsRestxml_deserializeErrorTooManyDistributions(response, errorBody) + + case strings.EqualFold("TooManyDistributionsAssociatedToCachePolicy", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionsAssociatedToCachePolicy(response, errorBody) + + case strings.EqualFold("TooManyDistributionsAssociatedToFieldLevelEncryptionConfig", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionsAssociatedToFieldLevelEncryptionConfig(response, errorBody) + + case strings.EqualFold("TooManyDistributionsAssociatedToKeyGroup", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionsAssociatedToKeyGroup(response, errorBody) + + case strings.EqualFold("TooManyDistributionsAssociatedToOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionsAssociatedToOriginRequestPolicy(response, errorBody) + + case strings.EqualFold("TooManyDistributionsAssociatedToResponseHeadersPolicy", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionsAssociatedToResponseHeadersPolicy(response, errorBody) + + case strings.EqualFold("TooManyDistributionsWithFunctionAssociations", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionsWithFunctionAssociations(response, errorBody) + + case strings.EqualFold("TooManyDistributionsWithLambdaAssociations", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionsWithLambdaAssociations(response, errorBody) + + case strings.EqualFold("TooManyDistributionsWithSingleFunctionARN", errorCode): + return awsRestxml_deserializeErrorTooManyDistributionsWithSingleFunctionARN(response, errorBody) + + case strings.EqualFold("TooManyFunctionAssociations", errorCode): + return awsRestxml_deserializeErrorTooManyFunctionAssociations(response, errorBody) + + case strings.EqualFold("TooManyHeadersInForwardedValues", errorCode): + return awsRestxml_deserializeErrorTooManyHeadersInForwardedValues(response, errorBody) + + case strings.EqualFold("TooManyKeyGroupsAssociatedToDistribution", errorCode): + return awsRestxml_deserializeErrorTooManyKeyGroupsAssociatedToDistribution(response, errorBody) + + case strings.EqualFold("TooManyLambdaFunctionAssociations", errorCode): + return awsRestxml_deserializeErrorTooManyLambdaFunctionAssociations(response, errorBody) + + case strings.EqualFold("TooManyOriginCustomHeaders", errorCode): + return awsRestxml_deserializeErrorTooManyOriginCustomHeaders(response, errorBody) + + case strings.EqualFold("TooManyOriginGroupsPerDistribution", errorCode): + return awsRestxml_deserializeErrorTooManyOriginGroupsPerDistribution(response, errorBody) + + case strings.EqualFold("TooManyOrigins", errorCode): + return awsRestxml_deserializeErrorTooManyOrigins(response, errorBody) + + case strings.EqualFold("TooManyQueryStringParameters", errorCode): + return awsRestxml_deserializeErrorTooManyQueryStringParameters(response, errorBody) + + case strings.EqualFold("TooManyTrustedSigners", errorCode): + return awsRestxml_deserializeErrorTooManyTrustedSigners(response, errorBody) + + case strings.EqualFold("TrustedKeyGroupDoesNotExist", errorCode): + return awsRestxml_deserializeErrorTrustedKeyGroupDoesNotExist(response, errorBody) + + case strings.EqualFold("TrustedSignerDoesNotExist", errorCode): + return awsRestxml_deserializeErrorTrustedSignerDoesNotExist(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsCopyDistributionOutput(v *CopyDistributionOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Location"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.Location = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentCopyDistributionOutput(v **CopyDistributionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CopyDistributionOutput + if *v == nil { + sv = &CopyDistributionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Distribution", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentDistribution(&sv.Distribution, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + type awsRestxml_deserializeOpCreateCachePolicy struct { } @@ -459,6 +804,174 @@ func awsRestxml_deserializeOpDocumentCreateCloudFrontOriginAccessIdentityOutput( return nil } +type awsRestxml_deserializeOpCreateContinuousDeploymentPolicy struct { +} + +func (*awsRestxml_deserializeOpCreateContinuousDeploymentPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpCreateContinuousDeploymentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorCreateContinuousDeploymentPolicy(response, &metadata) + } + output := &CreateContinuousDeploymentPolicyOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsCreateContinuousDeploymentPolicyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentContinuousDeploymentPolicy(&output.ContinuousDeploymentPolicy, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorCreateContinuousDeploymentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("InconsistentQuantities", errorCode): + return awsRestxml_deserializeErrorInconsistentQuantities(response, errorBody) + + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("StagingDistributionInUse", errorCode): + return awsRestxml_deserializeErrorStagingDistributionInUse(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsCreateContinuousDeploymentPolicyOutput(v *CreateContinuousDeploymentPolicyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("Location"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.Location = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentCreateContinuousDeploymentPolicyOutput(v **CreateContinuousDeploymentPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *CreateContinuousDeploymentPolicyOutput + if *v == nil { + sv = &CreateContinuousDeploymentPolicyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ContinuousDeploymentPolicy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicy(&sv.ContinuousDeploymentPolicy, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + type awsRestxml_deserializeOpCreateDistribution struct { } @@ -3562,6 +4075,88 @@ func awsRestxml_deserializeOpErrorDeleteCloudFrontOriginAccessIdentity(response } } +type awsRestxml_deserializeOpDeleteContinuousDeploymentPolicy struct { +} + +func (*awsRestxml_deserializeOpDeleteContinuousDeploymentPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpDeleteContinuousDeploymentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorDeleteContinuousDeploymentPolicy(response, &metadata) + } + output := &DeleteContinuousDeploymentPolicyOutput{} + 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 awsRestxml_deserializeOpErrorDeleteContinuousDeploymentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("InvalidIfMatchVersion", errorCode): + return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) + + case strings.EqualFold("PreconditionFailed", errorCode): + return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestxml_deserializeOpDeleteDistribution struct { } @@ -4779,7 +5374,635 @@ func (m *awsRestxml_deserializeOpGetCachePolicy) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCachePolicy(&output.CachePolicy, decoder) + err = awsRestxml_deserializeDocumentCachePolicy(&output.CachePolicy, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetCachePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("NoSuchCachePolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsGetCachePolicyOutput(v *GetCachePolicyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetCachePolicyOutput(v **GetCachePolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetCachePolicyOutput + if *v == nil { + sv = &GetCachePolicyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CachePolicy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentCachePolicy(&sv.CachePolicy, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpGetCachePolicyConfig struct { +} + +func (*awsRestxml_deserializeOpGetCachePolicyConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetCachePolicyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorGetCachePolicyConfig(response, &metadata) + } + output := &GetCachePolicyConfigOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsGetCachePolicyConfigOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentCachePolicyConfig(&output.CachePolicyConfig, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetCachePolicyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("NoSuchCachePolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsGetCachePolicyConfigOutput(v *GetCachePolicyConfigOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetCachePolicyConfigOutput(v **GetCachePolicyConfigOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetCachePolicyConfigOutput + if *v == nil { + sv = &GetCachePolicyConfigOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CachePolicyConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentCachePolicyConfig(&sv.CachePolicyConfig, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity struct { +} + +func (*awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentity(response, &metadata) + } + output := &GetCloudFrontOriginAccessIdentityOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(&output.CloudFrontOriginAccessIdentity, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("NoSuchCloudFrontOriginAccessIdentity", errorCode): + return awsRestxml_deserializeErrorNoSuchCloudFrontOriginAccessIdentity(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityOutput(v *GetCloudFrontOriginAccessIdentityOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetCloudFrontOriginAccessIdentityOutput(v **GetCloudFrontOriginAccessIdentityOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetCloudFrontOriginAccessIdentityOutput + if *v == nil { + sv = &GetCloudFrontOriginAccessIdentityOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CloudFrontOriginAccessIdentity", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(&sv.CloudFrontOriginAccessIdentity, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig struct { +} + +func (*awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentityConfig(response, &metadata) + } + output := &GetCloudFrontOriginAccessIdentityConfigOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityConfigOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentityConfig(&output.CloudFrontOriginAccessIdentityConfig, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentityConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("NoSuchCloudFrontOriginAccessIdentity", errorCode): + return awsRestxml_deserializeErrorNoSuchCloudFrontOriginAccessIdentity(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityConfigOutput(v *GetCloudFrontOriginAccessIdentityConfigOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetCloudFrontOriginAccessIdentityConfigOutput(v **GetCloudFrontOriginAccessIdentityConfigOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetCloudFrontOriginAccessIdentityConfigOutput + if *v == nil { + sv = &GetCloudFrontOriginAccessIdentityConfigOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("CloudFrontOriginAccessIdentityConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentityConfig(&sv.CloudFrontOriginAccessIdentityConfig, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpGetContinuousDeploymentPolicy struct { +} + +func (*awsRestxml_deserializeOpGetContinuousDeploymentPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetContinuousDeploymentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorGetContinuousDeploymentPolicy(response, &metadata) + } + output := &GetContinuousDeploymentPolicyOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsGetContinuousDeploymentPolicyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentContinuousDeploymentPolicy(&output.ContinuousDeploymentPolicy, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4792,7 +6015,7 @@ func (m *awsRestxml_deserializeOpGetCachePolicy) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestxml_deserializeOpErrorGetCachePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetContinuousDeploymentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4820,8 +6043,159 @@ func awsRestxml_deserializeOpErrorGetCachePolicy(response *smithyhttp.Response, case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchCachePolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsGetContinuousDeploymentPolicyOutput(v *GetContinuousDeploymentPolicyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetContinuousDeploymentPolicyOutput(v **GetContinuousDeploymentPolicyOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *GetContinuousDeploymentPolicyOutput + if *v == nil { + sv = &GetContinuousDeploymentPolicyOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ContinuousDeploymentPolicy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicy(&sv.ContinuousDeploymentPolicy, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +type awsRestxml_deserializeOpGetContinuousDeploymentPolicyConfig struct { +} + +func (*awsRestxml_deserializeOpGetContinuousDeploymentPolicyConfig) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetContinuousDeploymentPolicyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorGetContinuousDeploymentPolicyConfig(response, &metadata) + } + output := &GetContinuousDeploymentPolicyConfigOutput{} + out.Result = output + + err = awsRestxml_deserializeOpHttpBindingsGetContinuousDeploymentPolicyConfigOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentContinuousDeploymentPolicyConfig(&output.ContinuousDeploymentPolicyConfig, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetContinuousDeploymentPolicyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4833,7 +6207,7 @@ func awsRestxml_deserializeOpErrorGetCachePolicy(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpHttpBindingsGetCachePolicyOutput(v *GetCachePolicyOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetContinuousDeploymentPolicyConfigOutput(v *GetContinuousDeploymentPolicyConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -4845,13 +6219,13 @@ func awsRestxml_deserializeOpHttpBindingsGetCachePolicyOutput(v *GetCachePolicyO return nil } -func awsRestxml_deserializeOpDocumentGetCachePolicyOutput(v **GetCachePolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetContinuousDeploymentPolicyConfigOutput(v **GetContinuousDeploymentPolicyConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetCachePolicyOutput + var sv *GetContinuousDeploymentPolicyConfigOutput if *v == nil { - sv = &GetCachePolicyOutput{} + sv = &GetContinuousDeploymentPolicyConfigOutput{} } else { sv = *v } @@ -4867,9 +6241,9 @@ func awsRestxml_deserializeOpDocumentGetCachePolicyOutput(v **GetCachePolicyOutp originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CachePolicy", t.Name.Local): + case strings.EqualFold("ContinuousDeploymentPolicyConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCachePolicy(&sv.CachePolicy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicyConfig(&sv.ContinuousDeploymentPolicyConfig, nodeDecoder); err != nil { return err } @@ -4887,14 +6261,14 @@ func awsRestxml_deserializeOpDocumentGetCachePolicyOutput(v **GetCachePolicyOutp return nil } -type awsRestxml_deserializeOpGetCachePolicyConfig struct { +type awsRestxml_deserializeOpGetDistribution struct { } -func (*awsRestxml_deserializeOpGetCachePolicyConfig) ID() string { +func (*awsRestxml_deserializeOpGetDistribution) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetCachePolicyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetDistribution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4908,12 +6282,12 @@ func (m *awsRestxml_deserializeOpGetCachePolicyConfig) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetCachePolicyConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetDistribution(response, &metadata) } - output := &GetCachePolicyConfigOutput{} + output := &GetDistributionOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetCachePolicyConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetDistributionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -4936,7 +6310,7 @@ func (m *awsRestxml_deserializeOpGetCachePolicyConfig) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCachePolicyConfig(&output.CachePolicyConfig, decoder) + err = awsRestxml_deserializeDocumentDistribution(&output.Distribution, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4949,7 +6323,7 @@ func (m *awsRestxml_deserializeOpGetCachePolicyConfig) HandleDeserialize(ctx con return out, metadata, err } -func awsRestxml_deserializeOpErrorGetCachePolicyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetDistribution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4977,8 +6351,8 @@ func awsRestxml_deserializeOpErrorGetCachePolicyConfig(response *smithyhttp.Resp case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchCachePolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + case strings.EqualFold("NoSuchDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4990,7 +6364,7 @@ func awsRestxml_deserializeOpErrorGetCachePolicyConfig(response *smithyhttp.Resp } } -func awsRestxml_deserializeOpHttpBindingsGetCachePolicyConfigOutput(v *GetCachePolicyConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetDistributionOutput(v *GetDistributionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -5002,13 +6376,13 @@ func awsRestxml_deserializeOpHttpBindingsGetCachePolicyConfigOutput(v *GetCacheP return nil } -func awsRestxml_deserializeOpDocumentGetCachePolicyConfigOutput(v **GetCachePolicyConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetDistributionOutput(v **GetDistributionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetCachePolicyConfigOutput + var sv *GetDistributionOutput if *v == nil { - sv = &GetCachePolicyConfigOutput{} + sv = &GetDistributionOutput{} } else { sv = *v } @@ -5024,9 +6398,9 @@ func awsRestxml_deserializeOpDocumentGetCachePolicyConfigOutput(v **GetCachePoli originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CachePolicyConfig", t.Name.Local): + case strings.EqualFold("Distribution", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCachePolicyConfig(&sv.CachePolicyConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentDistribution(&sv.Distribution, nodeDecoder); err != nil { return err } @@ -5044,14 +6418,14 @@ func awsRestxml_deserializeOpDocumentGetCachePolicyConfigOutput(v **GetCachePoli return nil } -type awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity struct { +type awsRestxml_deserializeOpGetDistributionConfig struct { } -func (*awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity) ID() string { +func (*awsRestxml_deserializeOpGetDistributionConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetDistributionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5065,12 +6439,12 @@ func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentity(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetDistributionConfig(response, &metadata) } - output := &GetCloudFrontOriginAccessIdentityOutput{} + output := &GetDistributionConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetDistributionConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -5093,7 +6467,7 @@ func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity) HandleDeseri } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(&output.CloudFrontOriginAccessIdentity, decoder) + err = awsRestxml_deserializeDocumentDistributionConfig(&output.DistributionConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5106,7 +6480,7 @@ func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentity) HandleDeseri return out, metadata, err } -func awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetDistributionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5134,8 +6508,8 @@ func awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentity(response *sm case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchCloudFrontOriginAccessIdentity", errorCode): - return awsRestxml_deserializeErrorNoSuchCloudFrontOriginAccessIdentity(response, errorBody) + case strings.EqualFold("NoSuchDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5147,7 +6521,7 @@ func awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentity(response *sm } } -func awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityOutput(v *GetCloudFrontOriginAccessIdentityOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetDistributionConfigOutput(v *GetDistributionConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -5159,13 +6533,13 @@ func awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityOutput return nil } -func awsRestxml_deserializeOpDocumentGetCloudFrontOriginAccessIdentityOutput(v **GetCloudFrontOriginAccessIdentityOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetDistributionConfigOutput(v **GetDistributionConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetCloudFrontOriginAccessIdentityOutput + var sv *GetDistributionConfigOutput if *v == nil { - sv = &GetCloudFrontOriginAccessIdentityOutput{} + sv = &GetDistributionConfigOutput{} } else { sv = *v } @@ -5181,9 +6555,9 @@ func awsRestxml_deserializeOpDocumentGetCloudFrontOriginAccessIdentityOutput(v * originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CloudFrontOriginAccessIdentity", t.Name.Local): + case strings.EqualFold("DistributionConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(&sv.CloudFrontOriginAccessIdentity, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentDistributionConfig(&sv.DistributionConfig, nodeDecoder); err != nil { return err } @@ -5201,14 +6575,14 @@ func awsRestxml_deserializeOpDocumentGetCloudFrontOriginAccessIdentityOutput(v * return nil } -type awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig struct { +type awsRestxml_deserializeOpGetFieldLevelEncryption struct { } -func (*awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig) ID() string { +func (*awsRestxml_deserializeOpGetFieldLevelEncryption) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetFieldLevelEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5222,12 +6596,12 @@ func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentityConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetFieldLevelEncryption(response, &metadata) } - output := &GetCloudFrontOriginAccessIdentityConfigOutput{} + output := &GetFieldLevelEncryptionOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -5250,7 +6624,7 @@ func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig) Handle } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentityConfig(&output.CloudFrontOriginAccessIdentityConfig, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryption(&output.FieldLevelEncryption, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5263,7 +6637,7 @@ func (m *awsRestxml_deserializeOpGetCloudFrontOriginAccessIdentityConfig) Handle return out, metadata, err } -func awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentityConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetFieldLevelEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5291,8 +6665,8 @@ func awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentityConfig(respon case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchCloudFrontOriginAccessIdentity", errorCode): - return awsRestxml_deserializeErrorNoSuchCloudFrontOriginAccessIdentity(response, errorBody) + case strings.EqualFold("NoSuchFieldLevelEncryptionConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionConfig(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5304,7 +6678,7 @@ func awsRestxml_deserializeOpErrorGetCloudFrontOriginAccessIdentityConfig(respon } } -func awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityConfigOutput(v *GetCloudFrontOriginAccessIdentityConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionOutput(v *GetFieldLevelEncryptionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -5316,13 +6690,13 @@ func awsRestxml_deserializeOpHttpBindingsGetCloudFrontOriginAccessIdentityConfig return nil } -func awsRestxml_deserializeOpDocumentGetCloudFrontOriginAccessIdentityConfigOutput(v **GetCloudFrontOriginAccessIdentityConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionOutput(v **GetFieldLevelEncryptionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetCloudFrontOriginAccessIdentityConfigOutput + var sv *GetFieldLevelEncryptionOutput if *v == nil { - sv = &GetCloudFrontOriginAccessIdentityConfigOutput{} + sv = &GetFieldLevelEncryptionOutput{} } else { sv = *v } @@ -5338,9 +6712,9 @@ func awsRestxml_deserializeOpDocumentGetCloudFrontOriginAccessIdentityConfigOutp originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CloudFrontOriginAccessIdentityConfig", t.Name.Local): + case strings.EqualFold("FieldLevelEncryption", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentityConfig(&sv.CloudFrontOriginAccessIdentityConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentFieldLevelEncryption(&sv.FieldLevelEncryption, nodeDecoder); err != nil { return err } @@ -5358,14 +6732,14 @@ func awsRestxml_deserializeOpDocumentGetCloudFrontOriginAccessIdentityConfigOutp return nil } -type awsRestxml_deserializeOpGetDistribution struct { +type awsRestxml_deserializeOpGetFieldLevelEncryptionConfig struct { } -func (*awsRestxml_deserializeOpGetDistribution) ID() string { +func (*awsRestxml_deserializeOpGetFieldLevelEncryptionConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetDistribution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5379,12 +6753,12 @@ func (m *awsRestxml_deserializeOpGetDistribution) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetDistribution(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetFieldLevelEncryptionConfig(response, &metadata) } - output := &GetDistributionOutput{} + output := &GetFieldLevelEncryptionConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetDistributionOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -5407,7 +6781,7 @@ func (m *awsRestxml_deserializeOpGetDistribution) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentDistribution(&output.Distribution, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionConfig(&output.FieldLevelEncryptionConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5420,7 +6794,7 @@ func (m *awsRestxml_deserializeOpGetDistribution) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestxml_deserializeOpErrorGetDistribution(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5448,8 +6822,8 @@ func awsRestxml_deserializeOpErrorGetDistribution(response *smithyhttp.Response, case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchDistribution", errorCode): - return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) + case strings.EqualFold("NoSuchFieldLevelEncryptionConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionConfig(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5461,7 +6835,7 @@ func awsRestxml_deserializeOpErrorGetDistribution(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpHttpBindingsGetDistributionOutput(v *GetDistributionOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionConfigOutput(v *GetFieldLevelEncryptionConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -5473,13 +6847,13 @@ func awsRestxml_deserializeOpHttpBindingsGetDistributionOutput(v *GetDistributio return nil } -func awsRestxml_deserializeOpDocumentGetDistributionOutput(v **GetDistributionOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionConfigOutput(v **GetFieldLevelEncryptionConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetDistributionOutput + var sv *GetFieldLevelEncryptionConfigOutput if *v == nil { - sv = &GetDistributionOutput{} + sv = &GetFieldLevelEncryptionConfigOutput{} } else { sv = *v } @@ -5495,9 +6869,9 @@ func awsRestxml_deserializeOpDocumentGetDistributionOutput(v **GetDistributionOu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Distribution", t.Name.Local): + case strings.EqualFold("FieldLevelEncryptionConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDistribution(&sv.Distribution, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentFieldLevelEncryptionConfig(&sv.FieldLevelEncryptionConfig, nodeDecoder); err != nil { return err } @@ -5515,14 +6889,14 @@ func awsRestxml_deserializeOpDocumentGetDistributionOutput(v **GetDistributionOu return nil } -type awsRestxml_deserializeOpGetDistributionConfig struct { +type awsRestxml_deserializeOpGetFieldLevelEncryptionProfile struct { } -func (*awsRestxml_deserializeOpGetDistributionConfig) ID() string { +func (*awsRestxml_deserializeOpGetFieldLevelEncryptionProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetDistributionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5536,12 +6910,12 @@ func (m *awsRestxml_deserializeOpGetDistributionConfig) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetDistributionConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfile(response, &metadata) } - output := &GetDistributionConfigOutput{} + output := &GetFieldLevelEncryptionProfileOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetDistributionConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -5564,7 +6938,7 @@ func (m *awsRestxml_deserializeOpGetDistributionConfig) HandleDeserialize(ctx co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentDistributionConfig(&output.DistributionConfig, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfile(&output.FieldLevelEncryptionProfile, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5577,7 +6951,7 @@ func (m *awsRestxml_deserializeOpGetDistributionConfig) HandleDeserialize(ctx co return out, metadata, err } -func awsRestxml_deserializeOpErrorGetDistributionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5605,8 +6979,8 @@ func awsRestxml_deserializeOpErrorGetDistributionConfig(response *smithyhttp.Res case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchDistribution", errorCode): - return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) + case strings.EqualFold("NoSuchFieldLevelEncryptionProfile", errorCode): + return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionProfile(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5618,7 +6992,7 @@ func awsRestxml_deserializeOpErrorGetDistributionConfig(response *smithyhttp.Res } } -func awsRestxml_deserializeOpHttpBindingsGetDistributionConfigOutput(v *GetDistributionConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileOutput(v *GetFieldLevelEncryptionProfileOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -5630,13 +7004,13 @@ func awsRestxml_deserializeOpHttpBindingsGetDistributionConfigOutput(v *GetDistr return nil } -func awsRestxml_deserializeOpDocumentGetDistributionConfigOutput(v **GetDistributionConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionProfileOutput(v **GetFieldLevelEncryptionProfileOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetDistributionConfigOutput + var sv *GetFieldLevelEncryptionProfileOutput if *v == nil { - sv = &GetDistributionConfigOutput{} + sv = &GetFieldLevelEncryptionProfileOutput{} } else { sv = *v } @@ -5652,9 +7026,9 @@ func awsRestxml_deserializeOpDocumentGetDistributionConfigOutput(v **GetDistribu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DistributionConfig", t.Name.Local): + case strings.EqualFold("FieldLevelEncryptionProfile", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDistributionConfig(&sv.DistributionConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentFieldLevelEncryptionProfile(&sv.FieldLevelEncryptionProfile, nodeDecoder); err != nil { return err } @@ -5672,14 +7046,14 @@ func awsRestxml_deserializeOpDocumentGetDistributionConfigOutput(v **GetDistribu return nil } -type awsRestxml_deserializeOpGetFieldLevelEncryption struct { +type awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig struct { } -func (*awsRestxml_deserializeOpGetFieldLevelEncryption) ID() string { +func (*awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetFieldLevelEncryption) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5693,12 +7067,12 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryption) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetFieldLevelEncryption(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfileConfig(response, &metadata) } - output := &GetFieldLevelEncryptionOutput{} + output := &GetFieldLevelEncryptionProfileConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -5721,7 +7095,7 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryption) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryption(&output.FieldLevelEncryption, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileConfig(&output.FieldLevelEncryptionProfileConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5734,7 +7108,7 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryption) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorGetFieldLevelEncryption(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfileConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5762,8 +7136,8 @@ func awsRestxml_deserializeOpErrorGetFieldLevelEncryption(response *smithyhttp.R case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchFieldLevelEncryptionConfig", errorCode): - return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionConfig(response, errorBody) + case strings.EqualFold("NoSuchFieldLevelEncryptionProfile", errorCode): + return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionProfile(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5775,7 +7149,7 @@ func awsRestxml_deserializeOpErrorGetFieldLevelEncryption(response *smithyhttp.R } } -func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionOutput(v *GetFieldLevelEncryptionOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileConfigOutput(v *GetFieldLevelEncryptionProfileConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -5787,13 +7161,13 @@ func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionOutput(v *GetFie return nil } -func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionOutput(v **GetFieldLevelEncryptionOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionProfileConfigOutput(v **GetFieldLevelEncryptionProfileConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetFieldLevelEncryptionOutput + var sv *GetFieldLevelEncryptionProfileConfigOutput if *v == nil { - sv = &GetFieldLevelEncryptionOutput{} + sv = &GetFieldLevelEncryptionProfileConfigOutput{} } else { sv = *v } @@ -5809,9 +7183,9 @@ func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionOutput(v **GetFieldL originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FieldLevelEncryption", t.Name.Local): + case strings.EqualFold("FieldLevelEncryptionProfileConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFieldLevelEncryption(&sv.FieldLevelEncryption, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentFieldLevelEncryptionProfileConfig(&sv.FieldLevelEncryptionProfileConfig, nodeDecoder); err != nil { return err } @@ -5829,14 +7203,14 @@ func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionOutput(v **GetFieldL return nil } -type awsRestxml_deserializeOpGetFieldLevelEncryptionConfig struct { +type awsRestxml_deserializeOpGetFunction struct { } -func (*awsRestxml_deserializeOpGetFieldLevelEncryptionConfig) ID() string { +func (*awsRestxml_deserializeOpGetFunction) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5850,16 +7224,129 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionConfig) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetFieldLevelEncryptionConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetFunction(response, &metadata) } - output := &GetFieldLevelEncryptionConfigOutput{} + output := &GetFunctionOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetFunctionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } + err = awsRestxml_deserializeOpDocumentGetFunctionOutput(output, response.Body, response.ContentLength) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + } + + return out, metadata, err +} + +func awsRestxml_deserializeOpErrorGetFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &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("NoSuchFunctionExists", errorCode): + return awsRestxml_deserializeErrorNoSuchFunctionExists(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsRestxml_deserializeErrorUnsupportedOperation(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestxml_deserializeOpHttpBindingsGetFunctionOutput(v *GetFunctionOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ContentType = ptr.String(headerValues[0]) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetFunctionOutput(v *GetFunctionOutput, body io.ReadCloser, contentLength int64) error { + if v == nil { + return fmt.Errorf("unsupported deserialization of nil %T", v) + } + var buf bytes.Buffer + if contentLength > 0 { + buf.Grow(int(contentLength)) + } else { + buf.Grow(512) + } + + _, err := buf.ReadFrom(body) + if err != nil { + return err + } + if buf.Len() > 0 { + v.FunctionCode = buf.Bytes() + } + return nil +} + +type awsRestxml_deserializeOpGetInvalidation struct { +} + +func (*awsRestxml_deserializeOpGetInvalidation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestxml_deserializeOpGetInvalidation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestxml_deserializeOpErrorGetInvalidation(response, &metadata) + } + output := &GetInvalidationOutput{} + out.Result = output + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -5878,7 +7365,7 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionConfig) HandleDeserializ } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionConfig(&output.FieldLevelEncryptionConfig, decoder) + err = awsRestxml_deserializeDocumentInvalidation(&output.Invalidation, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5891,7 +7378,7 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionConfig) HandleDeserializ return out, metadata, err } -func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetInvalidation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5919,8 +7406,11 @@ func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionConfig(response *smithy case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchFieldLevelEncryptionConfig", errorCode): - return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionConfig(response, errorBody) + case strings.EqualFold("NoSuchDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) + + case strings.EqualFold("NoSuchInvalidation", errorCode): + return awsRestxml_deserializeErrorNoSuchInvalidation(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -5932,25 +7422,13 @@ func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionConfig(response *smithy } } -func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionConfigOutput(v *GetFieldLevelEncryptionConfigOutput, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } - - if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ETag = ptr.String(headerValues[0]) - } - - return nil -} -func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionConfigOutput(v **GetFieldLevelEncryptionConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetInvalidationOutput(v **GetInvalidationOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetFieldLevelEncryptionConfigOutput + var sv *GetInvalidationOutput if *v == nil { - sv = &GetFieldLevelEncryptionConfigOutput{} + sv = &GetInvalidationOutput{} } else { sv = *v } @@ -5966,9 +7444,9 @@ func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionConfigOutput(v **Get originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FieldLevelEncryptionConfig", t.Name.Local): + case strings.EqualFold("Invalidation", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFieldLevelEncryptionConfig(&sv.FieldLevelEncryptionConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentInvalidation(&sv.Invalidation, nodeDecoder); err != nil { return err } @@ -5986,14 +7464,14 @@ func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionConfigOutput(v **Get return nil } -type awsRestxml_deserializeOpGetFieldLevelEncryptionProfile struct { +type awsRestxml_deserializeOpGetKeyGroup struct { } -func (*awsRestxml_deserializeOpGetFieldLevelEncryptionProfile) ID() string { +func (*awsRestxml_deserializeOpGetKeyGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetKeyGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6007,12 +7485,12 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfile) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfile(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetKeyGroup(response, &metadata) } - output := &GetFieldLevelEncryptionProfileOutput{} + output := &GetKeyGroupOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetKeyGroupOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -6035,7 +7513,7 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfile) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfile(&output.FieldLevelEncryptionProfile, decoder) + err = awsRestxml_deserializeDocumentKeyGroup(&output.KeyGroup, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6048,7 +7526,7 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfile) HandleDeseriali return out, metadata, err } -func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetKeyGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6073,11 +7551,8 @@ func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfile(response *smith } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - - case strings.EqualFold("NoSuchFieldLevelEncryptionProfile", errorCode): - return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionProfile(response, errorBody) + case strings.EqualFold("NoSuchResource", errorCode): + return awsRestxml_deserializeErrorNoSuchResource(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6089,7 +7564,7 @@ func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfile(response *smith } } -func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileOutput(v *GetFieldLevelEncryptionProfileOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetKeyGroupOutput(v *GetKeyGroupOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -6101,13 +7576,13 @@ func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileOutput(v return nil } -func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionProfileOutput(v **GetFieldLevelEncryptionProfileOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetKeyGroupOutput(v **GetKeyGroupOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetFieldLevelEncryptionProfileOutput + var sv *GetKeyGroupOutput if *v == nil { - sv = &GetFieldLevelEncryptionProfileOutput{} + sv = &GetKeyGroupOutput{} } else { sv = *v } @@ -6123,9 +7598,9 @@ func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionProfileOutput(v **Ge originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FieldLevelEncryptionProfile", t.Name.Local): + case strings.EqualFold("KeyGroup", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFieldLevelEncryptionProfile(&sv.FieldLevelEncryptionProfile, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentKeyGroup(&sv.KeyGroup, nodeDecoder); err != nil { return err } @@ -6143,14 +7618,14 @@ func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionProfileOutput(v **Ge return nil } -type awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig struct { +type awsRestxml_deserializeOpGetKeyGroupConfig struct { } -func (*awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig) ID() string { +func (*awsRestxml_deserializeOpGetKeyGroupConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetKeyGroupConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6164,12 +7639,12 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfileConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetKeyGroupConfig(response, &metadata) } - output := &GetFieldLevelEncryptionProfileConfigOutput{} + output := &GetKeyGroupConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetKeyGroupConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -6192,7 +7667,7 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig) HandleDes } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileConfig(&output.FieldLevelEncryptionProfileConfig, decoder) + err = awsRestxml_deserializeDocumentKeyGroupConfig(&output.KeyGroupConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6205,7 +7680,7 @@ func (m *awsRestxml_deserializeOpGetFieldLevelEncryptionProfileConfig) HandleDes return out, metadata, err } -func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfileConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetKeyGroupConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6230,11 +7705,8 @@ func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfileConfig(response } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - - case strings.EqualFold("NoSuchFieldLevelEncryptionProfile", errorCode): - return awsRestxml_deserializeErrorNoSuchFieldLevelEncryptionProfile(response, errorBody) + case strings.EqualFold("NoSuchResource", errorCode): + return awsRestxml_deserializeErrorNoSuchResource(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6246,7 +7718,7 @@ func awsRestxml_deserializeOpErrorGetFieldLevelEncryptionProfileConfig(response } } -func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileConfigOutput(v *GetFieldLevelEncryptionProfileConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetKeyGroupConfigOutput(v *GetKeyGroupConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -6258,13 +7730,13 @@ func awsRestxml_deserializeOpHttpBindingsGetFieldLevelEncryptionProfileConfigOut return nil } -func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionProfileConfigOutput(v **GetFieldLevelEncryptionProfileConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetKeyGroupConfigOutput(v **GetKeyGroupConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetFieldLevelEncryptionProfileConfigOutput + var sv *GetKeyGroupConfigOutput if *v == nil { - sv = &GetFieldLevelEncryptionProfileConfigOutput{} + sv = &GetKeyGroupConfigOutput{} } else { sv = *v } @@ -6280,9 +7752,9 @@ func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionProfileConfigOutput( originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FieldLevelEncryptionProfileConfig", t.Name.Local): + case strings.EqualFold("KeyGroupConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFieldLevelEncryptionProfileConfig(&sv.FieldLevelEncryptionProfileConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentKeyGroupConfig(&sv.KeyGroupConfig, nodeDecoder); err != nil { return err } @@ -6300,14 +7772,14 @@ func awsRestxml_deserializeOpDocumentGetFieldLevelEncryptionProfileConfigOutput( return nil } -type awsRestxml_deserializeOpGetFunction struct { +type awsRestxml_deserializeOpGetMonitoringSubscription struct { } -func (*awsRestxml_deserializeOpGetFunction) ID() string { +func (*awsRestxml_deserializeOpGetMonitoringSubscription) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetMonitoringSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6321,25 +7793,43 @@ func (m *awsRestxml_deserializeOpGetFunction) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetFunction(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetMonitoringSubscription(response, &metadata) } - output := &GetFunctionOutput{} + output := &GetMonitoringSubscriptionOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetFunctionOutput(output, response) + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } } - err = awsRestxml_deserializeOpDocumentGetFunctionOutput(output, response.Body, response.ContentLength) + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsRestxml_deserializeDocumentMonitoringSubscription(&output.MonitoringSubscription, decoder) if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to deserialize response payload, %w", err)} + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } } return out, metadata, err } -func awsRestxml_deserializeOpErrorGetFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetMonitoringSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6364,8 +7854,14 @@ func awsRestxml_deserializeOpErrorGetFunction(response *smithyhttp.Response, met } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("NoSuchFunctionExists", errorCode): - return awsRestxml_deserializeErrorNoSuchFunctionExists(response, errorBody) + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("NoSuchDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) + + case strings.EqualFold("NoSuchMonitoringSubscription", errorCode): + return awsRestxml_deserializeErrorNoSuchMonitoringSubscription(response, errorBody) case strings.EqualFold("UnsupportedOperation", errorCode): return awsRestxml_deserializeErrorUnsupportedOperation(response, errorBody) @@ -6380,52 +7876,56 @@ func awsRestxml_deserializeOpErrorGetFunction(response *smithyhttp.Response, met } } -func awsRestxml_deserializeOpHttpBindingsGetFunctionOutput(v *GetFunctionOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpDocumentGetMonitoringSubscriptionOutput(v **GetMonitoringSubscriptionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) + return fmt.Errorf("unexpected nil of type %T", v) } - - if headerValues := response.Header.Values("Content-Type"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ContentType = ptr.String(headerValues[0]) + var sv *GetMonitoringSubscriptionOutput + if *v == nil { + sv = &GetMonitoringSubscriptionOutput{} + } else { + sv = *v } - if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ETag = ptr.String(headerValues[0]) - } + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("MonitoringSubscription", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentMonitoringSubscription(&sv.MonitoringSubscription, nodeDecoder); err != nil { + return err + } - return nil -} -func awsRestxml_deserializeOpDocumentGetFunctionOutput(v *GetFunctionOutput, body io.ReadCloser, contentLength int64) error { - if v == nil { - return fmt.Errorf("unsupported deserialization of nil %T", v) - } - var buf bytes.Buffer - if contentLength > 0 { - buf.Grow(int(contentLength)) - } else { - buf.Grow(512) - } + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } - _, err := buf.ReadFrom(body) - if err != nil { - return err - } - if buf.Len() > 0 { - v.FunctionCode = buf.Bytes() + } + decoder = originalDecoder } + *v = sv return nil } -type awsRestxml_deserializeOpGetInvalidation struct { +type awsRestxml_deserializeOpGetOriginAccessControl struct { } -func (*awsRestxml_deserializeOpGetInvalidation) ID() string { +func (*awsRestxml_deserializeOpGetOriginAccessControl) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetInvalidation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetOriginAccessControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6439,11 +7939,16 @@ func (m *awsRestxml_deserializeOpGetInvalidation) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetInvalidation(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetOriginAccessControl(response, &metadata) } - output := &GetInvalidationOutput{} + output := &GetOriginAccessControlOutput{} out.Result = output + err = awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -6462,7 +7967,7 @@ func (m *awsRestxml_deserializeOpGetInvalidation) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentInvalidation(&output.Invalidation, decoder) + err = awsRestxml_deserializeDocumentOriginAccessControl(&output.OriginAccessControl, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6475,7 +7980,7 @@ func (m *awsRestxml_deserializeOpGetInvalidation) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestxml_deserializeOpErrorGetInvalidation(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetOriginAccessControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6503,11 +8008,8 @@ func awsRestxml_deserializeOpErrorGetInvalidation(response *smithyhttp.Response, case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchDistribution", errorCode): - return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) - - case strings.EqualFold("NoSuchInvalidation", errorCode): - return awsRestxml_deserializeErrorNoSuchInvalidation(response, errorBody) + case strings.EqualFold("NoSuchOriginAccessControl", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginAccessControl(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6519,13 +8021,25 @@ func awsRestxml_deserializeOpErrorGetInvalidation(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentGetInvalidationOutput(v **GetInvalidationOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlOutput(v *GetOriginAccessControlOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetOriginAccessControlOutput(v **GetOriginAccessControlOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetInvalidationOutput + var sv *GetOriginAccessControlOutput if *v == nil { - sv = &GetInvalidationOutput{} + sv = &GetOriginAccessControlOutput{} } else { sv = *v } @@ -6541,9 +8055,9 @@ func awsRestxml_deserializeOpDocumentGetInvalidationOutput(v **GetInvalidationOu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("Invalidation", t.Name.Local): + case strings.EqualFold("OriginAccessControl", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentInvalidation(&sv.Invalidation, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginAccessControl(&sv.OriginAccessControl, nodeDecoder); err != nil { return err } @@ -6561,14 +8075,14 @@ func awsRestxml_deserializeOpDocumentGetInvalidationOutput(v **GetInvalidationOu return nil } -type awsRestxml_deserializeOpGetKeyGroup struct { +type awsRestxml_deserializeOpGetOriginAccessControlConfig struct { } -func (*awsRestxml_deserializeOpGetKeyGroup) ID() string { +func (*awsRestxml_deserializeOpGetOriginAccessControlConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetKeyGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetOriginAccessControlConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6582,12 +8096,12 @@ func (m *awsRestxml_deserializeOpGetKeyGroup) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetKeyGroup(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetOriginAccessControlConfig(response, &metadata) } - output := &GetKeyGroupOutput{} + output := &GetOriginAccessControlConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetKeyGroupOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -6610,7 +8124,7 @@ func (m *awsRestxml_deserializeOpGetKeyGroup) HandleDeserialize(ctx context.Cont } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentKeyGroup(&output.KeyGroup, decoder) + err = awsRestxml_deserializeDocumentOriginAccessControlConfig(&output.OriginAccessControlConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6623,7 +8137,7 @@ func (m *awsRestxml_deserializeOpGetKeyGroup) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestxml_deserializeOpErrorGetKeyGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetOriginAccessControlConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6648,8 +8162,11 @@ func awsRestxml_deserializeOpErrorGetKeyGroup(response *smithyhttp.Response, met } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("NoSuchResource", errorCode): - return awsRestxml_deserializeErrorNoSuchResource(response, errorBody) + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("NoSuchOriginAccessControl", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginAccessControl(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6661,7 +8178,7 @@ func awsRestxml_deserializeOpErrorGetKeyGroup(response *smithyhttp.Response, met } } -func awsRestxml_deserializeOpHttpBindingsGetKeyGroupOutput(v *GetKeyGroupOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlConfigOutput(v *GetOriginAccessControlConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -6673,13 +8190,13 @@ func awsRestxml_deserializeOpHttpBindingsGetKeyGroupOutput(v *GetKeyGroupOutput, return nil } -func awsRestxml_deserializeOpDocumentGetKeyGroupOutput(v **GetKeyGroupOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetOriginAccessControlConfigOutput(v **GetOriginAccessControlConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetKeyGroupOutput + var sv *GetOriginAccessControlConfigOutput if *v == nil { - sv = &GetKeyGroupOutput{} + sv = &GetOriginAccessControlConfigOutput{} } else { sv = *v } @@ -6695,9 +8212,9 @@ func awsRestxml_deserializeOpDocumentGetKeyGroupOutput(v **GetKeyGroupOutput, de originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("KeyGroup", t.Name.Local): + case strings.EqualFold("OriginAccessControlConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentKeyGroup(&sv.KeyGroup, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginAccessControlConfig(&sv.OriginAccessControlConfig, nodeDecoder); err != nil { return err } @@ -6715,14 +8232,14 @@ func awsRestxml_deserializeOpDocumentGetKeyGroupOutput(v **GetKeyGroupOutput, de return nil } -type awsRestxml_deserializeOpGetKeyGroupConfig struct { +type awsRestxml_deserializeOpGetOriginRequestPolicy struct { } -func (*awsRestxml_deserializeOpGetKeyGroupConfig) ID() string { +func (*awsRestxml_deserializeOpGetOriginRequestPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetKeyGroupConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetOriginRequestPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6736,12 +8253,12 @@ func (m *awsRestxml_deserializeOpGetKeyGroupConfig) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetKeyGroupConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetOriginRequestPolicy(response, &metadata) } - output := &GetKeyGroupConfigOutput{} + output := &GetOriginRequestPolicyOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetKeyGroupConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -6764,7 +8281,7 @@ func (m *awsRestxml_deserializeOpGetKeyGroupConfig) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentKeyGroupConfig(&output.KeyGroupConfig, decoder) + err = awsRestxml_deserializeDocumentOriginRequestPolicy(&output.OriginRequestPolicy, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6777,7 +8294,7 @@ func (m *awsRestxml_deserializeOpGetKeyGroupConfig) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestxml_deserializeOpErrorGetKeyGroupConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetOriginRequestPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6802,8 +8319,11 @@ func awsRestxml_deserializeOpErrorGetKeyGroupConfig(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("NoSuchResource", errorCode): - return awsRestxml_deserializeErrorNoSuchResource(response, errorBody) + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6815,7 +8335,7 @@ func awsRestxml_deserializeOpErrorGetKeyGroupConfig(response *smithyhttp.Respons } } -func awsRestxml_deserializeOpHttpBindingsGetKeyGroupConfigOutput(v *GetKeyGroupConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyOutput(v *GetOriginRequestPolicyOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -6827,13 +8347,13 @@ func awsRestxml_deserializeOpHttpBindingsGetKeyGroupConfigOutput(v *GetKeyGroupC return nil } -func awsRestxml_deserializeOpDocumentGetKeyGroupConfigOutput(v **GetKeyGroupConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetOriginRequestPolicyOutput(v **GetOriginRequestPolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetKeyGroupConfigOutput + var sv *GetOriginRequestPolicyOutput if *v == nil { - sv = &GetKeyGroupConfigOutput{} + sv = &GetOriginRequestPolicyOutput{} } else { sv = *v } @@ -6849,9 +8369,9 @@ func awsRestxml_deserializeOpDocumentGetKeyGroupConfigOutput(v **GetKeyGroupConf originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("KeyGroupConfig", t.Name.Local): + case strings.EqualFold("OriginRequestPolicy", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentKeyGroupConfig(&sv.KeyGroupConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginRequestPolicy(&sv.OriginRequestPolicy, nodeDecoder); err != nil { return err } @@ -6869,14 +8389,14 @@ func awsRestxml_deserializeOpDocumentGetKeyGroupConfigOutput(v **GetKeyGroupConf return nil } -type awsRestxml_deserializeOpGetMonitoringSubscription struct { +type awsRestxml_deserializeOpGetOriginRequestPolicyConfig struct { } -func (*awsRestxml_deserializeOpGetMonitoringSubscription) ID() string { +func (*awsRestxml_deserializeOpGetOriginRequestPolicyConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetMonitoringSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetOriginRequestPolicyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6890,11 +8410,16 @@ func (m *awsRestxml_deserializeOpGetMonitoringSubscription) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetMonitoringSubscription(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetOriginRequestPolicyConfig(response, &metadata) } - output := &GetMonitoringSubscriptionOutput{} + output := &GetOriginRequestPolicyConfigOutput{} out.Result = output + err = awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyConfigOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -6913,7 +8438,7 @@ func (m *awsRestxml_deserializeOpGetMonitoringSubscription) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentMonitoringSubscription(&output.MonitoringSubscription, decoder) + err = awsRestxml_deserializeDocumentOriginRequestPolicyConfig(&output.OriginRequestPolicyConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6926,7 +8451,7 @@ func (m *awsRestxml_deserializeOpGetMonitoringSubscription) HandleDeserialize(ct return out, metadata, err } -func awsRestxml_deserializeOpErrorGetMonitoringSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetOriginRequestPolicyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6954,14 +8479,8 @@ func awsRestxml_deserializeOpErrorGetMonitoringSubscription(response *smithyhttp case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchDistribution", errorCode): - return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) - - case strings.EqualFold("NoSuchMonitoringSubscription", errorCode): - return awsRestxml_deserializeErrorNoSuchMonitoringSubscription(response, errorBody) - - case strings.EqualFold("UnsupportedOperation", errorCode): - return awsRestxml_deserializeErrorUnsupportedOperation(response, errorBody) + case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -6973,13 +8492,25 @@ func awsRestxml_deserializeOpErrorGetMonitoringSubscription(response *smithyhttp } } -func awsRestxml_deserializeOpDocumentGetMonitoringSubscriptionOutput(v **GetMonitoringSubscriptionOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyConfigOutput(v *GetOriginRequestPolicyConfigOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetOriginRequestPolicyConfigOutput(v **GetOriginRequestPolicyConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetMonitoringSubscriptionOutput + var sv *GetOriginRequestPolicyConfigOutput if *v == nil { - sv = &GetMonitoringSubscriptionOutput{} + sv = &GetOriginRequestPolicyConfigOutput{} } else { sv = *v } @@ -6995,9 +8526,9 @@ func awsRestxml_deserializeOpDocumentGetMonitoringSubscriptionOutput(v **GetMoni originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("MonitoringSubscription", t.Name.Local): + case strings.EqualFold("OriginRequestPolicyConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentMonitoringSubscription(&sv.MonitoringSubscription, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginRequestPolicyConfig(&sv.OriginRequestPolicyConfig, nodeDecoder); err != nil { return err } @@ -7015,14 +8546,14 @@ func awsRestxml_deserializeOpDocumentGetMonitoringSubscriptionOutput(v **GetMoni return nil } -type awsRestxml_deserializeOpGetOriginAccessControl struct { +type awsRestxml_deserializeOpGetPublicKey struct { } -func (*awsRestxml_deserializeOpGetOriginAccessControl) ID() string { +func (*awsRestxml_deserializeOpGetPublicKey) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetOriginAccessControl) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetPublicKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7036,12 +8567,12 @@ func (m *awsRestxml_deserializeOpGetOriginAccessControl) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetOriginAccessControl(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetPublicKey(response, &metadata) } - output := &GetOriginAccessControlOutput{} + output := &GetPublicKeyOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetPublicKeyOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -7064,7 +8595,7 @@ func (m *awsRestxml_deserializeOpGetOriginAccessControl) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginAccessControl(&output.OriginAccessControl, decoder) + err = awsRestxml_deserializeDocumentPublicKey(&output.PublicKey, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7077,7 +8608,7 @@ func (m *awsRestxml_deserializeOpGetOriginAccessControl) HandleDeserialize(ctx c return out, metadata, err } -func awsRestxml_deserializeOpErrorGetOriginAccessControl(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetPublicKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7105,8 +8636,8 @@ func awsRestxml_deserializeOpErrorGetOriginAccessControl(response *smithyhttp.Re case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchOriginAccessControl", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginAccessControl(response, errorBody) + case strings.EqualFold("NoSuchPublicKey", errorCode): + return awsRestxml_deserializeErrorNoSuchPublicKey(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7118,7 +8649,7 @@ func awsRestxml_deserializeOpErrorGetOriginAccessControl(response *smithyhttp.Re } } -func awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlOutput(v *GetOriginAccessControlOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetPublicKeyOutput(v *GetPublicKeyOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -7130,13 +8661,13 @@ func awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlOutput(v *GetOrig return nil } -func awsRestxml_deserializeOpDocumentGetOriginAccessControlOutput(v **GetOriginAccessControlOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetPublicKeyOutput(v **GetPublicKeyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetOriginAccessControlOutput + var sv *GetPublicKeyOutput if *v == nil { - sv = &GetOriginAccessControlOutput{} + sv = &GetPublicKeyOutput{} } else { sv = *v } @@ -7152,9 +8683,9 @@ func awsRestxml_deserializeOpDocumentGetOriginAccessControlOutput(v **GetOriginA originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginAccessControl", t.Name.Local): + case strings.EqualFold("PublicKey", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginAccessControl(&sv.OriginAccessControl, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentPublicKey(&sv.PublicKey, nodeDecoder); err != nil { return err } @@ -7172,14 +8703,14 @@ func awsRestxml_deserializeOpDocumentGetOriginAccessControlOutput(v **GetOriginA return nil } -type awsRestxml_deserializeOpGetOriginAccessControlConfig struct { +type awsRestxml_deserializeOpGetPublicKeyConfig struct { } -func (*awsRestxml_deserializeOpGetOriginAccessControlConfig) ID() string { +func (*awsRestxml_deserializeOpGetPublicKeyConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetOriginAccessControlConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetPublicKeyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7193,12 +8724,12 @@ func (m *awsRestxml_deserializeOpGetOriginAccessControlConfig) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetOriginAccessControlConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetPublicKeyConfig(response, &metadata) } - output := &GetOriginAccessControlConfigOutput{} + output := &GetPublicKeyConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetPublicKeyConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -7221,7 +8752,7 @@ func (m *awsRestxml_deserializeOpGetOriginAccessControlConfig) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginAccessControlConfig(&output.OriginAccessControlConfig, decoder) + err = awsRestxml_deserializeDocumentPublicKeyConfig(&output.PublicKeyConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7234,7 +8765,7 @@ func (m *awsRestxml_deserializeOpGetOriginAccessControlConfig) HandleDeserialize return out, metadata, err } -func awsRestxml_deserializeOpErrorGetOriginAccessControlConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetPublicKeyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7262,8 +8793,8 @@ func awsRestxml_deserializeOpErrorGetOriginAccessControlConfig(response *smithyh case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchOriginAccessControl", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginAccessControl(response, errorBody) + case strings.EqualFold("NoSuchPublicKey", errorCode): + return awsRestxml_deserializeErrorNoSuchPublicKey(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7275,7 +8806,7 @@ func awsRestxml_deserializeOpErrorGetOriginAccessControlConfig(response *smithyh } } -func awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlConfigOutput(v *GetOriginAccessControlConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetPublicKeyConfigOutput(v *GetPublicKeyConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -7287,13 +8818,13 @@ func awsRestxml_deserializeOpHttpBindingsGetOriginAccessControlConfigOutput(v *G return nil } -func awsRestxml_deserializeOpDocumentGetOriginAccessControlConfigOutput(v **GetOriginAccessControlConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetPublicKeyConfigOutput(v **GetPublicKeyConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetOriginAccessControlConfigOutput + var sv *GetPublicKeyConfigOutput if *v == nil { - sv = &GetOriginAccessControlConfigOutput{} + sv = &GetPublicKeyConfigOutput{} } else { sv = *v } @@ -7309,9 +8840,9 @@ func awsRestxml_deserializeOpDocumentGetOriginAccessControlConfigOutput(v **GetO originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginAccessControlConfig", t.Name.Local): + case strings.EqualFold("PublicKeyConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginAccessControlConfig(&sv.OriginAccessControlConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentPublicKeyConfig(&sv.PublicKeyConfig, nodeDecoder); err != nil { return err } @@ -7329,14 +8860,14 @@ func awsRestxml_deserializeOpDocumentGetOriginAccessControlConfigOutput(v **GetO return nil } -type awsRestxml_deserializeOpGetOriginRequestPolicy struct { +type awsRestxml_deserializeOpGetRealtimeLogConfig struct { } -func (*awsRestxml_deserializeOpGetOriginRequestPolicy) ID() string { +func (*awsRestxml_deserializeOpGetRealtimeLogConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetOriginRequestPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetRealtimeLogConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7350,16 +8881,11 @@ func (m *awsRestxml_deserializeOpGetOriginRequestPolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetOriginRequestPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetRealtimeLogConfig(response, &metadata) } - output := &GetOriginRequestPolicyOutput{} + output := &GetRealtimeLogConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyOutput(output, response) - if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} - } - var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -7378,7 +8904,7 @@ func (m *awsRestxml_deserializeOpGetOriginRequestPolicy) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginRequestPolicy(&output.OriginRequestPolicy, decoder) + err = awsRestxml_deserializeOpDocumentGetRealtimeLogConfigOutput(&output, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7391,7 +8917,7 @@ func (m *awsRestxml_deserializeOpGetOriginRequestPolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsRestxml_deserializeOpErrorGetOriginRequestPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetRealtimeLogConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7419,8 +8945,11 @@ func awsRestxml_deserializeOpErrorGetOriginRequestPolicy(response *smithyhttp.Re case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("NoSuchRealtimeLogConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchRealtimeLogConfig(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7432,25 +8961,13 @@ func awsRestxml_deserializeOpErrorGetOriginRequestPolicy(response *smithyhttp.Re } } -func awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyOutput(v *GetOriginRequestPolicyOutput, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } - - if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ETag = ptr.String(headerValues[0]) - } - - return nil -} -func awsRestxml_deserializeOpDocumentGetOriginRequestPolicyOutput(v **GetOriginRequestPolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetRealtimeLogConfigOutput(v **GetRealtimeLogConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetOriginRequestPolicyOutput + var sv *GetRealtimeLogConfigOutput if *v == nil { - sv = &GetOriginRequestPolicyOutput{} + sv = &GetRealtimeLogConfigOutput{} } else { sv = *v } @@ -7466,9 +8983,9 @@ func awsRestxml_deserializeOpDocumentGetOriginRequestPolicyOutput(v **GetOriginR originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginRequestPolicy", t.Name.Local): + case strings.EqualFold("RealtimeLogConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginRequestPolicy(&sv.OriginRequestPolicy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentRealtimeLogConfig(&sv.RealtimeLogConfig, nodeDecoder); err != nil { return err } @@ -7486,14 +9003,14 @@ func awsRestxml_deserializeOpDocumentGetOriginRequestPolicyOutput(v **GetOriginR return nil } -type awsRestxml_deserializeOpGetOriginRequestPolicyConfig struct { +type awsRestxml_deserializeOpGetResponseHeadersPolicy struct { } -func (*awsRestxml_deserializeOpGetOriginRequestPolicyConfig) ID() string { +func (*awsRestxml_deserializeOpGetResponseHeadersPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetOriginRequestPolicyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetResponseHeadersPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7507,12 +9024,12 @@ func (m *awsRestxml_deserializeOpGetOriginRequestPolicyConfig) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetOriginRequestPolicyConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetResponseHeadersPolicy(response, &metadata) } - output := &GetOriginRequestPolicyConfigOutput{} + output := &GetResponseHeadersPolicyOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetResponseHeadersPolicyOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -7535,7 +9052,7 @@ func (m *awsRestxml_deserializeOpGetOriginRequestPolicyConfig) HandleDeserialize } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginRequestPolicyConfig(&output.OriginRequestPolicyConfig, decoder) + err = awsRestxml_deserializeDocumentResponseHeadersPolicy(&output.ResponseHeadersPolicy, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7548,7 +9065,7 @@ func (m *awsRestxml_deserializeOpGetOriginRequestPolicyConfig) HandleDeserialize return out, metadata, err } -func awsRestxml_deserializeOpErrorGetOriginRequestPolicyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetResponseHeadersPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7576,8 +9093,8 @@ func awsRestxml_deserializeOpErrorGetOriginRequestPolicyConfig(response *smithyh case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7589,7 +9106,7 @@ func awsRestxml_deserializeOpErrorGetOriginRequestPolicyConfig(response *smithyh } } -func awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyConfigOutput(v *GetOriginRequestPolicyConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetResponseHeadersPolicyOutput(v *GetResponseHeadersPolicyOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -7601,13 +9118,13 @@ func awsRestxml_deserializeOpHttpBindingsGetOriginRequestPolicyConfigOutput(v *G return nil } -func awsRestxml_deserializeOpDocumentGetOriginRequestPolicyConfigOutput(v **GetOriginRequestPolicyConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetResponseHeadersPolicyOutput(v **GetResponseHeadersPolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetOriginRequestPolicyConfigOutput + var sv *GetResponseHeadersPolicyOutput if *v == nil { - sv = &GetOriginRequestPolicyConfigOutput{} + sv = &GetResponseHeadersPolicyOutput{} } else { sv = *v } @@ -7623,9 +9140,9 @@ func awsRestxml_deserializeOpDocumentGetOriginRequestPolicyConfigOutput(v **GetO originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginRequestPolicyConfig", t.Name.Local): + case strings.EqualFold("ResponseHeadersPolicy", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginRequestPolicyConfig(&sv.OriginRequestPolicyConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentResponseHeadersPolicy(&sv.ResponseHeadersPolicy, nodeDecoder); err != nil { return err } @@ -7643,14 +9160,14 @@ func awsRestxml_deserializeOpDocumentGetOriginRequestPolicyConfigOutput(v **GetO return nil } -type awsRestxml_deserializeOpGetPublicKey struct { +type awsRestxml_deserializeOpGetResponseHeadersPolicyConfig struct { } -func (*awsRestxml_deserializeOpGetPublicKey) ID() string { +func (*awsRestxml_deserializeOpGetResponseHeadersPolicyConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetPublicKey) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetResponseHeadersPolicyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7664,12 +9181,12 @@ func (m *awsRestxml_deserializeOpGetPublicKey) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetPublicKey(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetResponseHeadersPolicyConfig(response, &metadata) } - output := &GetPublicKeyOutput{} + output := &GetResponseHeadersPolicyConfigOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetPublicKeyOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetResponseHeadersPolicyConfigOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -7692,7 +9209,7 @@ func (m *awsRestxml_deserializeOpGetPublicKey) HandleDeserialize(ctx context.Con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentPublicKey(&output.PublicKey, decoder) + err = awsRestxml_deserializeDocumentResponseHeadersPolicyConfig(&output.ResponseHeadersPolicyConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7705,7 +9222,7 @@ func (m *awsRestxml_deserializeOpGetPublicKey) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestxml_deserializeOpErrorGetPublicKey(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetResponseHeadersPolicyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7733,8 +9250,8 @@ func awsRestxml_deserializeOpErrorGetPublicKey(response *smithyhttp.Response, me case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchPublicKey", errorCode): - return awsRestxml_deserializeErrorNoSuchPublicKey(response, errorBody) + case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7746,7 +9263,7 @@ func awsRestxml_deserializeOpErrorGetPublicKey(response *smithyhttp.Response, me } } -func awsRestxml_deserializeOpHttpBindingsGetPublicKeyOutput(v *GetPublicKeyOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetResponseHeadersPolicyConfigOutput(v *GetResponseHeadersPolicyConfigOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -7758,13 +9275,13 @@ func awsRestxml_deserializeOpHttpBindingsGetPublicKeyOutput(v *GetPublicKeyOutpu return nil } -func awsRestxml_deserializeOpDocumentGetPublicKeyOutput(v **GetPublicKeyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetResponseHeadersPolicyConfigOutput(v **GetResponseHeadersPolicyConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetPublicKeyOutput + var sv *GetResponseHeadersPolicyConfigOutput if *v == nil { - sv = &GetPublicKeyOutput{} + sv = &GetResponseHeadersPolicyConfigOutput{} } else { sv = *v } @@ -7780,9 +9297,9 @@ func awsRestxml_deserializeOpDocumentGetPublicKeyOutput(v **GetPublicKeyOutput, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("PublicKey", t.Name.Local): + case strings.EqualFold("ResponseHeadersPolicyConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPublicKey(&sv.PublicKey, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentResponseHeadersPolicyConfig(&sv.ResponseHeadersPolicyConfig, nodeDecoder); err != nil { return err } @@ -7800,14 +9317,14 @@ func awsRestxml_deserializeOpDocumentGetPublicKeyOutput(v **GetPublicKeyOutput, return nil } -type awsRestxml_deserializeOpGetPublicKeyConfig struct { +type awsRestxml_deserializeOpGetStreamingDistribution struct { } -func (*awsRestxml_deserializeOpGetPublicKeyConfig) ID() string { +func (*awsRestxml_deserializeOpGetStreamingDistribution) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetPublicKeyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetStreamingDistribution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7821,12 +9338,12 @@ func (m *awsRestxml_deserializeOpGetPublicKeyConfig) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetPublicKeyConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetStreamingDistribution(response, &metadata) } - output := &GetPublicKeyConfigOutput{} + output := &GetStreamingDistributionOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetPublicKeyConfigOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsGetStreamingDistributionOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -7849,7 +9366,7 @@ func (m *awsRestxml_deserializeOpGetPublicKeyConfig) HandleDeserialize(ctx conte } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentPublicKeyConfig(&output.PublicKeyConfig, decoder) + err = awsRestxml_deserializeDocumentStreamingDistribution(&output.StreamingDistribution, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -7862,7 +9379,7 @@ func (m *awsRestxml_deserializeOpGetPublicKeyConfig) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestxml_deserializeOpErrorGetPublicKeyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetStreamingDistribution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -7890,8 +9407,8 @@ func awsRestxml_deserializeOpErrorGetPublicKeyConfig(response *smithyhttp.Respon case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchPublicKey", errorCode): - return awsRestxml_deserializeErrorNoSuchPublicKey(response, errorBody) + case strings.EqualFold("NoSuchStreamingDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchStreamingDistribution(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -7903,7 +9420,7 @@ func awsRestxml_deserializeOpErrorGetPublicKeyConfig(response *smithyhttp.Respon } } -func awsRestxml_deserializeOpHttpBindingsGetPublicKeyConfigOutput(v *GetPublicKeyConfigOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsGetStreamingDistributionOutput(v *GetStreamingDistributionOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -7915,13 +9432,13 @@ func awsRestxml_deserializeOpHttpBindingsGetPublicKeyConfigOutput(v *GetPublicKe return nil } -func awsRestxml_deserializeOpDocumentGetPublicKeyConfigOutput(v **GetPublicKeyConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentGetStreamingDistributionOutput(v **GetStreamingDistributionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetPublicKeyConfigOutput + var sv *GetStreamingDistributionOutput if *v == nil { - sv = &GetPublicKeyConfigOutput{} + sv = &GetStreamingDistributionOutput{} } else { sv = *v } @@ -7937,9 +9454,9 @@ func awsRestxml_deserializeOpDocumentGetPublicKeyConfigOutput(v **GetPublicKeyCo originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("PublicKeyConfig", t.Name.Local): + case strings.EqualFold("StreamingDistribution", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPublicKeyConfig(&sv.PublicKeyConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentStreamingDistribution(&sv.StreamingDistribution, nodeDecoder); err != nil { return err } @@ -7957,14 +9474,14 @@ func awsRestxml_deserializeOpDocumentGetPublicKeyConfigOutput(v **GetPublicKeyCo return nil } -type awsRestxml_deserializeOpGetRealtimeLogConfig struct { +type awsRestxml_deserializeOpGetStreamingDistributionConfig struct { } -func (*awsRestxml_deserializeOpGetRealtimeLogConfig) ID() string { +func (*awsRestxml_deserializeOpGetStreamingDistributionConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetRealtimeLogConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpGetStreamingDistributionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7978,11 +9495,16 @@ func (m *awsRestxml_deserializeOpGetRealtimeLogConfig) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetRealtimeLogConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorGetStreamingDistributionConfig(response, &metadata) } - output := &GetRealtimeLogConfigOutput{} + output := &GetStreamingDistributionConfigOutput{} out.Result = output + err = awsRestxml_deserializeOpHttpBindingsGetStreamingDistributionConfigOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -8001,7 +9523,7 @@ func (m *awsRestxml_deserializeOpGetRealtimeLogConfig) HandleDeserialize(ctx con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeOpDocumentGetRealtimeLogConfigOutput(&output, decoder) + err = awsRestxml_deserializeDocumentStreamingDistributionConfig(&output.StreamingDistributionConfig, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8014,7 +9536,7 @@ func (m *awsRestxml_deserializeOpGetRealtimeLogConfig) HandleDeserialize(ctx con return out, metadata, err } -func awsRestxml_deserializeOpErrorGetRealtimeLogConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorGetStreamingDistributionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8042,11 +9564,8 @@ func awsRestxml_deserializeOpErrorGetRealtimeLogConfig(response *smithyhttp.Resp case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): - return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - - case strings.EqualFold("NoSuchRealtimeLogConfig", errorCode): - return awsRestxml_deserializeErrorNoSuchRealtimeLogConfig(response, errorBody) + case strings.EqualFold("NoSuchStreamingDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchStreamingDistribution(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8058,13 +9577,25 @@ func awsRestxml_deserializeOpErrorGetRealtimeLogConfig(response *smithyhttp.Resp } } -func awsRestxml_deserializeOpDocumentGetRealtimeLogConfigOutput(v **GetRealtimeLogConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpHttpBindingsGetStreamingDistributionConfigOutput(v *GetStreamingDistributionConfigOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentGetStreamingDistributionConfigOutput(v **GetStreamingDistributionConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetRealtimeLogConfigOutput + var sv *GetStreamingDistributionConfigOutput if *v == nil { - sv = &GetRealtimeLogConfigOutput{} + sv = &GetStreamingDistributionConfigOutput{} } else { sv = *v } @@ -8080,9 +9611,9 @@ func awsRestxml_deserializeOpDocumentGetRealtimeLogConfigOutput(v **GetRealtimeL originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("RealtimeLogConfig", t.Name.Local): + case strings.EqualFold("StreamingDistributionConfig", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentRealtimeLogConfig(&sv.RealtimeLogConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentStreamingDistributionConfig(&sv.StreamingDistributionConfig, nodeDecoder); err != nil { return err } @@ -8100,14 +9631,14 @@ func awsRestxml_deserializeOpDocumentGetRealtimeLogConfigOutput(v **GetRealtimeL return nil } -type awsRestxml_deserializeOpGetResponseHeadersPolicy struct { +type awsRestxml_deserializeOpListCachePolicies struct { } -func (*awsRestxml_deserializeOpGetResponseHeadersPolicy) ID() string { +func (*awsRestxml_deserializeOpListCachePolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetResponseHeadersPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListCachePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8121,16 +9652,11 @@ func (m *awsRestxml_deserializeOpGetResponseHeadersPolicy) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetResponseHeadersPolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListCachePolicies(response, &metadata) } - output := &GetResponseHeadersPolicyOutput{} + output := &ListCachePoliciesOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetResponseHeadersPolicyOutput(output, response) - if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} - } - var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -8149,7 +9675,7 @@ func (m *awsRestxml_deserializeOpGetResponseHeadersPolicy) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentResponseHeadersPolicy(&output.ResponseHeadersPolicy, decoder) + err = awsRestxml_deserializeDocumentCachePolicyList(&output.CachePolicyList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8162,7 +9688,7 @@ func (m *awsRestxml_deserializeOpGetResponseHeadersPolicy) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorGetResponseHeadersPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListCachePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8190,8 +9716,11 @@ func awsRestxml_deserializeOpErrorGetResponseHeadersPolicy(response *smithyhttp. case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + + case strings.EqualFold("NoSuchCachePolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8203,25 +9732,13 @@ func awsRestxml_deserializeOpErrorGetResponseHeadersPolicy(response *smithyhttp. } } -func awsRestxml_deserializeOpHttpBindingsGetResponseHeadersPolicyOutput(v *GetResponseHeadersPolicyOutput, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } - - if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ETag = ptr.String(headerValues[0]) - } - - return nil -} -func awsRestxml_deserializeOpDocumentGetResponseHeadersPolicyOutput(v **GetResponseHeadersPolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListCachePoliciesOutput(v **ListCachePoliciesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetResponseHeadersPolicyOutput + var sv *ListCachePoliciesOutput if *v == nil { - sv = &GetResponseHeadersPolicyOutput{} + sv = &ListCachePoliciesOutput{} } else { sv = *v } @@ -8237,9 +9754,9 @@ func awsRestxml_deserializeOpDocumentGetResponseHeadersPolicyOutput(v **GetRespo originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ResponseHeadersPolicy", t.Name.Local): + case strings.EqualFold("CachePolicyList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentResponseHeadersPolicy(&sv.ResponseHeadersPolicy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentCachePolicyList(&sv.CachePolicyList, nodeDecoder); err != nil { return err } @@ -8257,14 +9774,14 @@ func awsRestxml_deserializeOpDocumentGetResponseHeadersPolicyOutput(v **GetRespo return nil } -type awsRestxml_deserializeOpGetResponseHeadersPolicyConfig struct { +type awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities struct { } -func (*awsRestxml_deserializeOpGetResponseHeadersPolicyConfig) ID() string { +func (*awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetResponseHeadersPolicyConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8278,16 +9795,11 @@ func (m *awsRestxml_deserializeOpGetResponseHeadersPolicyConfig) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetResponseHeadersPolicyConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListCloudFrontOriginAccessIdentities(response, &metadata) } - output := &GetResponseHeadersPolicyConfigOutput{} + output := &ListCloudFrontOriginAccessIdentitiesOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetResponseHeadersPolicyConfigOutput(output, response) - if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} - } - var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -8306,7 +9818,7 @@ func (m *awsRestxml_deserializeOpGetResponseHeadersPolicyConfig) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentResponseHeadersPolicyConfig(&output.ResponseHeadersPolicyConfig, decoder) + err = awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentityList(&output.CloudFrontOriginAccessIdentityList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8319,7 +9831,7 @@ func (m *awsRestxml_deserializeOpGetResponseHeadersPolicyConfig) HandleDeseriali return out, metadata, err } -func awsRestxml_deserializeOpErrorGetResponseHeadersPolicyConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListCloudFrontOriginAccessIdentities(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8344,11 +9856,8 @@ func awsRestxml_deserializeOpErrorGetResponseHeadersPolicyConfig(response *smith } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - - case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8360,25 +9869,13 @@ func awsRestxml_deserializeOpErrorGetResponseHeadersPolicyConfig(response *smith } } -func awsRestxml_deserializeOpHttpBindingsGetResponseHeadersPolicyConfigOutput(v *GetResponseHeadersPolicyConfigOutput, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } - - if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ETag = ptr.String(headerValues[0]) - } - - return nil -} -func awsRestxml_deserializeOpDocumentGetResponseHeadersPolicyConfigOutput(v **GetResponseHeadersPolicyConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListCloudFrontOriginAccessIdentitiesOutput(v **ListCloudFrontOriginAccessIdentitiesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetResponseHeadersPolicyConfigOutput + var sv *ListCloudFrontOriginAccessIdentitiesOutput if *v == nil { - sv = &GetResponseHeadersPolicyConfigOutput{} + sv = &ListCloudFrontOriginAccessIdentitiesOutput{} } else { sv = *v } @@ -8394,9 +9891,9 @@ func awsRestxml_deserializeOpDocumentGetResponseHeadersPolicyConfigOutput(v **Ge originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ResponseHeadersPolicyConfig", t.Name.Local): + case strings.EqualFold("CloudFrontOriginAccessIdentityList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentResponseHeadersPolicyConfig(&sv.ResponseHeadersPolicyConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentityList(&sv.CloudFrontOriginAccessIdentityList, nodeDecoder); err != nil { return err } @@ -8414,14 +9911,14 @@ func awsRestxml_deserializeOpDocumentGetResponseHeadersPolicyConfigOutput(v **Ge return nil } -type awsRestxml_deserializeOpGetStreamingDistribution struct { +type awsRestxml_deserializeOpListConflictingAliases struct { } -func (*awsRestxml_deserializeOpGetStreamingDistribution) ID() string { +func (*awsRestxml_deserializeOpListConflictingAliases) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetStreamingDistribution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListConflictingAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8435,16 +9932,11 @@ func (m *awsRestxml_deserializeOpGetStreamingDistribution) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetStreamingDistribution(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListConflictingAliases(response, &metadata) } - output := &GetStreamingDistributionOutput{} + output := &ListConflictingAliasesOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetStreamingDistributionOutput(output, response) - if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} - } - var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -8463,7 +9955,7 @@ func (m *awsRestxml_deserializeOpGetStreamingDistribution) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentStreamingDistribution(&output.StreamingDistribution, decoder) + err = awsRestxml_deserializeDocumentConflictingAliasesList(&output.ConflictingAliasesList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8476,7 +9968,7 @@ func (m *awsRestxml_deserializeOpGetStreamingDistribution) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorGetStreamingDistribution(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListConflictingAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8501,11 +9993,11 @@ func awsRestxml_deserializeOpErrorGetStreamingDistribution(response *smithyhttp. } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchStreamingDistribution", errorCode): - return awsRestxml_deserializeErrorNoSuchStreamingDistribution(response, errorBody) + case strings.EqualFold("NoSuchDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8517,25 +10009,13 @@ func awsRestxml_deserializeOpErrorGetStreamingDistribution(response *smithyhttp. } } -func awsRestxml_deserializeOpHttpBindingsGetStreamingDistributionOutput(v *GetStreamingDistributionOutput, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } - - if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ETag = ptr.String(headerValues[0]) - } - - return nil -} -func awsRestxml_deserializeOpDocumentGetStreamingDistributionOutput(v **GetStreamingDistributionOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListConflictingAliasesOutput(v **ListConflictingAliasesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetStreamingDistributionOutput + var sv *ListConflictingAliasesOutput if *v == nil { - sv = &GetStreamingDistributionOutput{} + sv = &ListConflictingAliasesOutput{} } else { sv = *v } @@ -8551,9 +10031,9 @@ func awsRestxml_deserializeOpDocumentGetStreamingDistributionOutput(v **GetStrea originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("StreamingDistribution", t.Name.Local): + case strings.EqualFold("ConflictingAliasesList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentStreamingDistribution(&sv.StreamingDistribution, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentConflictingAliasesList(&sv.ConflictingAliasesList, nodeDecoder); err != nil { return err } @@ -8571,14 +10051,14 @@ func awsRestxml_deserializeOpDocumentGetStreamingDistributionOutput(v **GetStrea return nil } -type awsRestxml_deserializeOpGetStreamingDistributionConfig struct { +type awsRestxml_deserializeOpListContinuousDeploymentPolicies struct { } -func (*awsRestxml_deserializeOpGetStreamingDistributionConfig) ID() string { +func (*awsRestxml_deserializeOpListContinuousDeploymentPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpGetStreamingDistributionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListContinuousDeploymentPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8592,16 +10072,11 @@ func (m *awsRestxml_deserializeOpGetStreamingDistributionConfig) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorGetStreamingDistributionConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListContinuousDeploymentPolicies(response, &metadata) } - output := &GetStreamingDistributionConfigOutput{} + output := &ListContinuousDeploymentPoliciesOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsGetStreamingDistributionConfigOutput(output, response) - if err != nil { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} - } - var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -8620,7 +10095,7 @@ func (m *awsRestxml_deserializeOpGetStreamingDistributionConfig) HandleDeseriali } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentStreamingDistributionConfig(&output.StreamingDistributionConfig, decoder) + err = awsRestxml_deserializeDocumentContinuousDeploymentPolicyList(&output.ContinuousDeploymentPolicyList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8633,7 +10108,7 @@ func (m *awsRestxml_deserializeOpGetStreamingDistributionConfig) HandleDeseriali return out, metadata, err } -func awsRestxml_deserializeOpErrorGetStreamingDistributionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListContinuousDeploymentPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8661,8 +10136,8 @@ func awsRestxml_deserializeOpErrorGetStreamingDistributionConfig(response *smith case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("NoSuchStreamingDistribution", errorCode): - return awsRestxml_deserializeErrorNoSuchStreamingDistribution(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): + return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8674,25 +10149,13 @@ func awsRestxml_deserializeOpErrorGetStreamingDistributionConfig(response *smith } } -func awsRestxml_deserializeOpHttpBindingsGetStreamingDistributionConfigOutput(v *GetStreamingDistributionConfigOutput, response *smithyhttp.Response) error { - if v == nil { - return fmt.Errorf("unsupported deserialization for nil %T", v) - } - - if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { - headerValues[0] = strings.TrimSpace(headerValues[0]) - v.ETag = ptr.String(headerValues[0]) - } - - return nil -} -func awsRestxml_deserializeOpDocumentGetStreamingDistributionConfigOutput(v **GetStreamingDistributionConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListContinuousDeploymentPoliciesOutput(v **ListContinuousDeploymentPoliciesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *GetStreamingDistributionConfigOutput + var sv *ListContinuousDeploymentPoliciesOutput if *v == nil { - sv = &GetStreamingDistributionConfigOutput{} + sv = &ListContinuousDeploymentPoliciesOutput{} } else { sv = *v } @@ -8708,9 +10171,9 @@ func awsRestxml_deserializeOpDocumentGetStreamingDistributionConfigOutput(v **Ge originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("StreamingDistributionConfig", t.Name.Local): + case strings.EqualFold("ContinuousDeploymentPolicyList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentStreamingDistributionConfig(&sv.StreamingDistributionConfig, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicyList(&sv.ContinuousDeploymentPolicyList, nodeDecoder); err != nil { return err } @@ -8728,14 +10191,14 @@ func awsRestxml_deserializeOpDocumentGetStreamingDistributionConfigOutput(v **Ge return nil } -type awsRestxml_deserializeOpListCachePolicies struct { +type awsRestxml_deserializeOpListDistributions struct { } -func (*awsRestxml_deserializeOpListCachePolicies) ID() string { +func (*awsRestxml_deserializeOpListDistributions) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListCachePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListDistributions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8749,9 +10212,9 @@ func (m *awsRestxml_deserializeOpListCachePolicies) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListCachePolicies(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListDistributions(response, &metadata) } - output := &ListCachePoliciesOutput{} + output := &ListDistributionsOutput{} out.Result = output var buff [1024]byte @@ -8772,7 +10235,7 @@ func (m *awsRestxml_deserializeOpListCachePolicies) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCachePolicyList(&output.CachePolicyList, decoder) + err = awsRestxml_deserializeDocumentDistributionList(&output.DistributionList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8785,7 +10248,7 @@ func (m *awsRestxml_deserializeOpListCachePolicies) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestxml_deserializeOpErrorListCachePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListDistributions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8810,15 +10273,9 @@ func awsRestxml_deserializeOpErrorListCachePolicies(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchCachePolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8829,13 +10286,13 @@ func awsRestxml_deserializeOpErrorListCachePolicies(response *smithyhttp.Respons } } -func awsRestxml_deserializeOpDocumentListCachePoliciesOutput(v **ListCachePoliciesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListDistributionsOutput(v **ListDistributionsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListCachePoliciesOutput + var sv *ListDistributionsOutput if *v == nil { - sv = &ListCachePoliciesOutput{} + sv = &ListDistributionsOutput{} } else { sv = *v } @@ -8851,9 +10308,9 @@ func awsRestxml_deserializeOpDocumentListCachePoliciesOutput(v **ListCachePolici originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CachePolicyList", t.Name.Local): + case strings.EqualFold("DistributionList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCachePolicyList(&sv.CachePolicyList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentDistributionList(&sv.DistributionList, nodeDecoder); err != nil { return err } @@ -8871,14 +10328,14 @@ func awsRestxml_deserializeOpDocumentListCachePoliciesOutput(v **ListCachePolici return nil } -type awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities struct { +type awsRestxml_deserializeOpListDistributionsByCachePolicyId struct { } -func (*awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities) ID() string { +func (*awsRestxml_deserializeOpListDistributionsByCachePolicyId) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListDistributionsByCachePolicyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8892,9 +10349,9 @@ func (m *awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListCloudFrontOriginAccessIdentities(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByCachePolicyId(response, &metadata) } - output := &ListCloudFrontOriginAccessIdentitiesOutput{} + output := &ListDistributionsByCachePolicyIdOutput{} out.Result = output var buff [1024]byte @@ -8915,7 +10372,7 @@ func (m *awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities) HandleDes } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentityList(&output.CloudFrontOriginAccessIdentityList, decoder) + err = awsRestxml_deserializeDocumentDistributionIdList(&output.DistributionIdList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -8928,7 +10385,7 @@ func (m *awsRestxml_deserializeOpListCloudFrontOriginAccessIdentities) HandleDes return out, metadata, err } -func awsRestxml_deserializeOpErrorListCloudFrontOriginAccessIdentities(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListDistributionsByCachePolicyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8953,148 +10410,14 @@ func awsRestxml_deserializeOpErrorListCloudFrontOriginAccessIdentities(response } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("InvalidArgument", errorCode): - return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -func awsRestxml_deserializeOpDocumentListCloudFrontOriginAccessIdentitiesOutput(v **ListCloudFrontOriginAccessIdentitiesOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ListCloudFrontOriginAccessIdentitiesOutput - if *v == nil { - sv = &ListCloudFrontOriginAccessIdentitiesOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("CloudFrontOriginAccessIdentityList", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentityList(&sv.CloudFrontOriginAccessIdentityList, nodeDecoder); err != nil { - return err - } - - default: - // Do nothing and ignore the unexpected tag element - err = decoder.Decoder.Skip() - if err != nil { - return err - } - - } - decoder = originalDecoder - } - *v = sv - return nil -} - -type awsRestxml_deserializeOpListConflictingAliases struct { -} - -func (*awsRestxml_deserializeOpListConflictingAliases) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestxml_deserializeOpListConflictingAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListConflictingAliases(response, &metadata) - } - output := &ListConflictingAliasesOutput{} - out.Result = output - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentConflictingAliasesList(&output.ConflictingAliasesList, decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - return out, metadata, err -} - -func awsRestxml_deserializeOpErrorListConflictingAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - 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("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchDistribution", errorCode): - return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) + case strings.EqualFold("NoSuchCachePolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9106,13 +10429,13 @@ func awsRestxml_deserializeOpErrorListConflictingAliases(response *smithyhttp.Re } } -func awsRestxml_deserializeOpDocumentListConflictingAliasesOutput(v **ListConflictingAliasesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListDistributionsByCachePolicyIdOutput(v **ListDistributionsByCachePolicyIdOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListConflictingAliasesOutput + var sv *ListDistributionsByCachePolicyIdOutput if *v == nil { - sv = &ListConflictingAliasesOutput{} + sv = &ListDistributionsByCachePolicyIdOutput{} } else { sv = *v } @@ -9128,9 +10451,9 @@ func awsRestxml_deserializeOpDocumentListConflictingAliasesOutput(v **ListConfli originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ConflictingAliasesList", t.Name.Local): + case strings.EqualFold("DistributionIdList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentConflictingAliasesList(&sv.ConflictingAliasesList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentDistributionIdList(&sv.DistributionIdList, nodeDecoder); err != nil { return err } @@ -9148,14 +10471,14 @@ func awsRestxml_deserializeOpDocumentListConflictingAliasesOutput(v **ListConfli return nil } -type awsRestxml_deserializeOpListDistributions struct { +type awsRestxml_deserializeOpListDistributionsByKeyGroup struct { } -func (*awsRestxml_deserializeOpListDistributions) ID() string { +func (*awsRestxml_deserializeOpListDistributionsByKeyGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListDistributions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListDistributionsByKeyGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9169,9 +10492,9 @@ func (m *awsRestxml_deserializeOpListDistributions) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListDistributions(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByKeyGroup(response, &metadata) } - output := &ListDistributionsOutput{} + output := &ListDistributionsByKeyGroupOutput{} out.Result = output var buff [1024]byte @@ -9192,7 +10515,7 @@ func (m *awsRestxml_deserializeOpListDistributions) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentDistributionList(&output.DistributionList, decoder) + err = awsRestxml_deserializeDocumentDistributionIdList(&output.DistributionIdList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9205,7 +10528,7 @@ func (m *awsRestxml_deserializeOpListDistributions) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestxml_deserializeOpErrorListDistributions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListDistributionsByKeyGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9233,6 +10556,9 @@ func awsRestxml_deserializeOpErrorListDistributions(response *smithyhttp.Respons case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("NoSuchResource", errorCode): + return awsRestxml_deserializeErrorNoSuchResource(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9243,13 +10569,13 @@ func awsRestxml_deserializeOpErrorListDistributions(response *smithyhttp.Respons } } -func awsRestxml_deserializeOpDocumentListDistributionsOutput(v **ListDistributionsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListDistributionsByKeyGroupOutput(v **ListDistributionsByKeyGroupOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListDistributionsOutput + var sv *ListDistributionsByKeyGroupOutput if *v == nil { - sv = &ListDistributionsOutput{} + sv = &ListDistributionsByKeyGroupOutput{} } else { sv = *v } @@ -9265,9 +10591,9 @@ func awsRestxml_deserializeOpDocumentListDistributionsOutput(v **ListDistributio originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DistributionList", t.Name.Local): + case strings.EqualFold("DistributionIdList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDistributionList(&sv.DistributionList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentDistributionIdList(&sv.DistributionIdList, nodeDecoder); err != nil { return err } @@ -9285,14 +10611,14 @@ func awsRestxml_deserializeOpDocumentListDistributionsOutput(v **ListDistributio return nil } -type awsRestxml_deserializeOpListDistributionsByCachePolicyId struct { +type awsRestxml_deserializeOpListDistributionsByOriginRequestPolicyId struct { } -func (*awsRestxml_deserializeOpListDistributionsByCachePolicyId) ID() string { +func (*awsRestxml_deserializeOpListDistributionsByOriginRequestPolicyId) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListDistributionsByCachePolicyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListDistributionsByOriginRequestPolicyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9306,9 +10632,9 @@ func (m *awsRestxml_deserializeOpListDistributionsByCachePolicyId) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByCachePolicyId(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByOriginRequestPolicyId(response, &metadata) } - output := &ListDistributionsByCachePolicyIdOutput{} + output := &ListDistributionsByOriginRequestPolicyIdOutput{} out.Result = output var buff [1024]byte @@ -9342,7 +10668,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByCachePolicyId) HandleDeseria return out, metadata, err } -func awsRestxml_deserializeOpErrorListDistributionsByCachePolicyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListDistributionsByOriginRequestPolicyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9373,8 +10699,8 @@ func awsRestxml_deserializeOpErrorListDistributionsByCachePolicyId(response *smi case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchCachePolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9386,13 +10712,13 @@ func awsRestxml_deserializeOpErrorListDistributionsByCachePolicyId(response *smi } } -func awsRestxml_deserializeOpDocumentListDistributionsByCachePolicyIdOutput(v **ListDistributionsByCachePolicyIdOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListDistributionsByOriginRequestPolicyIdOutput(v **ListDistributionsByOriginRequestPolicyIdOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListDistributionsByCachePolicyIdOutput + var sv *ListDistributionsByOriginRequestPolicyIdOutput if *v == nil { - sv = &ListDistributionsByCachePolicyIdOutput{} + sv = &ListDistributionsByOriginRequestPolicyIdOutput{} } else { sv = *v } @@ -9428,14 +10754,14 @@ func awsRestxml_deserializeOpDocumentListDistributionsByCachePolicyIdOutput(v ** return nil } -type awsRestxml_deserializeOpListDistributionsByKeyGroup struct { +type awsRestxml_deserializeOpListDistributionsByRealtimeLogConfig struct { } -func (*awsRestxml_deserializeOpListDistributionsByKeyGroup) ID() string { +func (*awsRestxml_deserializeOpListDistributionsByRealtimeLogConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListDistributionsByKeyGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListDistributionsByRealtimeLogConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9449,9 +10775,9 @@ func (m *awsRestxml_deserializeOpListDistributionsByKeyGroup) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByKeyGroup(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByRealtimeLogConfig(response, &metadata) } - output := &ListDistributionsByKeyGroupOutput{} + output := &ListDistributionsByRealtimeLogConfigOutput{} out.Result = output var buff [1024]byte @@ -9472,7 +10798,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByKeyGroup) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentDistributionIdList(&output.DistributionIdList, decoder) + err = awsRestxml_deserializeDocumentDistributionList(&output.DistributionList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9485,7 +10811,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByKeyGroup) HandleDeserialize( return out, metadata, err } -func awsRestxml_deserializeOpErrorListDistributionsByKeyGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListDistributionsByRealtimeLogConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9513,9 +10839,6 @@ func awsRestxml_deserializeOpErrorListDistributionsByKeyGroup(response *smithyht case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchResource", errorCode): - return awsRestxml_deserializeErrorNoSuchResource(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9526,13 +10849,13 @@ func awsRestxml_deserializeOpErrorListDistributionsByKeyGroup(response *smithyht } } -func awsRestxml_deserializeOpDocumentListDistributionsByKeyGroupOutput(v **ListDistributionsByKeyGroupOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListDistributionsByRealtimeLogConfigOutput(v **ListDistributionsByRealtimeLogConfigOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListDistributionsByKeyGroupOutput + var sv *ListDistributionsByRealtimeLogConfigOutput if *v == nil { - sv = &ListDistributionsByKeyGroupOutput{} + sv = &ListDistributionsByRealtimeLogConfigOutput{} } else { sv = *v } @@ -9548,9 +10871,9 @@ func awsRestxml_deserializeOpDocumentListDistributionsByKeyGroupOutput(v **ListD originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DistributionIdList", t.Name.Local): + case strings.EqualFold("DistributionList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDistributionIdList(&sv.DistributionIdList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentDistributionList(&sv.DistributionList, nodeDecoder); err != nil { return err } @@ -9568,14 +10891,14 @@ func awsRestxml_deserializeOpDocumentListDistributionsByKeyGroupOutput(v **ListD return nil } -type awsRestxml_deserializeOpListDistributionsByOriginRequestPolicyId struct { +type awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId struct { } -func (*awsRestxml_deserializeOpListDistributionsByOriginRequestPolicyId) ID() string { +func (*awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListDistributionsByOriginRequestPolicyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9589,9 +10912,9 @@ func (m *awsRestxml_deserializeOpListDistributionsByOriginRequestPolicyId) Handl } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByOriginRequestPolicyId(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByResponseHeadersPolicyId(response, &metadata) } - output := &ListDistributionsByOriginRequestPolicyIdOutput{} + output := &ListDistributionsByResponseHeadersPolicyIdOutput{} out.Result = output var buff [1024]byte @@ -9625,7 +10948,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByOriginRequestPolicyId) Handl return out, metadata, err } -func awsRestxml_deserializeOpErrorListDistributionsByOriginRequestPolicyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListDistributionsByResponseHeadersPolicyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9656,8 +10979,8 @@ func awsRestxml_deserializeOpErrorListDistributionsByOriginRequestPolicyId(respo case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9669,13 +10992,13 @@ func awsRestxml_deserializeOpErrorListDistributionsByOriginRequestPolicyId(respo } } -func awsRestxml_deserializeOpDocumentListDistributionsByOriginRequestPolicyIdOutput(v **ListDistributionsByOriginRequestPolicyIdOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListDistributionsByResponseHeadersPolicyIdOutput(v **ListDistributionsByResponseHeadersPolicyIdOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListDistributionsByOriginRequestPolicyIdOutput + var sv *ListDistributionsByResponseHeadersPolicyIdOutput if *v == nil { - sv = &ListDistributionsByOriginRequestPolicyIdOutput{} + sv = &ListDistributionsByResponseHeadersPolicyIdOutput{} } else { sv = *v } @@ -9711,14 +11034,14 @@ func awsRestxml_deserializeOpDocumentListDistributionsByOriginRequestPolicyIdOut return nil } -type awsRestxml_deserializeOpListDistributionsByRealtimeLogConfig struct { +type awsRestxml_deserializeOpListDistributionsByWebACLId struct { } -func (*awsRestxml_deserializeOpListDistributionsByRealtimeLogConfig) ID() string { +func (*awsRestxml_deserializeOpListDistributionsByWebACLId) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListDistributionsByRealtimeLogConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListDistributionsByWebACLId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9732,9 +11055,9 @@ func (m *awsRestxml_deserializeOpListDistributionsByRealtimeLogConfig) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByRealtimeLogConfig(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByWebACLId(response, &metadata) } - output := &ListDistributionsByRealtimeLogConfigOutput{} + output := &ListDistributionsByWebACLIdOutput{} out.Result = output var buff [1024]byte @@ -9768,7 +11091,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByRealtimeLogConfig) HandleDes return out, metadata, err } -func awsRestxml_deserializeOpErrorListDistributionsByRealtimeLogConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListDistributionsByWebACLId(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9796,6 +11119,9 @@ func awsRestxml_deserializeOpErrorListDistributionsByRealtimeLogConfig(response case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("InvalidWebACLId", errorCode): + return awsRestxml_deserializeErrorInvalidWebACLId(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9806,13 +11132,13 @@ func awsRestxml_deserializeOpErrorListDistributionsByRealtimeLogConfig(response } } -func awsRestxml_deserializeOpDocumentListDistributionsByRealtimeLogConfigOutput(v **ListDistributionsByRealtimeLogConfigOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListDistributionsByWebACLIdOutput(v **ListDistributionsByWebACLIdOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListDistributionsByRealtimeLogConfigOutput + var sv *ListDistributionsByWebACLIdOutput if *v == nil { - sv = &ListDistributionsByRealtimeLogConfigOutput{} + sv = &ListDistributionsByWebACLIdOutput{} } else { sv = *v } @@ -9848,14 +11174,14 @@ func awsRestxml_deserializeOpDocumentListDistributionsByRealtimeLogConfigOutput( return nil } -type awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId struct { +type awsRestxml_deserializeOpListFieldLevelEncryptionConfigs struct { } -func (*awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId) ID() string { +func (*awsRestxml_deserializeOpListFieldLevelEncryptionConfigs) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListFieldLevelEncryptionConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9869,9 +11195,9 @@ func (m *awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId) Han } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByResponseHeadersPolicyId(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListFieldLevelEncryptionConfigs(response, &metadata) } - output := &ListDistributionsByResponseHeadersPolicyIdOutput{} + output := &ListFieldLevelEncryptionConfigsOutput{} out.Result = output var buff [1024]byte @@ -9892,7 +11218,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId) Han } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentDistributionIdList(&output.DistributionIdList, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionList(&output.FieldLevelEncryptionList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -9905,7 +11231,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByResponseHeadersPolicyId) Han return out, metadata, err } -func awsRestxml_deserializeOpErrorListDistributionsByResponseHeadersPolicyId(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListFieldLevelEncryptionConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9930,15 +11256,9 @@ func awsRestxml_deserializeOpErrorListDistributionsByResponseHeadersPolicyId(res } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9949,13 +11269,13 @@ func awsRestxml_deserializeOpErrorListDistributionsByResponseHeadersPolicyId(res } } -func awsRestxml_deserializeOpDocumentListDistributionsByResponseHeadersPolicyIdOutput(v **ListDistributionsByResponseHeadersPolicyIdOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListFieldLevelEncryptionConfigsOutput(v **ListFieldLevelEncryptionConfigsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListDistributionsByResponseHeadersPolicyIdOutput + var sv *ListFieldLevelEncryptionConfigsOutput if *v == nil { - sv = &ListDistributionsByResponseHeadersPolicyIdOutput{} + sv = &ListFieldLevelEncryptionConfigsOutput{} } else { sv = *v } @@ -9971,9 +11291,9 @@ func awsRestxml_deserializeOpDocumentListDistributionsByResponseHeadersPolicyIdO originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DistributionIdList", t.Name.Local): + case strings.EqualFold("FieldLevelEncryptionList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDistributionIdList(&sv.DistributionIdList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentFieldLevelEncryptionList(&sv.FieldLevelEncryptionList, nodeDecoder); err != nil { return err } @@ -9991,14 +11311,14 @@ func awsRestxml_deserializeOpDocumentListDistributionsByResponseHeadersPolicyIdO return nil } -type awsRestxml_deserializeOpListDistributionsByWebACLId struct { +type awsRestxml_deserializeOpListFieldLevelEncryptionProfiles struct { } -func (*awsRestxml_deserializeOpListDistributionsByWebACLId) ID() string { +func (*awsRestxml_deserializeOpListFieldLevelEncryptionProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListDistributionsByWebACLId) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListFieldLevelEncryptionProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10012,9 +11332,9 @@ func (m *awsRestxml_deserializeOpListDistributionsByWebACLId) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListDistributionsByWebACLId(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListFieldLevelEncryptionProfiles(response, &metadata) } - output := &ListDistributionsByWebACLIdOutput{} + output := &ListFieldLevelEncryptionProfilesOutput{} out.Result = output var buff [1024]byte @@ -10035,7 +11355,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByWebACLId) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentDistributionList(&output.DistributionList, decoder) + err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileList(&output.FieldLevelEncryptionProfileList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10048,7 +11368,7 @@ func (m *awsRestxml_deserializeOpListDistributionsByWebACLId) HandleDeserialize( return out, metadata, err } -func awsRestxml_deserializeOpErrorListDistributionsByWebACLId(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListFieldLevelEncryptionProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10076,9 +11396,6 @@ func awsRestxml_deserializeOpErrorListDistributionsByWebACLId(response *smithyht case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("InvalidWebACLId", errorCode): - return awsRestxml_deserializeErrorInvalidWebACLId(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10089,13 +11406,13 @@ func awsRestxml_deserializeOpErrorListDistributionsByWebACLId(response *smithyht } } -func awsRestxml_deserializeOpDocumentListDistributionsByWebACLIdOutput(v **ListDistributionsByWebACLIdOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListFieldLevelEncryptionProfilesOutput(v **ListFieldLevelEncryptionProfilesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListDistributionsByWebACLIdOutput + var sv *ListFieldLevelEncryptionProfilesOutput if *v == nil { - sv = &ListDistributionsByWebACLIdOutput{} + sv = &ListFieldLevelEncryptionProfilesOutput{} } else { sv = *v } @@ -10111,9 +11428,9 @@ func awsRestxml_deserializeOpDocumentListDistributionsByWebACLIdOutput(v **ListD originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("DistributionList", t.Name.Local): + case strings.EqualFold("FieldLevelEncryptionProfileList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentDistributionList(&sv.DistributionList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentFieldLevelEncryptionProfileList(&sv.FieldLevelEncryptionProfileList, nodeDecoder); err != nil { return err } @@ -10131,14 +11448,14 @@ func awsRestxml_deserializeOpDocumentListDistributionsByWebACLIdOutput(v **ListD return nil } -type awsRestxml_deserializeOpListFieldLevelEncryptionConfigs struct { +type awsRestxml_deserializeOpListFunctions struct { } -func (*awsRestxml_deserializeOpListFieldLevelEncryptionConfigs) ID() string { +func (*awsRestxml_deserializeOpListFunctions) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListFieldLevelEncryptionConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListFunctions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10152,9 +11469,9 @@ func (m *awsRestxml_deserializeOpListFieldLevelEncryptionConfigs) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListFieldLevelEncryptionConfigs(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListFunctions(response, &metadata) } - output := &ListFieldLevelEncryptionConfigsOutput{} + output := &ListFunctionsOutput{} out.Result = output var buff [1024]byte @@ -10175,7 +11492,7 @@ func (m *awsRestxml_deserializeOpListFieldLevelEncryptionConfigs) HandleDeserial } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionList(&output.FieldLevelEncryptionList, decoder) + err = awsRestxml_deserializeDocumentFunctionList(&output.FunctionList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10188,7 +11505,7 @@ func (m *awsRestxml_deserializeOpListFieldLevelEncryptionConfigs) HandleDeserial return out, metadata, err } -func awsRestxml_deserializeOpErrorListFieldLevelEncryptionConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListFunctions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10216,6 +11533,9 @@ func awsRestxml_deserializeOpErrorListFieldLevelEncryptionConfigs(response *smit case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsRestxml_deserializeErrorUnsupportedOperation(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10226,13 +11546,13 @@ func awsRestxml_deserializeOpErrorListFieldLevelEncryptionConfigs(response *smit } } -func awsRestxml_deserializeOpDocumentListFieldLevelEncryptionConfigsOutput(v **ListFieldLevelEncryptionConfigsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListFunctionsOutput(v **ListFunctionsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListFieldLevelEncryptionConfigsOutput + var sv *ListFunctionsOutput if *v == nil { - sv = &ListFieldLevelEncryptionConfigsOutput{} + sv = &ListFunctionsOutput{} } else { sv = *v } @@ -10248,9 +11568,9 @@ func awsRestxml_deserializeOpDocumentListFieldLevelEncryptionConfigsOutput(v **L originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FieldLevelEncryptionList", t.Name.Local): + case strings.EqualFold("FunctionList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFieldLevelEncryptionList(&sv.FieldLevelEncryptionList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentFunctionList(&sv.FunctionList, nodeDecoder); err != nil { return err } @@ -10268,14 +11588,14 @@ func awsRestxml_deserializeOpDocumentListFieldLevelEncryptionConfigsOutput(v **L return nil } -type awsRestxml_deserializeOpListFieldLevelEncryptionProfiles struct { +type awsRestxml_deserializeOpListInvalidations struct { } -func (*awsRestxml_deserializeOpListFieldLevelEncryptionProfiles) ID() string { +func (*awsRestxml_deserializeOpListInvalidations) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListFieldLevelEncryptionProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListInvalidations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10289,9 +11609,9 @@ func (m *awsRestxml_deserializeOpListFieldLevelEncryptionProfiles) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListFieldLevelEncryptionProfiles(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListInvalidations(response, &metadata) } - output := &ListFieldLevelEncryptionProfilesOutput{} + output := &ListInvalidationsOutput{} out.Result = output var buff [1024]byte @@ -10312,7 +11632,7 @@ func (m *awsRestxml_deserializeOpListFieldLevelEncryptionProfiles) HandleDeseria } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentFieldLevelEncryptionProfileList(&output.FieldLevelEncryptionProfileList, decoder) + err = awsRestxml_deserializeDocumentInvalidationList(&output.InvalidationList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10325,7 +11645,7 @@ func (m *awsRestxml_deserializeOpListFieldLevelEncryptionProfiles) HandleDeseria return out, metadata, err } -func awsRestxml_deserializeOpErrorListFieldLevelEncryptionProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListInvalidations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10350,9 +11670,15 @@ func awsRestxml_deserializeOpErrorListFieldLevelEncryptionProfiles(response *smi } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("NoSuchDistribution", errorCode): + return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10363,13 +11689,13 @@ func awsRestxml_deserializeOpErrorListFieldLevelEncryptionProfiles(response *smi } } -func awsRestxml_deserializeOpDocumentListFieldLevelEncryptionProfilesOutput(v **ListFieldLevelEncryptionProfilesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListInvalidationsOutput(v **ListInvalidationsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListFieldLevelEncryptionProfilesOutput + var sv *ListInvalidationsOutput if *v == nil { - sv = &ListFieldLevelEncryptionProfilesOutput{} + sv = &ListInvalidationsOutput{} } else { sv = *v } @@ -10385,9 +11711,9 @@ func awsRestxml_deserializeOpDocumentListFieldLevelEncryptionProfilesOutput(v ** originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FieldLevelEncryptionProfileList", t.Name.Local): + case strings.EqualFold("InvalidationList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFieldLevelEncryptionProfileList(&sv.FieldLevelEncryptionProfileList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentInvalidationList(&sv.InvalidationList, nodeDecoder); err != nil { return err } @@ -10405,14 +11731,14 @@ func awsRestxml_deserializeOpDocumentListFieldLevelEncryptionProfilesOutput(v ** return nil } -type awsRestxml_deserializeOpListFunctions struct { +type awsRestxml_deserializeOpListKeyGroups struct { } -func (*awsRestxml_deserializeOpListFunctions) ID() string { +func (*awsRestxml_deserializeOpListKeyGroups) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListFunctions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListKeyGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10426,9 +11752,9 @@ func (m *awsRestxml_deserializeOpListFunctions) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListFunctions(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListKeyGroups(response, &metadata) } - output := &ListFunctionsOutput{} + output := &ListKeyGroupsOutput{} out.Result = output var buff [1024]byte @@ -10449,7 +11775,7 @@ func (m *awsRestxml_deserializeOpListFunctions) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentFunctionList(&output.FunctionList, decoder) + err = awsRestxml_deserializeDocumentKeyGroupList(&output.KeyGroupList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10462,7 +11788,7 @@ func (m *awsRestxml_deserializeOpListFunctions) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestxml_deserializeOpErrorListFunctions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListKeyGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10490,9 +11816,6 @@ func awsRestxml_deserializeOpErrorListFunctions(response *smithyhttp.Response, m case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("UnsupportedOperation", errorCode): - return awsRestxml_deserializeErrorUnsupportedOperation(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10503,13 +11826,13 @@ func awsRestxml_deserializeOpErrorListFunctions(response *smithyhttp.Response, m } } -func awsRestxml_deserializeOpDocumentListFunctionsOutput(v **ListFunctionsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListKeyGroupsOutput(v **ListKeyGroupsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListFunctionsOutput + var sv *ListKeyGroupsOutput if *v == nil { - sv = &ListFunctionsOutput{} + sv = &ListKeyGroupsOutput{} } else { sv = *v } @@ -10525,9 +11848,9 @@ func awsRestxml_deserializeOpDocumentListFunctionsOutput(v **ListFunctionsOutput originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FunctionList", t.Name.Local): + case strings.EqualFold("KeyGroupList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFunctionList(&sv.FunctionList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentKeyGroupList(&sv.KeyGroupList, nodeDecoder); err != nil { return err } @@ -10545,14 +11868,14 @@ func awsRestxml_deserializeOpDocumentListFunctionsOutput(v **ListFunctionsOutput return nil } -type awsRestxml_deserializeOpListInvalidations struct { +type awsRestxml_deserializeOpListOriginAccessControls struct { } -func (*awsRestxml_deserializeOpListInvalidations) ID() string { +func (*awsRestxml_deserializeOpListOriginAccessControls) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListInvalidations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10566,9 +11889,9 @@ func (m *awsRestxml_deserializeOpListInvalidations) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListInvalidations(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListOriginAccessControls(response, &metadata) } - output := &ListInvalidationsOutput{} + output := &ListOriginAccessControlsOutput{} out.Result = output var buff [1024]byte @@ -10589,7 +11912,7 @@ func (m *awsRestxml_deserializeOpListInvalidations) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentInvalidationList(&output.InvalidationList, decoder) + err = awsRestxml_deserializeDocumentOriginAccessControlList(&output.OriginAccessControlList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10602,7 +11925,7 @@ func (m *awsRestxml_deserializeOpListInvalidations) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestxml_deserializeOpErrorListInvalidations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListOriginAccessControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10627,15 +11950,9 @@ func awsRestxml_deserializeOpErrorListInvalidations(response *smithyhttp.Respons } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchDistribution", errorCode): - return awsRestxml_deserializeErrorNoSuchDistribution(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10646,13 +11963,13 @@ func awsRestxml_deserializeOpErrorListInvalidations(response *smithyhttp.Respons } } -func awsRestxml_deserializeOpDocumentListInvalidationsOutput(v **ListInvalidationsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListOriginAccessControlsOutput(v **ListOriginAccessControlsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListInvalidationsOutput + var sv *ListOriginAccessControlsOutput if *v == nil { - sv = &ListInvalidationsOutput{} + sv = &ListOriginAccessControlsOutput{} } else { sv = *v } @@ -10668,9 +11985,9 @@ func awsRestxml_deserializeOpDocumentListInvalidationsOutput(v **ListInvalidatio originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("InvalidationList", t.Name.Local): + case strings.EqualFold("OriginAccessControlList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentInvalidationList(&sv.InvalidationList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginAccessControlList(&sv.OriginAccessControlList, nodeDecoder); err != nil { return err } @@ -10688,14 +12005,14 @@ func awsRestxml_deserializeOpDocumentListInvalidationsOutput(v **ListInvalidatio return nil } -type awsRestxml_deserializeOpListKeyGroups struct { +type awsRestxml_deserializeOpListOriginRequestPolicies struct { } -func (*awsRestxml_deserializeOpListKeyGroups) ID() string { +func (*awsRestxml_deserializeOpListOriginRequestPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListKeyGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10709,9 +12026,9 @@ func (m *awsRestxml_deserializeOpListKeyGroups) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListKeyGroups(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListOriginRequestPolicies(response, &metadata) } - output := &ListKeyGroupsOutput{} + output := &ListOriginRequestPoliciesOutput{} out.Result = output var buff [1024]byte @@ -10732,7 +12049,7 @@ func (m *awsRestxml_deserializeOpListKeyGroups) HandleDeserialize(ctx context.Co } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentKeyGroupList(&output.KeyGroupList, decoder) + err = awsRestxml_deserializeDocumentOriginRequestPolicyList(&output.OriginRequestPolicyList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10745,7 +12062,7 @@ func (m *awsRestxml_deserializeOpListKeyGroups) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestxml_deserializeOpErrorListKeyGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListOriginRequestPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10770,9 +12087,15 @@ func awsRestxml_deserializeOpErrorListKeyGroups(response *smithyhttp.Response, m } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10783,13 +12106,13 @@ func awsRestxml_deserializeOpErrorListKeyGroups(response *smithyhttp.Response, m } } -func awsRestxml_deserializeOpDocumentListKeyGroupsOutput(v **ListKeyGroupsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListOriginRequestPoliciesOutput(v **ListOriginRequestPoliciesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListKeyGroupsOutput + var sv *ListOriginRequestPoliciesOutput if *v == nil { - sv = &ListKeyGroupsOutput{} + sv = &ListOriginRequestPoliciesOutput{} } else { sv = *v } @@ -10805,9 +12128,9 @@ func awsRestxml_deserializeOpDocumentListKeyGroupsOutput(v **ListKeyGroupsOutput originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("KeyGroupList", t.Name.Local): + case strings.EqualFold("OriginRequestPolicyList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentKeyGroupList(&sv.KeyGroupList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentOriginRequestPolicyList(&sv.OriginRequestPolicyList, nodeDecoder); err != nil { return err } @@ -10825,14 +12148,14 @@ func awsRestxml_deserializeOpDocumentListKeyGroupsOutput(v **ListKeyGroupsOutput return nil } -type awsRestxml_deserializeOpListOriginAccessControls struct { +type awsRestxml_deserializeOpListPublicKeys struct { } -func (*awsRestxml_deserializeOpListOriginAccessControls) ID() string { +func (*awsRestxml_deserializeOpListPublicKeys) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10846,9 +12169,9 @@ func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListOriginAccessControls(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListPublicKeys(response, &metadata) } - output := &ListOriginAccessControlsOutput{} + output := &ListPublicKeysOutput{} out.Result = output var buff [1024]byte @@ -10869,7 +12192,7 @@ func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginAccessControlList(&output.OriginAccessControlList, decoder) + err = awsRestxml_deserializeDocumentPublicKeyList(&output.PublicKeyList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -10882,7 +12205,7 @@ func (m *awsRestxml_deserializeOpListOriginAccessControls) HandleDeserialize(ctx return out, metadata, err } -func awsRestxml_deserializeOpErrorListOriginAccessControls(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListPublicKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10920,13 +12243,13 @@ func awsRestxml_deserializeOpErrorListOriginAccessControls(response *smithyhttp. } } -func awsRestxml_deserializeOpDocumentListOriginAccessControlsOutput(v **ListOriginAccessControlsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListPublicKeysOutput(v **ListPublicKeysOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListOriginAccessControlsOutput + var sv *ListPublicKeysOutput if *v == nil { - sv = &ListOriginAccessControlsOutput{} + sv = &ListPublicKeysOutput{} } else { sv = *v } @@ -10942,9 +12265,9 @@ func awsRestxml_deserializeOpDocumentListOriginAccessControlsOutput(v **ListOrig originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginAccessControlList", t.Name.Local): + case strings.EqualFold("PublicKeyList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginAccessControlList(&sv.OriginAccessControlList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentPublicKeyList(&sv.PublicKeyList, nodeDecoder); err != nil { return err } @@ -10962,14 +12285,14 @@ func awsRestxml_deserializeOpDocumentListOriginAccessControlsOutput(v **ListOrig return nil } -type awsRestxml_deserializeOpListOriginRequestPolicies struct { +type awsRestxml_deserializeOpListRealtimeLogConfigs struct { } -func (*awsRestxml_deserializeOpListOriginRequestPolicies) ID() string { +func (*awsRestxml_deserializeOpListRealtimeLogConfigs) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10983,9 +12306,9 @@ func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListOriginRequestPolicies(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response, &metadata) } - output := &ListOriginRequestPoliciesOutput{} + output := &ListRealtimeLogConfigsOutput{} out.Result = output var buff [1024]byte @@ -11006,7 +12329,7 @@ func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ct } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentOriginRequestPolicyList(&output.OriginRequestPolicyList, decoder) + err = awsRestxml_deserializeDocumentRealtimeLogConfigs(&output.RealtimeLogConfigs, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11019,7 +12342,7 @@ func (m *awsRestxml_deserializeOpListOriginRequestPolicies) HandleDeserialize(ct return out, metadata, err } -func awsRestxml_deserializeOpErrorListOriginRequestPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11050,8 +12373,8 @@ func awsRestxml_deserializeOpErrorListOriginRequestPolicies(response *smithyhttp case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchOriginRequestPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchOriginRequestPolicy(response, errorBody) + case strings.EqualFold("NoSuchRealtimeLogConfig", errorCode): + return awsRestxml_deserializeErrorNoSuchRealtimeLogConfig(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11063,13 +12386,13 @@ func awsRestxml_deserializeOpErrorListOriginRequestPolicies(response *smithyhttp } } -func awsRestxml_deserializeOpDocumentListOriginRequestPoliciesOutput(v **ListOriginRequestPoliciesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListRealtimeLogConfigsOutput(v **ListRealtimeLogConfigsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListOriginRequestPoliciesOutput + var sv *ListRealtimeLogConfigsOutput if *v == nil { - sv = &ListOriginRequestPoliciesOutput{} + sv = &ListRealtimeLogConfigsOutput{} } else { sv = *v } @@ -11085,9 +12408,9 @@ func awsRestxml_deserializeOpDocumentListOriginRequestPoliciesOutput(v **ListOri originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("OriginRequestPolicyList", t.Name.Local): + case strings.EqualFold("RealtimeLogConfigs", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentOriginRequestPolicyList(&sv.OriginRequestPolicyList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentRealtimeLogConfigs(&sv.RealtimeLogConfigs, nodeDecoder); err != nil { return err } @@ -11105,14 +12428,14 @@ func awsRestxml_deserializeOpDocumentListOriginRequestPoliciesOutput(v **ListOri return nil } -type awsRestxml_deserializeOpListPublicKeys struct { +type awsRestxml_deserializeOpListResponseHeadersPolicies struct { } -func (*awsRestxml_deserializeOpListPublicKeys) ID() string { +func (*awsRestxml_deserializeOpListResponseHeadersPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListResponseHeadersPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11126,9 +12449,9 @@ func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListPublicKeys(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListResponseHeadersPolicies(response, &metadata) } - output := &ListPublicKeysOutput{} + output := &ListResponseHeadersPoliciesOutput{} out.Result = output var buff [1024]byte @@ -11149,7 +12472,7 @@ func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.C } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentPublicKeyList(&output.PublicKeyList, decoder) + err = awsRestxml_deserializeDocumentResponseHeadersPolicyList(&output.ResponseHeadersPolicyList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11162,7 +12485,7 @@ func (m *awsRestxml_deserializeOpListPublicKeys) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestxml_deserializeOpErrorListPublicKeys(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListResponseHeadersPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11187,9 +12510,15 @@ func awsRestxml_deserializeOpErrorListPublicKeys(response *smithyhttp.Response, } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11200,13 +12529,13 @@ func awsRestxml_deserializeOpErrorListPublicKeys(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentListPublicKeysOutput(v **ListPublicKeysOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListResponseHeadersPoliciesOutput(v **ListResponseHeadersPoliciesOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListPublicKeysOutput + var sv *ListResponseHeadersPoliciesOutput if *v == nil { - sv = &ListPublicKeysOutput{} + sv = &ListResponseHeadersPoliciesOutput{} } else { sv = *v } @@ -11222,9 +12551,9 @@ func awsRestxml_deserializeOpDocumentListPublicKeysOutput(v **ListPublicKeysOutp originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("PublicKeyList", t.Name.Local): + case strings.EqualFold("ResponseHeadersPolicyList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentPublicKeyList(&sv.PublicKeyList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentResponseHeadersPolicyList(&sv.ResponseHeadersPolicyList, nodeDecoder); err != nil { return err } @@ -11242,14 +12571,14 @@ func awsRestxml_deserializeOpDocumentListPublicKeysOutput(v **ListPublicKeysOutp return nil } -type awsRestxml_deserializeOpListRealtimeLogConfigs struct { +type awsRestxml_deserializeOpListStreamingDistributions struct { } -func (*awsRestxml_deserializeOpListRealtimeLogConfigs) ID() string { +func (*awsRestxml_deserializeOpListStreamingDistributions) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListStreamingDistributions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11263,9 +12592,9 @@ func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListStreamingDistributions(response, &metadata) } - output := &ListRealtimeLogConfigsOutput{} + output := &ListStreamingDistributionsOutput{} out.Result = output var buff [1024]byte @@ -11286,7 +12615,7 @@ func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentRealtimeLogConfigs(&output.RealtimeLogConfigs, decoder) + err = awsRestxml_deserializeDocumentStreamingDistributionList(&output.StreamingDistributionList, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11299,7 +12628,7 @@ func (m *awsRestxml_deserializeOpListRealtimeLogConfigs) HandleDeserialize(ctx c return out, metadata, err } -func awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListStreamingDistributions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11324,15 +12653,9 @@ func awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response *smithyhttp.Re } errorBody.Seek(0, io.SeekStart) switch { - case strings.EqualFold("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchRealtimeLogConfig", errorCode): - return awsRestxml_deserializeErrorNoSuchRealtimeLogConfig(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11343,13 +12666,13 @@ func awsRestxml_deserializeOpErrorListRealtimeLogConfigs(response *smithyhttp.Re } } -func awsRestxml_deserializeOpDocumentListRealtimeLogConfigsOutput(v **ListRealtimeLogConfigsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListStreamingDistributionsOutput(v **ListStreamingDistributionsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListRealtimeLogConfigsOutput + var sv *ListStreamingDistributionsOutput if *v == nil { - sv = &ListRealtimeLogConfigsOutput{} + sv = &ListStreamingDistributionsOutput{} } else { sv = *v } @@ -11365,9 +12688,9 @@ func awsRestxml_deserializeOpDocumentListRealtimeLogConfigsOutput(v **ListRealti originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("RealtimeLogConfigs", t.Name.Local): + case strings.EqualFold("StreamingDistributionList", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentRealtimeLogConfigs(&sv.RealtimeLogConfigs, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentStreamingDistributionList(&sv.StreamingDistributionList, nodeDecoder); err != nil { return err } @@ -11385,14 +12708,14 @@ func awsRestxml_deserializeOpDocumentListRealtimeLogConfigsOutput(v **ListRealti return nil } -type awsRestxml_deserializeOpListResponseHeadersPolicies struct { +type awsRestxml_deserializeOpListTagsForResource struct { } -func (*awsRestxml_deserializeOpListResponseHeadersPolicies) ID() string { +func (*awsRestxml_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListResponseHeadersPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11406,9 +12729,9 @@ func (m *awsRestxml_deserializeOpListResponseHeadersPolicies) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListResponseHeadersPolicies(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &ListResponseHeadersPoliciesOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -11429,7 +12752,7 @@ func (m *awsRestxml_deserializeOpListResponseHeadersPolicies) HandleDeserialize( } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentResponseHeadersPolicyList(&output.ResponseHeadersPolicyList, decoder) + err = awsRestxml_deserializeDocumentTags(&output.Tags, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11442,7 +12765,7 @@ func (m *awsRestxml_deserializeOpListResponseHeadersPolicies) HandleDeserialize( return out, metadata, err } -func awsRestxml_deserializeOpErrorListResponseHeadersPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11473,8 +12796,11 @@ func awsRestxml_deserializeOpErrorListResponseHeadersPolicies(response *smithyht case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - case strings.EqualFold("NoSuchResponseHeadersPolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchResponseHeadersPolicy(response, errorBody) + case strings.EqualFold("InvalidTagging", errorCode): + return awsRestxml_deserializeErrorInvalidTagging(response, errorBody) + + case strings.EqualFold("NoSuchResource", errorCode): + return awsRestxml_deserializeErrorNoSuchResource(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11486,13 +12812,13 @@ func awsRestxml_deserializeOpErrorListResponseHeadersPolicies(response *smithyht } } -func awsRestxml_deserializeOpDocumentListResponseHeadersPoliciesOutput(v **ListResponseHeadersPoliciesOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListResponseHeadersPoliciesOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &ListResponseHeadersPoliciesOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } @@ -11508,9 +12834,9 @@ func awsRestxml_deserializeOpDocumentListResponseHeadersPoliciesOutput(v **ListR originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("ResponseHeadersPolicyList", t.Name.Local): + case strings.EqualFold("Tags", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentResponseHeadersPolicyList(&sv.ResponseHeadersPolicyList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentTags(&sv.Tags, nodeDecoder); err != nil { return err } @@ -11528,14 +12854,14 @@ func awsRestxml_deserializeOpDocumentListResponseHeadersPoliciesOutput(v **ListR return nil } -type awsRestxml_deserializeOpListStreamingDistributions struct { +type awsRestxml_deserializeOpPublishFunction struct { } -func (*awsRestxml_deserializeOpListStreamingDistributions) ID() string { +func (*awsRestxml_deserializeOpPublishFunction) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListStreamingDistributions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpPublishFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11549,9 +12875,9 @@ func (m *awsRestxml_deserializeOpListStreamingDistributions) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListStreamingDistributions(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorPublishFunction(response, &metadata) } - output := &ListStreamingDistributionsOutput{} + output := &PublishFunctionOutput{} out.Result = output var buff [1024]byte @@ -11572,7 +12898,7 @@ func (m *awsRestxml_deserializeOpListStreamingDistributions) HandleDeserialize(c } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentStreamingDistributionList(&output.StreamingDistributionList, decoder) + err = awsRestxml_deserializeDocumentFunctionSummary(&output.FunctionSummary, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11585,7 +12911,7 @@ func (m *awsRestxml_deserializeOpListStreamingDistributions) HandleDeserialize(c return out, metadata, err } -func awsRestxml_deserializeOpErrorListStreamingDistributions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorPublishFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11613,6 +12939,18 @@ func awsRestxml_deserializeOpErrorListStreamingDistributions(response *smithyhtt case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) + case strings.EqualFold("InvalidIfMatchVersion", errorCode): + return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) + + case strings.EqualFold("NoSuchFunctionExists", errorCode): + return awsRestxml_deserializeErrorNoSuchFunctionExists(response, errorBody) + + case strings.EqualFold("PreconditionFailed", errorCode): + return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) + + case strings.EqualFold("UnsupportedOperation", errorCode): + return awsRestxml_deserializeErrorUnsupportedOperation(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11623,13 +12961,13 @@ func awsRestxml_deserializeOpErrorListStreamingDistributions(response *smithyhtt } } -func awsRestxml_deserializeOpDocumentListStreamingDistributionsOutput(v **ListStreamingDistributionsOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentPublishFunctionOutput(v **PublishFunctionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *ListStreamingDistributionsOutput + var sv *PublishFunctionOutput if *v == nil { - sv = &ListStreamingDistributionsOutput{} + sv = &PublishFunctionOutput{} } else { sv = *v } @@ -11645,9 +12983,9 @@ func awsRestxml_deserializeOpDocumentListStreamingDistributionsOutput(v **ListSt originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("StreamingDistributionList", t.Name.Local): + case strings.EqualFold("FunctionSummary", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentStreamingDistributionList(&sv.StreamingDistributionList, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentFunctionSummary(&sv.FunctionSummary, nodeDecoder); err != nil { return err } @@ -11665,14 +13003,14 @@ func awsRestxml_deserializeOpDocumentListStreamingDistributionsOutput(v **ListSt return nil } -type awsRestxml_deserializeOpListTagsForResource struct { +type awsRestxml_deserializeOpTagResource struct { } -func (*awsRestxml_deserializeOpListTagsForResource) ID() string { +func (*awsRestxml_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11686,43 +13024,21 @@ func (m *awsRestxml_deserializeOpListTagsForResource) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorTagResource(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &TagResourceOutput{} out.Result = output - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - rootDecoder := xml.NewDecoder(body) - t, err := smithyxml.FetchRootElement(rootDecoder) - if err == io.EOF { - return out, metadata, nil - } - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentTags(&output.Tags, decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } return out, metadata, err } -func awsRestxml_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11769,56 +13085,14 @@ func awsRestxml_deserializeOpErrorListTagsForResource(response *smithyhttp.Respo } } -func awsRestxml_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, decoder smithyxml.NodeDecoder) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - var sv *ListTagsForResourceOutput - if *v == nil { - sv = &ListTagsForResourceOutput{} - } else { - sv = *v - } - - for { - t, done, err := decoder.Token() - if err != nil { - return err - } - if done { - break - } - originalDecoder := decoder - decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) - switch { - case strings.EqualFold("Tags", t.Name.Local): - nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTags(&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 -} - -type awsRestxml_deserializeOpPublishFunction struct { +type awsRestxml_deserializeOpTestFunction struct { } -func (*awsRestxml_deserializeOpPublishFunction) ID() string { +func (*awsRestxml_deserializeOpTestFunction) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpPublishFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpTestFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11832,9 +13106,9 @@ func (m *awsRestxml_deserializeOpPublishFunction) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorPublishFunction(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorTestFunction(response, &metadata) } - output := &PublishFunctionOutput{} + output := &TestFunctionOutput{} out.Result = output var buff [1024]byte @@ -11855,7 +13129,7 @@ func (m *awsRestxml_deserializeOpPublishFunction) HandleDeserialize(ctx context. } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentFunctionSummary(&output.FunctionSummary, decoder) + err = awsRestxml_deserializeDocumentTestResult(&output.TestResult, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11868,7 +13142,7 @@ func (m *awsRestxml_deserializeOpPublishFunction) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestxml_deserializeOpErrorPublishFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorTestFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11902,8 +13176,8 @@ func awsRestxml_deserializeOpErrorPublishFunction(response *smithyhttp.Response, case strings.EqualFold("NoSuchFunctionExists", errorCode): return awsRestxml_deserializeErrorNoSuchFunctionExists(response, errorBody) - case strings.EqualFold("PreconditionFailed", errorCode): - return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) + case strings.EqualFold("TestFunctionFailed", errorCode): + return awsRestxml_deserializeErrorTestFunctionFailed(response, errorBody) case strings.EqualFold("UnsupportedOperation", errorCode): return awsRestxml_deserializeErrorUnsupportedOperation(response, errorBody) @@ -11918,13 +13192,13 @@ func awsRestxml_deserializeOpErrorPublishFunction(response *smithyhttp.Response, } } -func awsRestxml_deserializeOpDocumentPublishFunctionOutput(v **PublishFunctionOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentTestFunctionOutput(v **TestFunctionOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *PublishFunctionOutput + var sv *TestFunctionOutput if *v == nil { - sv = &PublishFunctionOutput{} + sv = &TestFunctionOutput{} } else { sv = *v } @@ -11940,9 +13214,9 @@ func awsRestxml_deserializeOpDocumentPublishFunctionOutput(v **PublishFunctionOu originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("FunctionSummary", t.Name.Local): + case strings.EqualFold("TestResult", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentFunctionSummary(&sv.FunctionSummary, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentTestResult(&sv.TestResult, nodeDecoder); err != nil { return err } @@ -11960,14 +13234,14 @@ func awsRestxml_deserializeOpDocumentPublishFunctionOutput(v **PublishFunctionOu return nil } -type awsRestxml_deserializeOpTagResource struct { +type awsRestxml_deserializeOpUntagResource struct { } -func (*awsRestxml_deserializeOpTagResource) ID() string { +func (*awsRestxml_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11981,9 +13255,9 @@ func (m *awsRestxml_deserializeOpTagResource) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorUntagResource(response, &metadata) } - output := &TagResourceOutput{} + output := &UntagResourceOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -11995,7 +13269,7 @@ func (m *awsRestxml_deserializeOpTagResource) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestxml_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -12042,14 +13316,14 @@ func awsRestxml_deserializeOpErrorTagResource(response *smithyhttp.Response, met } } -type awsRestxml_deserializeOpTestFunction struct { +type awsRestxml_deserializeOpUpdateCachePolicy struct { } -func (*awsRestxml_deserializeOpTestFunction) ID() string { +func (*awsRestxml_deserializeOpUpdateCachePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpTestFunction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpUpdateCachePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -12063,11 +13337,16 @@ func (m *awsRestxml_deserializeOpTestFunction) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorTestFunction(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorUpdateCachePolicy(response, &metadata) } - output := &TestFunctionOutput{} + output := &UpdateCachePolicyOutput{} out.Result = output + err = awsRestxml_deserializeOpHttpBindingsUpdateCachePolicyOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) body := io.TeeReader(response.Body, ringBuffer) @@ -12086,7 +13365,7 @@ func (m *awsRestxml_deserializeOpTestFunction) HandleDeserialize(ctx context.Con } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentTestResult(&output.TestResult, decoder) + err = awsRestxml_deserializeDocumentCachePolicy(&output.CachePolicy, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12099,7 +13378,7 @@ func (m *awsRestxml_deserializeOpTestFunction) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestxml_deserializeOpErrorTestFunction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorUpdateCachePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -12124,20 +13403,38 @@ func awsRestxml_deserializeOpErrorTestFunction(response *smithyhttp.Response, me } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("AccessDenied", errorCode): + return awsRestxml_deserializeErrorAccessDenied(response, errorBody) + + case strings.EqualFold("CachePolicyAlreadyExists", errorCode): + return awsRestxml_deserializeErrorCachePolicyAlreadyExists(response, errorBody) + + case strings.EqualFold("IllegalUpdate", errorCode): + return awsRestxml_deserializeErrorIllegalUpdate(response, errorBody) + + case strings.EqualFold("InconsistentQuantities", errorCode): + return awsRestxml_deserializeErrorInconsistentQuantities(response, errorBody) + case strings.EqualFold("InvalidArgument", errorCode): return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) case strings.EqualFold("InvalidIfMatchVersion", errorCode): return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) - case strings.EqualFold("NoSuchFunctionExists", errorCode): - return awsRestxml_deserializeErrorNoSuchFunctionExists(response, errorBody) + case strings.EqualFold("NoSuchCachePolicy", errorCode): + return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) - case strings.EqualFold("TestFunctionFailed", errorCode): - return awsRestxml_deserializeErrorTestFunctionFailed(response, errorBody) + case strings.EqualFold("PreconditionFailed", errorCode): + return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) - case strings.EqualFold("UnsupportedOperation", errorCode): - return awsRestxml_deserializeErrorUnsupportedOperation(response, errorBody) + case strings.EqualFold("TooManyCookiesInCachePolicy", errorCode): + return awsRestxml_deserializeErrorTooManyCookiesInCachePolicy(response, errorBody) + + case strings.EqualFold("TooManyHeadersInCachePolicy", errorCode): + return awsRestxml_deserializeErrorTooManyHeadersInCachePolicy(response, errorBody) + + case strings.EqualFold("TooManyQueryStringsInCachePolicy", errorCode): + return awsRestxml_deserializeErrorTooManyQueryStringsInCachePolicy(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -12149,13 +13446,25 @@ func awsRestxml_deserializeOpErrorTestFunction(response *smithyhttp.Response, me } } -func awsRestxml_deserializeOpDocumentTestFunctionOutput(v **TestFunctionOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpHttpBindingsUpdateCachePolicyOutput(v *UpdateCachePolicyOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("ETag"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + v.ETag = ptr.String(headerValues[0]) + } + + return nil +} +func awsRestxml_deserializeOpDocumentUpdateCachePolicyOutput(v **UpdateCachePolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *TestFunctionOutput + var sv *UpdateCachePolicyOutput if *v == nil { - sv = &TestFunctionOutput{} + sv = &UpdateCachePolicyOutput{} } else { sv = *v } @@ -12171,9 +13480,9 @@ func awsRestxml_deserializeOpDocumentTestFunctionOutput(v **TestFunctionOutput, originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("TestResult", t.Name.Local): + case strings.EqualFold("CachePolicy", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentTestResult(&sv.TestResult, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentCachePolicy(&sv.CachePolicy, nodeDecoder); err != nil { return err } @@ -12191,96 +13500,14 @@ func awsRestxml_deserializeOpDocumentTestFunctionOutput(v **TestFunctionOutput, return nil } -type awsRestxml_deserializeOpUntagResource struct { -} - -func (*awsRestxml_deserializeOpUntagResource) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestxml_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} - } - - if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUntagResource(response, &metadata) - } - output := &UntagResourceOutput{} - out.Result = output - - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - - return out, metadata, err -} - -func awsRestxml_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - 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("AccessDenied", errorCode): - return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - - case strings.EqualFold("InvalidArgument", errorCode): - return awsRestxml_deserializeErrorInvalidArgument(response, errorBody) - - case strings.EqualFold("InvalidTagging", errorCode): - return awsRestxml_deserializeErrorInvalidTagging(response, errorBody) - - case strings.EqualFold("NoSuchResource", errorCode): - return awsRestxml_deserializeErrorNoSuchResource(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestxml_deserializeOpUpdateCachePolicy struct { +type awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity struct { } -func (*awsRestxml_deserializeOpUpdateCachePolicy) ID() string { +func (*awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdateCachePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -12294,12 +13521,12 @@ func (m *awsRestxml_deserializeOpUpdateCachePolicy) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdateCachePolicy(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorUpdateCloudFrontOriginAccessIdentity(response, &metadata) } - output := &UpdateCachePolicyOutput{} + output := &UpdateCloudFrontOriginAccessIdentityOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsUpdateCachePolicyOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -12322,7 +13549,7 @@ func (m *awsRestxml_deserializeOpUpdateCachePolicy) HandleDeserialize(ctx contex } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCachePolicy(&output.CachePolicy, decoder) + err = awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(&output.CloudFrontOriginAccessIdentity, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12335,7 +13562,7 @@ func (m *awsRestxml_deserializeOpUpdateCachePolicy) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdateCachePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorUpdateCloudFrontOriginAccessIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -12363,9 +13590,6 @@ func awsRestxml_deserializeOpErrorUpdateCachePolicy(response *smithyhttp.Respons case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("CachePolicyAlreadyExists", errorCode): - return awsRestxml_deserializeErrorCachePolicyAlreadyExists(response, errorBody) - case strings.EqualFold("IllegalUpdate", errorCode): return awsRestxml_deserializeErrorIllegalUpdate(response, errorBody) @@ -12378,21 +13602,15 @@ func awsRestxml_deserializeOpErrorUpdateCachePolicy(response *smithyhttp.Respons case strings.EqualFold("InvalidIfMatchVersion", errorCode): return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) - case strings.EqualFold("NoSuchCachePolicy", errorCode): - return awsRestxml_deserializeErrorNoSuchCachePolicy(response, errorBody) + case strings.EqualFold("MissingBody", errorCode): + return awsRestxml_deserializeErrorMissingBody(response, errorBody) + + case strings.EqualFold("NoSuchCloudFrontOriginAccessIdentity", errorCode): + return awsRestxml_deserializeErrorNoSuchCloudFrontOriginAccessIdentity(response, errorBody) case strings.EqualFold("PreconditionFailed", errorCode): return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) - case strings.EqualFold("TooManyCookiesInCachePolicy", errorCode): - return awsRestxml_deserializeErrorTooManyCookiesInCachePolicy(response, errorBody) - - case strings.EqualFold("TooManyHeadersInCachePolicy", errorCode): - return awsRestxml_deserializeErrorTooManyHeadersInCachePolicy(response, errorBody) - - case strings.EqualFold("TooManyQueryStringsInCachePolicy", errorCode): - return awsRestxml_deserializeErrorTooManyQueryStringsInCachePolicy(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -12403,7 +13621,7 @@ func awsRestxml_deserializeOpErrorUpdateCachePolicy(response *smithyhttp.Respons } } -func awsRestxml_deserializeOpHttpBindingsUpdateCachePolicyOutput(v *UpdateCachePolicyOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityOutput(v *UpdateCloudFrontOriginAccessIdentityOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -12415,13 +13633,13 @@ func awsRestxml_deserializeOpHttpBindingsUpdateCachePolicyOutput(v *UpdateCacheP return nil } -func awsRestxml_deserializeOpDocumentUpdateCachePolicyOutput(v **UpdateCachePolicyOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentUpdateCloudFrontOriginAccessIdentityOutput(v **UpdateCloudFrontOriginAccessIdentityOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *UpdateCachePolicyOutput + var sv *UpdateCloudFrontOriginAccessIdentityOutput if *v == nil { - sv = &UpdateCachePolicyOutput{} + sv = &UpdateCloudFrontOriginAccessIdentityOutput{} } else { sv = *v } @@ -12437,9 +13655,9 @@ func awsRestxml_deserializeOpDocumentUpdateCachePolicyOutput(v **UpdateCachePoli originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CachePolicy", t.Name.Local): + case strings.EqualFold("CloudFrontOriginAccessIdentity", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCachePolicy(&sv.CachePolicy, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(&sv.CloudFrontOriginAccessIdentity, nodeDecoder); err != nil { return err } @@ -12457,14 +13675,14 @@ func awsRestxml_deserializeOpDocumentUpdateCachePolicyOutput(v **UpdateCachePoli return nil } -type awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity struct { +type awsRestxml_deserializeOpUpdateContinuousDeploymentPolicy struct { } -func (*awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity) ID() string { +func (*awsRestxml_deserializeOpUpdateContinuousDeploymentPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestxml_deserializeOpUpdateContinuousDeploymentPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -12478,12 +13696,12 @@ func (m *awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestxml_deserializeOpErrorUpdateCloudFrontOriginAccessIdentity(response, &metadata) + return out, metadata, awsRestxml_deserializeOpErrorUpdateContinuousDeploymentPolicy(response, &metadata) } - output := &UpdateCloudFrontOriginAccessIdentityOutput{} + output := &UpdateContinuousDeploymentPolicyOutput{} out.Result = output - err = awsRestxml_deserializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityOutput(output, response) + err = awsRestxml_deserializeOpHttpBindingsUpdateContinuousDeploymentPolicyOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -12506,7 +13724,7 @@ func (m *awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity) HandleDes } decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) - err = awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(&output.CloudFrontOriginAccessIdentity, decoder) + err = awsRestxml_deserializeDocumentContinuousDeploymentPolicy(&output.ContinuousDeploymentPolicy, decoder) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -12519,7 +13737,7 @@ func (m *awsRestxml_deserializeOpUpdateCloudFrontOriginAccessIdentity) HandleDes return out, metadata, err } -func awsRestxml_deserializeOpErrorUpdateCloudFrontOriginAccessIdentity(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestxml_deserializeOpErrorUpdateContinuousDeploymentPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -12547,9 +13765,6 @@ func awsRestxml_deserializeOpErrorUpdateCloudFrontOriginAccessIdentity(response case strings.EqualFold("AccessDenied", errorCode): return awsRestxml_deserializeErrorAccessDenied(response, errorBody) - case strings.EqualFold("IllegalUpdate", errorCode): - return awsRestxml_deserializeErrorIllegalUpdate(response, errorBody) - case strings.EqualFold("InconsistentQuantities", errorCode): return awsRestxml_deserializeErrorInconsistentQuantities(response, errorBody) @@ -12559,15 +13774,12 @@ func awsRestxml_deserializeOpErrorUpdateCloudFrontOriginAccessIdentity(response case strings.EqualFold("InvalidIfMatchVersion", errorCode): return awsRestxml_deserializeErrorInvalidIfMatchVersion(response, errorBody) - case strings.EqualFold("MissingBody", errorCode): - return awsRestxml_deserializeErrorMissingBody(response, errorBody) - - case strings.EqualFold("NoSuchCloudFrontOriginAccessIdentity", errorCode): - return awsRestxml_deserializeErrorNoSuchCloudFrontOriginAccessIdentity(response, errorBody) - case strings.EqualFold("PreconditionFailed", errorCode): return awsRestxml_deserializeErrorPreconditionFailed(response, errorBody) + case strings.EqualFold("StagingDistributionInUse", errorCode): + return awsRestxml_deserializeErrorStagingDistributionInUse(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -12578,7 +13790,7 @@ func awsRestxml_deserializeOpErrorUpdateCloudFrontOriginAccessIdentity(response } } -func awsRestxml_deserializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityOutput(v *UpdateCloudFrontOriginAccessIdentityOutput, response *smithyhttp.Response) error { +func awsRestxml_deserializeOpHttpBindingsUpdateContinuousDeploymentPolicyOutput(v *UpdateContinuousDeploymentPolicyOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -12590,13 +13802,13 @@ func awsRestxml_deserializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityOut return nil } -func awsRestxml_deserializeOpDocumentUpdateCloudFrontOriginAccessIdentityOutput(v **UpdateCloudFrontOriginAccessIdentityOutput, decoder smithyxml.NodeDecoder) error { +func awsRestxml_deserializeOpDocumentUpdateContinuousDeploymentPolicyOutput(v **UpdateContinuousDeploymentPolicyOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } - var sv *UpdateCloudFrontOriginAccessIdentityOutput + var sv *UpdateContinuousDeploymentPolicyOutput if *v == nil { - sv = &UpdateCloudFrontOriginAccessIdentityOutput{} + sv = &UpdateContinuousDeploymentPolicyOutput{} } else { sv = *v } @@ -12612,9 +13824,9 @@ func awsRestxml_deserializeOpDocumentUpdateCloudFrontOriginAccessIdentityOutput( originalDecoder := decoder decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) switch { - case strings.EqualFold("CloudFrontOriginAccessIdentity", t.Name.Local): + case strings.EqualFold("ContinuousDeploymentPolicy", t.Name.Local): nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) - if err := awsRestxml_deserializeDocumentCloudFrontOriginAccessIdentity(&sv.CloudFrontOriginAccessIdentity, nodeDecoder); err != nil { + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicy(&sv.ContinuousDeploymentPolicy, nodeDecoder); err != nil { return err } @@ -12836,6 +14048,9 @@ func awsRestxml_deserializeOpErrorUpdateDistribution(response *smithyhttp.Respon case strings.EqualFold("RealtimeLogConfigOwnerMismatch", errorCode): return awsRestxml_deserializeErrorRealtimeLogConfigOwnerMismatch(response, errorBody) + case strings.EqualFold("StagingDistributionInUse", errorCode): + return awsRestxml_deserializeErrorStagingDistributionInUse(response, errorBody) + case strings.EqualFold("TooManyCacheBehaviors", errorCode): return awsRestxml_deserializeErrorTooManyCacheBehaviors(response, errorBody) @@ -18331,6 +19546,50 @@ func awsRestxml_deserializeErrorResponseHeadersPolicyInUse(response *smithyhttp. return output } +func awsRestxml_deserializeErrorStagingDistributionInUse(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.StagingDistributionInUse{} + 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 = awsRestxml_deserializeDocumentStagingDistributionInUse(&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 awsRestxml_deserializeErrorStreamingDistributionAlreadyExists(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.StreamingDistributionAlreadyExists{} var buff [1024]byte @@ -23967,6 +25226,462 @@ func awsRestxml_deserializeDocumentContentTypeProfiles(v **types.ContentTypeProf return nil } +func awsRestxml_deserializeDocumentContinuousDeploymentPolicy(v **types.ContinuousDeploymentPolicy, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ContinuousDeploymentPolicy + if *v == nil { + sv = &types.ContinuousDeploymentPolicy{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ContinuousDeploymentPolicyConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicyConfig(&sv.ContinuousDeploymentPolicyConfig, nodeDecoder); err != nil { + return err + } + + 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("LastModifiedTime", 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.LastModifiedTime = 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 awsRestxml_deserializeDocumentContinuousDeploymentPolicyConfig(v **types.ContinuousDeploymentPolicyConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ContinuousDeploymentPolicyConfig + if *v == nil { + sv = &types.ContinuousDeploymentPolicyConfig{} + } else { + sv = *v + } + + for { + t, 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("StagingDistributionDnsNames", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentStagingDistributionDnsNames(&sv.StagingDistributionDnsNames, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("TrafficConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentTrafficConfig(&sv.TrafficConfig, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentContinuousDeploymentPolicyList(v **types.ContinuousDeploymentPolicyList, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ContinuousDeploymentPolicyList + if *v == nil { + sv = &types.ContinuousDeploymentPolicyList{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Items", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicySummaryList(&sv.Items, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("MaxItems", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaxItems = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("NextMarker", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextMarker = ptr.String(xtv) + } + + case strings.EqualFold("Quantity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Quantity = 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 awsRestxml_deserializeDocumentContinuousDeploymentPolicySummary(v **types.ContinuousDeploymentPolicySummary, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ContinuousDeploymentPolicySummary + if *v == nil { + sv = &types.ContinuousDeploymentPolicySummary{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("ContinuousDeploymentPolicy", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicy(&sv.ContinuousDeploymentPolicy, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentContinuousDeploymentPolicySummaryList(v *[]types.ContinuousDeploymentPolicySummary, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.ContinuousDeploymentPolicySummary + if *v == nil { + sv = make([]types.ContinuousDeploymentPolicySummary, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("ContinuousDeploymentPolicySummary", t.Name.Local): + var col types.ContinuousDeploymentPolicySummary + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicySummary(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsRestxml_deserializeDocumentContinuousDeploymentPolicySummaryListUnwrapped(v *[]types.ContinuousDeploymentPolicySummary, decoder smithyxml.NodeDecoder) error { + var sv []types.ContinuousDeploymentPolicySummary + if *v == nil { + sv = make([]types.ContinuousDeploymentPolicySummary, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.ContinuousDeploymentPolicySummary + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsRestxml_deserializeDocumentContinuousDeploymentPolicySummary(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsRestxml_deserializeDocumentContinuousDeploymentSingleHeaderConfig(v **types.ContinuousDeploymentSingleHeaderConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ContinuousDeploymentSingleHeaderConfig + if *v == nil { + sv = &types.ContinuousDeploymentSingleHeaderConfig{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Header", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Header = 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 awsRestxml_deserializeDocumentContinuousDeploymentSingleWeightConfig(v **types.ContinuousDeploymentSingleWeightConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.ContinuousDeploymentSingleWeightConfig + if *v == nil { + sv = &types.ContinuousDeploymentSingleWeightConfig{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("SessionStickinessConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentSessionStickinessConfig(&sv.SessionStickinessConfig, nodeDecoder); err != nil { + return err + } + + 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.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 awsRestxml_deserializeDocumentCookieNameList(v *[]string, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -38396,6 +40111,76 @@ func awsRestxml_deserializeDocumentS3OriginConfig(v **types.S3OriginConfig, deco return nil } +func awsRestxml_deserializeDocumentSessionStickinessConfig(v **types.SessionStickinessConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.SessionStickinessConfig + if *v == nil { + sv = &types.SessionStickinessConfig{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("IdleTTL", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.IdleTTL = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("MaximumTTL", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.MaximumTTL = 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 awsRestxml_deserializeDocumentSigner(v **types.Signer, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -38599,6 +40384,194 @@ func awsRestxml_deserializeDocumentSslProtocolsListUnwrapped(v *[]types.SslProto *v = sv return nil } +func awsRestxml_deserializeDocumentStagingDistributionDnsNameList(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("DnsName", 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 awsRestxml_deserializeDocumentStagingDistributionDnsNameListUnwrapped(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 awsRestxml_deserializeDocumentStagingDistributionDnsNames(v **types.StagingDistributionDnsNames, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.StagingDistributionDnsNames + if *v == nil { + sv = &types.StagingDistributionDnsNames{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("Items", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentStagingDistributionDnsNameList(&sv.Items, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("Quantity", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.Quantity = 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 awsRestxml_deserializeDocumentStagingDistributionInUse(v **types.StagingDistributionInUse, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.StagingDistributionInUse + if *v == nil { + sv = &types.StagingDistributionInUse{} + } else { + sv = *v + } + + for { + t, 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 awsRestxml_deserializeDocumentStatusCodeList(v *[]int32, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -42263,6 +44236,67 @@ func awsRestxml_deserializeDocumentTooManyTrustedSigners(v **types.TooManyTruste return nil } +func awsRestxml_deserializeDocumentTrafficConfig(v **types.TrafficConfig, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TrafficConfig + if *v == nil { + sv = &types.TrafficConfig{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("SingleHeaderConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentContinuousDeploymentSingleHeaderConfig(&sv.SingleHeaderConfig, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("SingleWeightConfig", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsRestxml_deserializeDocumentContinuousDeploymentSingleWeightConfig(&sv.SingleWeightConfig, 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.ContinuousDeploymentPolicyType(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsRestxml_deserializeDocumentTrustedKeyGroupDoesNotExist(v **types.TrustedKeyGroupDoesNotExist, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/cloudfront/generated.json b/service/cloudfront/generated.json index 7456a264a46..2c5cb9dcf82 100644 --- a/service/cloudfront/generated.json +++ b/service/cloudfront/generated.json @@ -10,8 +10,10 @@ "api_client.go", "api_client_test.go", "api_op_AssociateAlias.go", + "api_op_CopyDistribution.go", "api_op_CreateCachePolicy.go", "api_op_CreateCloudFrontOriginAccessIdentity.go", + "api_op_CreateContinuousDeploymentPolicy.go", "api_op_CreateDistribution.go", "api_op_CreateDistributionWithTags.go", "api_op_CreateFieldLevelEncryptionConfig.go", @@ -29,6 +31,7 @@ "api_op_CreateStreamingDistributionWithTags.go", "api_op_DeleteCachePolicy.go", "api_op_DeleteCloudFrontOriginAccessIdentity.go", + "api_op_DeleteContinuousDeploymentPolicy.go", "api_op_DeleteDistribution.go", "api_op_DeleteFieldLevelEncryptionConfig.go", "api_op_DeleteFieldLevelEncryptionProfile.go", @@ -46,6 +49,8 @@ "api_op_GetCachePolicyConfig.go", "api_op_GetCloudFrontOriginAccessIdentity.go", "api_op_GetCloudFrontOriginAccessIdentityConfig.go", + "api_op_GetContinuousDeploymentPolicy.go", + "api_op_GetContinuousDeploymentPolicyConfig.go", "api_op_GetDistribution.go", "api_op_GetDistributionConfig.go", "api_op_GetFieldLevelEncryption.go", @@ -71,6 +76,7 @@ "api_op_ListCachePolicies.go", "api_op_ListCloudFrontOriginAccessIdentities.go", "api_op_ListConflictingAliases.go", + "api_op_ListContinuousDeploymentPolicies.go", "api_op_ListDistributions.go", "api_op_ListDistributionsByCachePolicyId.go", "api_op_ListDistributionsByKeyGroup.go", @@ -96,6 +102,7 @@ "api_op_UntagResource.go", "api_op_UpdateCachePolicy.go", "api_op_UpdateCloudFrontOriginAccessIdentity.go", + "api_op_UpdateContinuousDeploymentPolicy.go", "api_op_UpdateDistribution.go", "api_op_UpdateFieldLevelEncryptionConfig.go", "api_op_UpdateFieldLevelEncryptionProfile.go", diff --git a/service/cloudfront/serializers.go b/service/cloudfront/serializers.go index e32401a8909..3f034831219 100644 --- a/service/cloudfront/serializers.go +++ b/service/cloudfront/serializers.go @@ -77,6 +77,108 @@ func awsRestxml_serializeOpHttpBindingsAssociateAliasInput(v *AssociateAliasInpu return nil } +type awsRestxml_serializeOpCopyDistribution struct { +} + +func (*awsRestxml_serializeOpCopyDistribution) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCopyDistribution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CopyDistributionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/distribution/{PrimaryDistributionId}/copy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsCopyDistributionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/xml") + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CopyDistributionRequest", + }, + Attr: rootAttr, + } + root.Attr = append(root.Attr, smithyxml.NewNamespaceAttribute("", "http://cloudfront.amazonaws.com/doc/2020-05-31/")) + if err := awsRestxml_serializeOpDocumentCopyDistributionInput(input, xmlEncoder.RootElement(root)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + if request, err = request.SetStream(bytes.NewReader(xmlEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsCopyDistributionInput(v *CopyDistributionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.IfMatch != nil && len(*v.IfMatch) > 0 { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.PrimaryDistributionId == nil || len(*v.PrimaryDistributionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member PrimaryDistributionId must not be empty")} + } + if v.PrimaryDistributionId != nil { + if err := encoder.SetURI("PrimaryDistributionId").String(*v.PrimaryDistributionId); err != nil { + return err + } + } + + if v.Staging != nil { + locationName := "Staging" + encoder.SetHeader(locationName).Boolean(*v.Staging) + } + + return nil +} + +func awsRestxml_serializeOpDocumentCopyDistributionInput(v *CopyDistributionInput, value smithyxml.Value) error { + defer value.Close() + if v.CallerReference != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "CallerReference", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.CallerReference) + } + return nil +} + type awsRestxml_serializeOpCreateCachePolicy struct { } @@ -215,6 +317,75 @@ func awsRestxml_serializeOpHttpBindingsCreateCloudFrontOriginAccessIdentityInput return nil } +type awsRestxml_serializeOpCreateContinuousDeploymentPolicy struct { +} + +func (*awsRestxml_serializeOpCreateContinuousDeploymentPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpCreateContinuousDeploymentPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateContinuousDeploymentPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/continuous-deployment-policy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if input.ContinuousDeploymentPolicyConfig != nil { + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/xml") + } + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + payloadRootAttr := []smithyxml.Attr{} + payloadRoot := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ContinuousDeploymentPolicyConfig", + }, + Attr: payloadRootAttr, + } + payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://cloudfront.amazonaws.com/doc/2020-05-31/")) + if err := awsRestxml_serializeDocumentContinuousDeploymentPolicyConfig(input.ContinuousDeploymentPolicyConfig, xmlEncoder.RootElement(payloadRoot)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + payload := bytes.NewReader(xmlEncoder.Bytes()) + if request, err = request.SetStream(payload); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsCreateContinuousDeploymentPolicyInput(v *CreateContinuousDeploymentPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + type awsRestxml_serializeOpCreateDistribution struct { } @@ -1483,6 +1654,69 @@ func awsRestxml_serializeOpHttpBindingsDeleteCloudFrontOriginAccessIdentityInput return nil } +type awsRestxml_serializeOpDeleteContinuousDeploymentPolicy struct { +} + +func (*awsRestxml_serializeOpDeleteContinuousDeploymentPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpDeleteContinuousDeploymentPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteContinuousDeploymentPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/continuous-deployment-policy/{Id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsDeleteContinuousDeploymentPolicyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsDeleteContinuousDeploymentPolicyInput(v *DeleteContinuousDeploymentPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + if v.IfMatch != nil && len(*v.IfMatch) > 0 { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + return nil +} + type awsRestxml_serializeOpDeleteDistribution struct { } @@ -2555,6 +2789,122 @@ func awsRestxml_serializeOpHttpBindingsGetCloudFrontOriginAccessIdentityConfigIn return nil } +type awsRestxml_serializeOpGetContinuousDeploymentPolicy struct { +} + +func (*awsRestxml_serializeOpGetContinuousDeploymentPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpGetContinuousDeploymentPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetContinuousDeploymentPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/continuous-deployment-policy/{Id}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsGetContinuousDeploymentPolicyInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsGetContinuousDeploymentPolicyInput(v *GetContinuousDeploymentPolicyInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + +type awsRestxml_serializeOpGetContinuousDeploymentPolicyConfig struct { +} + +func (*awsRestxml_serializeOpGetContinuousDeploymentPolicyConfig) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpGetContinuousDeploymentPolicyConfig) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetContinuousDeploymentPolicyConfigInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/continuous-deployment-policy/{Id}/config") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsGetContinuousDeploymentPolicyConfigInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsGetContinuousDeploymentPolicyConfigInput(v *GetContinuousDeploymentPolicyConfigInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + return nil +} + type awsRestxml_serializeOpGetDistribution struct { } @@ -4059,6 +4409,63 @@ func awsRestxml_serializeOpHttpBindingsListConflictingAliasesInput(v *ListConfli return nil } +type awsRestxml_serializeOpListContinuousDeploymentPolicies struct { +} + +func (*awsRestxml_serializeOpListContinuousDeploymentPolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpListContinuousDeploymentPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListContinuousDeploymentPoliciesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/continuous-deployment-policy") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsListContinuousDeploymentPoliciesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsListContinuousDeploymentPoliciesInput(v *ListContinuousDeploymentPoliciesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Marker != nil { + encoder.SetQuery("Marker").String(*v.Marker) + } + + if v.MaxItems != nil { + encoder.SetQuery("MaxItems").Integer(*v.MaxItems) + } + + return nil +} + type awsRestxml_serializeOpListDistributions struct { } @@ -5510,11 +5917,88 @@ func awsRestxml_serializeOpDocumentTestFunctionInput(v *TestFunctionInput, value type awsRestxml_serializeOpUntagResource struct { } -func (*awsRestxml_serializeOpUntagResource) ID() string { +func (*awsRestxml_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestxml_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/tagging?Operation=Untag") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestxml_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if input.TagKeys != nil { + if !restEncoder.HasHeader("Content-Type") { + ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) + restEncoder.SetHeader("Content-Type").String("application/xml") + } + + xmlEncoder := smithyxml.NewEncoder(bytes.NewBuffer(nil)) + payloadRootAttr := []smithyxml.Attr{} + payloadRoot := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "TagKeys", + }, + Attr: payloadRootAttr, + } + payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://cloudfront.amazonaws.com/doc/2020-05-31/")) + if err := awsRestxml_serializeDocumentTagKeys(input.TagKeys, xmlEncoder.RootElement(payloadRoot)); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + payload := bytes.NewReader(xmlEncoder.Bytes()) + if request, err = request.SetStream(payload); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestxml_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Resource != nil { + encoder.SetQuery("Resource").String(*v.Resource) + } + + return nil +} + +type awsRestxml_serializeOpUpdateCachePolicy struct { +} + +func (*awsRestxml_serializeOpUpdateCachePolicy) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpUpdateCachePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -5522,26 +6006,26 @@ func (m *awsRestxml_serializeOpUntagResource) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UntagResourceInput) + input, ok := in.Parameters.(*UpdateCachePolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/2020-05-31/tagging?Operation=Untag") + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/cache-policy/{Id}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "POST" + request.Method = "PUT" restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) if err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsUpdateCachePolicyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if input.TagKeys != nil { + if input.CachePolicyConfig != nil { if !restEncoder.HasHeader("Content-Type") { ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) restEncoder.SetHeader("Content-Type").String("application/xml") @@ -5551,12 +6035,12 @@ func (m *awsRestxml_serializeOpUntagResource) HandleSerialize(ctx context.Contex payloadRootAttr := []smithyxml.Attr{} payloadRoot := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "TagKeys", + Local: "CachePolicyConfig", }, Attr: payloadRootAttr, } payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://cloudfront.amazonaws.com/doc/2020-05-31/")) - if err := awsRestxml_serializeDocumentTagKeys(input.TagKeys, xmlEncoder.RootElement(payloadRoot)); err != nil { + if err := awsRestxml_serializeDocumentCachePolicyConfig(input.CachePolicyConfig, xmlEncoder.RootElement(payloadRoot)); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } payload := bytes.NewReader(xmlEncoder.Bytes()) @@ -5572,26 +6056,36 @@ func (m *awsRestxml_serializeOpUntagResource) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsUpdateCachePolicyInput(v *UpdateCachePolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.Resource != nil { - encoder.SetQuery("Resource").String(*v.Resource) + if v.Id == nil || len(*v.Id) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member Id must not be empty")} + } + if v.Id != nil { + if err := encoder.SetURI("Id").String(*v.Id); err != nil { + return err + } + } + + if v.IfMatch != nil && len(*v.IfMatch) > 0 { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) } return nil } -type awsRestxml_serializeOpUpdateCachePolicy struct { +type awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity struct { } -func (*awsRestxml_serializeOpUpdateCachePolicy) ID() string { +func (*awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpUpdateCachePolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -5599,13 +6093,13 @@ func (m *awsRestxml_serializeOpUpdateCachePolicy) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateCachePolicyInput) + input, ok := in.Parameters.(*UpdateCloudFrontOriginAccessIdentityInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/2020-05-31/cache-policy/{Id}") + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/origin-access-identity/cloudfront/{Id}/config") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" @@ -5614,11 +6108,11 @@ func (m *awsRestxml_serializeOpUpdateCachePolicy) HandleSerialize(ctx context.Co return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsUpdateCachePolicyInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if input.CachePolicyConfig != nil { + if input.CloudFrontOriginAccessIdentityConfig != nil { if !restEncoder.HasHeader("Content-Type") { ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) restEncoder.SetHeader("Content-Type").String("application/xml") @@ -5628,12 +6122,12 @@ func (m *awsRestxml_serializeOpUpdateCachePolicy) HandleSerialize(ctx context.Co payloadRootAttr := []smithyxml.Attr{} payloadRoot := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "CachePolicyConfig", + Local: "CloudFrontOriginAccessIdentityConfig", }, Attr: payloadRootAttr, } payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://cloudfront.amazonaws.com/doc/2020-05-31/")) - if err := awsRestxml_serializeDocumentCachePolicyConfig(input.CachePolicyConfig, xmlEncoder.RootElement(payloadRoot)); err != nil { + if err := awsRestxml_serializeDocumentCloudFrontOriginAccessIdentityConfig(input.CloudFrontOriginAccessIdentityConfig, xmlEncoder.RootElement(payloadRoot)); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } payload := bytes.NewReader(xmlEncoder.Bytes()) @@ -5649,7 +6143,7 @@ func (m *awsRestxml_serializeOpUpdateCachePolicy) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsUpdateCachePolicyInput(v *UpdateCachePolicyInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityInput(v *UpdateCloudFrontOriginAccessIdentityInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -5671,14 +6165,14 @@ func awsRestxml_serializeOpHttpBindingsUpdateCachePolicyInput(v *UpdateCachePoli return nil } -type awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity struct { +type awsRestxml_serializeOpUpdateContinuousDeploymentPolicy struct { } -func (*awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity) ID() string { +func (*awsRestxml_serializeOpUpdateContinuousDeploymentPolicy) ID() string { return "OperationSerializer" } -func (m *awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestxml_serializeOpUpdateContinuousDeploymentPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { request, ok := in.Request.(*smithyhttp.Request) @@ -5686,13 +6180,13 @@ func (m *awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity) HandleSeria return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateCloudFrontOriginAccessIdentityInput) + input, ok := in.Parameters.(*UpdateContinuousDeploymentPolicyInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/2020-05-31/origin-access-identity/cloudfront/{Id}/config") + opPath, opQuery := httpbinding.SplitURI("/2020-05-31/continuous-deployment-policy/{Id}") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "PUT" @@ -5701,11 +6195,11 @@ func (m *awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity) HandleSeria return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestxml_serializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityInput(input, restEncoder); err != nil { + if err := awsRestxml_serializeOpHttpBindingsUpdateContinuousDeploymentPolicyInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } - if input.CloudFrontOriginAccessIdentityConfig != nil { + if input.ContinuousDeploymentPolicyConfig != nil { if !restEncoder.HasHeader("Content-Type") { ctx = smithyhttp.SetIsContentTypeDefaultValue(ctx, true) restEncoder.SetHeader("Content-Type").String("application/xml") @@ -5715,12 +6209,12 @@ func (m *awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity) HandleSeria payloadRootAttr := []smithyxml.Attr{} payloadRoot := smithyxml.StartElement{ Name: smithyxml.Name{ - Local: "CloudFrontOriginAccessIdentityConfig", + Local: "ContinuousDeploymentPolicyConfig", }, Attr: payloadRootAttr, } payloadRoot.Attr = append(payloadRoot.Attr, smithyxml.NewNamespaceAttribute("", "http://cloudfront.amazonaws.com/doc/2020-05-31/")) - if err := awsRestxml_serializeDocumentCloudFrontOriginAccessIdentityConfig(input.CloudFrontOriginAccessIdentityConfig, xmlEncoder.RootElement(payloadRoot)); err != nil { + if err := awsRestxml_serializeDocumentContinuousDeploymentPolicyConfig(input.ContinuousDeploymentPolicyConfig, xmlEncoder.RootElement(payloadRoot)); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } payload := bytes.NewReader(xmlEncoder.Bytes()) @@ -5736,7 +6230,7 @@ func (m *awsRestxml_serializeOpUpdateCloudFrontOriginAccessIdentity) HandleSeria return next.HandleSerialize(ctx, in) } -func awsRestxml_serializeOpHttpBindingsUpdateCloudFrontOriginAccessIdentityInput(v *UpdateCloudFrontOriginAccessIdentityInput, encoder *httpbinding.Encoder) error { +func awsRestxml_serializeOpHttpBindingsUpdateContinuousDeploymentPolicyInput(v *UpdateContinuousDeploymentPolicyInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -7580,6 +8074,117 @@ func awsRestxml_serializeDocumentContentTypeProfiles(v *types.ContentTypeProfile return nil } +func awsRestxml_serializeDocumentContinuousDeploymentPolicyConfig(v *types.ContinuousDeploymentPolicyConfig, value smithyxml.Value) error { + defer value.Close() + if v.Enabled != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Enabled", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Boolean(*v.Enabled) + } + if v.StagingDistributionDnsNames != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "StagingDistributionDnsNames", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentStagingDistributionDnsNames(v.StagingDistributionDnsNames, el); err != nil { + return err + } + } + if v.TrafficConfig != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "TrafficConfig", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentTrafficConfig(v.TrafficConfig, el); err != nil { + return err + } + } + return nil +} + +func awsRestxml_serializeDocumentContinuousDeploymentSingleHeaderConfig(v *types.ContinuousDeploymentSingleHeaderConfig, value smithyxml.Value) error { + defer value.Close() + if v.Header != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Header", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Header) + } + if v.Value != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Value", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.Value) + } + return nil +} + +func awsRestxml_serializeDocumentContinuousDeploymentSingleWeightConfig(v *types.ContinuousDeploymentSingleWeightConfig, value smithyxml.Value) error { + defer value.Close() + if v.SessionStickinessConfig != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "SessionStickinessConfig", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentSessionStickinessConfig(v.SessionStickinessConfig, el); err != nil { + return err + } + } + if v.Weight != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Weight", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + switch { + case math.IsNaN(float64(*v.Weight)): + el.String("NaN") + + case math.IsInf(float64(*v.Weight), 1): + el.String("Infinity") + + case math.IsInf(float64(*v.Weight), -1): + el.String("-Infinity") + + default: + el.Float(*v.Weight) + + } + } + return nil +} + func awsRestxml_serializeDocumentCookieNameList(v []string, value smithyxml.Value) error { var array *smithyxml.Array if !value.IsFlattened() { @@ -10993,6 +11598,33 @@ func awsRestxml_serializeDocumentS3OriginConfig(v *types.S3OriginConfig, value s return nil } +func awsRestxml_serializeDocumentSessionStickinessConfig(v *types.SessionStickinessConfig, value smithyxml.Value) error { + defer value.Close() + if v.IdleTTL != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "IdleTTL", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Integer(*v.IdleTTL) + } + if v.MaximumTTL != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "MaximumTTL", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Integer(*v.MaximumTTL) + } + return nil +} + func awsRestxml_serializeDocumentSslProtocolsList(v []types.SslProtocol, value smithyxml.Value) error { var array *smithyxml.Array if !value.IsFlattened() { @@ -11013,6 +11645,55 @@ func awsRestxml_serializeDocumentSslProtocolsList(v []types.SslProtocol, value s return nil } +func awsRestxml_serializeDocumentStagingDistributionDnsNameList(v []string, value smithyxml.Value) error { + var array *smithyxml.Array + if !value.IsFlattened() { + defer value.Close() + } + customMemberNameAttr := []smithyxml.Attr{} + customMemberName := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "DnsName", + }, + Attr: customMemberNameAttr, + } + array = value.ArrayWithCustomName(customMemberName) + for i := range v { + am := array.Member() + am.String(v[i]) + } + return nil +} + +func awsRestxml_serializeDocumentStagingDistributionDnsNames(v *types.StagingDistributionDnsNames, value smithyxml.Value) error { + defer value.Close() + if v.Items != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Items", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentStagingDistributionDnsNameList(v.Items, el); err != nil { + return err + } + } + if v.Quantity != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Quantity", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Integer(*v.Quantity) + } + return nil +} + func awsRestxml_serializeDocumentStatusCodeList(v []int32, value smithyxml.Value) error { var array *smithyxml.Array if !value.IsFlattened() { @@ -11337,6 +12018,48 @@ func awsRestxml_serializeDocumentTags(v *types.Tags, value smithyxml.Value) erro return nil } +func awsRestxml_serializeDocumentTrafficConfig(v *types.TrafficConfig, value smithyxml.Value) error { + defer value.Close() + if v.SingleHeaderConfig != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "SingleHeaderConfig", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentContinuousDeploymentSingleHeaderConfig(v.SingleHeaderConfig, el); err != nil { + return err + } + } + if v.SingleWeightConfig != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "SingleWeightConfig", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + if err := awsRestxml_serializeDocumentContinuousDeploymentSingleWeightConfig(v.SingleWeightConfig, el); err != nil { + return err + } + } + if len(v.Type) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Type", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.Type)) + } + return nil +} + func awsRestxml_serializeDocumentTrustedKeyGroupIdList(v []string, value smithyxml.Value) error { var array *smithyxml.Array if !value.IsFlattened() { diff --git a/service/cloudfront/types/enums.go b/service/cloudfront/types/enums.go index 51eda84f92c..b5a0dfaed48 100644 --- a/service/cloudfront/types/enums.go +++ b/service/cloudfront/types/enums.go @@ -103,6 +103,25 @@ func (CertificateSource) Values() []CertificateSource { } } +type ContinuousDeploymentPolicyType string + +// Enum values for ContinuousDeploymentPolicyType +const ( + ContinuousDeploymentPolicyTypeSingleWeight ContinuousDeploymentPolicyType = "SingleWeight" + ContinuousDeploymentPolicyTypeSingleHeader ContinuousDeploymentPolicyType = "SingleHeader" +) + +// Values returns all known values for ContinuousDeploymentPolicyType. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. The ordering of this slice is not guaranteed to be stable across +// updates. +func (ContinuousDeploymentPolicyType) Values() []ContinuousDeploymentPolicyType { + return []ContinuousDeploymentPolicyType{ + "SingleWeight", + "SingleHeader", + } +} + type EventType string // Enum values for EventType diff --git a/service/cloudfront/types/errors.go b/service/cloudfront/types/errors.go index 851f575bd10..b0e0ef8723e 100644 --- a/service/cloudfront/types/errors.go +++ b/service/cloudfront/types/errors.go @@ -1664,6 +1664,25 @@ func (e *ResponseHeadersPolicyInUse) ErrorMessage() string { func (e *ResponseHeadersPolicyInUse) ErrorCode() string { return "ResponseHeadersPolicyInUse" } func (e *ResponseHeadersPolicyInUse) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// A continuous deployment policy for this staging distribution already exists. +type StagingDistributionInUse struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *StagingDistributionInUse) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *StagingDistributionInUse) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *StagingDistributionInUse) ErrorCode() string { return "StagingDistributionInUse" } +func (e *StagingDistributionInUse) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The caller reference you attempted to create the streaming distribution with is // associated with another distribution type StreamingDistributionAlreadyExists struct { diff --git a/service/cloudfront/types/types.go b/service/cloudfront/types/types.go index 2f3e4dc1426..0ac312f316c 100644 --- a/service/cloudfront/types/types.go +++ b/service/cloudfront/types/types.go @@ -925,6 +925,126 @@ type ContentTypeProfiles struct { noSmithyDocumentSerde } +// A continuous deployment policy. +type ContinuousDeploymentPolicy struct { + + // Contains the configuration for a continuous deployment policy. + // + // This member is required. + ContinuousDeploymentPolicyConfig *ContinuousDeploymentPolicyConfig + + // The identifier of the continuous deployment policy. + // + // This member is required. + Id *string + + // The date and time the continuous deployment policy was last modified. + // + // This member is required. + LastModifiedTime *time.Time + + noSmithyDocumentSerde +} + +// Contains the configuration for a continuous deployment policy. +type ContinuousDeploymentPolicyConfig struct { + + // A Boolean that indicates whether this continuous deployment policy is enabled + // (in effect). When this value is true, this policy is enabled and in effect. When + // this value is false, this policy is not enabled and has no effect. + // + // This member is required. + Enabled *bool + + // The CloudFront domain name of the staging distribution. For example: + // d111111abcdef8.cloudfront.net. + // + // This member is required. + StagingDistributionDnsNames *StagingDistributionDnsNames + + // Contains the parameters for routing production traffic from your primary to + // staging distributions. + TrafficConfig *TrafficConfig + + noSmithyDocumentSerde +} + +// Contains a list of continuous deployment policies. +type ContinuousDeploymentPolicyList struct { + + // The maximum number of continuous deployment policies that were specified in your + // request. + // + // This member is required. + MaxItems *int32 + + // The total number of continuous deployment policies in your Amazon Web Services + // account, regardless of the MaxItems value. + // + // This member is required. + Quantity *int32 + + // A list of continuous deployment policy items. + Items []ContinuousDeploymentPolicySummary + + // Indicates the next page of continuous deployment policies. To get the next page + // of the list, use this value in the Marker field of your request. + NextMarker *string + + noSmithyDocumentSerde +} + +// A summary of the information about your continuous deployment policies. +type ContinuousDeploymentPolicySummary struct { + + // The continuous deployment policy. + // + // This member is required. + ContinuousDeploymentPolicy *ContinuousDeploymentPolicy + + noSmithyDocumentSerde +} + +// This configuration determines which HTTP requests are sent to the staging +// distribution. If the HTTP request contains a header and value that matches what +// you specify here, the request is sent to the staging distribution. Otherwise the +// request is sent to the primary distribution. +type ContinuousDeploymentSingleHeaderConfig struct { + + // The request header name that you want CloudFront to send to your staging + // distribution. + // + // This member is required. + Header *string + + // The request header value. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Contains the percentage of traffic to send to a staging distribution, expressed +// as a decimal number between 0 and 1. +type ContinuousDeploymentSingleWeightConfig struct { + + // The percentage of traffic to send to the staging distribution, expressed as a + // decimal number between 0 and 1. + // + // This member is required. + Weight *float32 + + // Session stickiness provides the ability to define multiple requests from a + // single viewer as a single session. This prevents the potentially inconsistent + // experience of sending some of a given user's requests to your staging + // distribution, while others are sent to your primary distribution. Define the + // session duration using TTL values. + SessionStickinessConfig *SessionStickinessConfig + + noSmithyDocumentSerde +} + // Contains a list of cookie names. type CookieNames struct { @@ -1401,26 +1521,23 @@ type DefaultCacheBehavior struct { // the details about how to track and manage content delivery. type Distribution struct { - // The ARN (Amazon Resource Name) for the distribution. For example: - // arn:aws:cloudfront::123456789012:distribution/EDFDVBD632BHDS5, where - // 123456789012 is your Amazon Web Services account ID. + // The distribution’s Amazon Resource Name (ARN). // // This member is required. ARN *string - // The current configuration information for the distribution. Send a GET request - // to the /CloudFront API version/distribution ID/config resource. + // The distribution’s configuration. // // This member is required. DistributionConfig *DistributionConfig - // The domain name corresponding to the distribution, for example, + // The distribution’s CloudFront domain name. For example: // d111111abcdef8.cloudfront.net. // // This member is required. DomainName *string - // The identifier for the distribution. For example: EDFDVBD632BHDS5. + // The distribution’s identifier. For example: E1U5RQF7T870K0. // // This member is required. Id *string @@ -1430,14 +1547,13 @@ type Distribution struct { // This member is required. InProgressInvalidationBatches *int32 - // The date and time the distribution was last modified. + // The date and time when the distribution was last modified. // // This member is required. LastModifiedTime *time.Time - // This response element indicates the current status of the distribution. When the - // status is Deployed, the distribution's information is fully propagated to all - // CloudFront edge locations. + // The distribution’s status. When the status is Deployed, the distribution’s + // information is fully propagated to all CloudFront edge locations. // // This member is required. Status *string @@ -1530,8 +1646,8 @@ type DistributionConfig struct { // The object that you want CloudFront to request from your origin (for example, // index.html) when a viewer requests the root URL for your distribution - // (http://www.example.com) instead of an object in your distribution - // (http://www.example.com/product-description.html). Specifying a default root + // (https://www.example.com) instead of an object in your distribution + // (https://www.example.com/product-description.html). Specifying a default root // object avoids exposing the contents of your distribution. Specify only the // object name, for example, index.html. Don't add a / before the object name. If // you don't want to specify a default root object when you create a distribution, @@ -2914,11 +3030,6 @@ type OriginAccessControl struct { // A CloudFront origin access control configuration. type OriginAccessControlConfig struct { - // A description of the origin access control. - // - // This member is required. - Description *string - // A name to identify the origin access control. // // This member is required. @@ -2964,6 +3075,9 @@ type OriginAccessControlConfig struct { // This member is required. SigningProtocol OriginAccessControlSigningProtocols + // A description of the origin access control. + Description *string + noSmithyDocumentSerde } @@ -4498,6 +4612,30 @@ type S3OriginConfig struct { noSmithyDocumentSerde } +// Session stickiness provides the ability to define multiple requests from a +// single viewer as a single session. This prevents the potentially inconsistent +// experience of sending some of a given user's requests to your staging +// distribution, while others are sent to your primary distribution. Define the +// session duration using TTL values. +type SessionStickinessConfig struct { + + // The amount of time after which you want sessions to cease if no requests are + // received.
Allowed values are 300–3600 seconds (5–60 minutes). The value must be + // less than or equal to MaximumTTL. + // + // This member is required. + IdleTTL *int32 + + // The maximum amount of time to consider requests from the viewer as being part of + // the same session. Allowed values are 300–3600 seconds (5–60 minutes). The value + // must be less than or equal to IdleTTL. + // + // This member is required. + MaximumTTL *int32 + + noSmithyDocumentSerde +} + // A list of Amazon Web Services accounts and the active CloudFront key pairs in // each account that CloudFront can use to verify the signatures of signed URLs and // signed cookies. @@ -4515,6 +4653,20 @@ type Signer struct { noSmithyDocumentSerde } +// The CloudFront domain name of the staging distribution. +type StagingDistributionDnsNames struct { + + // The number of CloudFront domain names in your staging distribution. + // + // This member is required. + Quantity *int32 + + // The CloudFront domain name of the staging distribution. + Items []string + + noSmithyDocumentSerde +} + // A complex data type for the status codes that you specify that, when returned by // a primary origin, trigger CloudFront to failover to a second origin. type StatusCodes struct { @@ -4874,6 +5026,23 @@ type TestResult struct { noSmithyDocumentSerde } +// The traffic configuration of your continuous deployment. +type TrafficConfig struct { + + // The type of traffic configuration. + // + // This member is required. + Type ContinuousDeploymentPolicyType + + // Determines which HTTP requests are sent to the staging distribution. + SingleHeaderConfig *ContinuousDeploymentSingleHeaderConfig + + // Contains the percentage of traffic to send to the staging distribution. + SingleWeightConfig *ContinuousDeploymentSingleWeightConfig + + noSmithyDocumentSerde +} + // A list of key groups whose public keys CloudFront can use to verify the // signatures of signed URLs and signed cookies. type TrustedKeyGroups struct { diff --git a/service/cloudfront/validators.go b/service/cloudfront/validators.go index 3ed374dbebc..cacf8e8128b 100644 --- a/service/cloudfront/validators.go +++ b/service/cloudfront/validators.go @@ -30,6 +30,26 @@ func (m *validateOpAssociateAlias) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpCopyDistribution struct { +} + +func (*validateOpCopyDistribution) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCopyDistribution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CopyDistributionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCopyDistributionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateCachePolicy struct { } @@ -70,6 +90,26 @@ func (m *validateOpCreateCloudFrontOriginAccessIdentity) HandleInitialize(ctx co return next.HandleInitialize(ctx, in) } +type validateOpCreateContinuousDeploymentPolicy struct { +} + +func (*validateOpCreateContinuousDeploymentPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateContinuousDeploymentPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateContinuousDeploymentPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateContinuousDeploymentPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateDistribution struct { } @@ -410,6 +450,26 @@ func (m *validateOpDeleteCloudFrontOriginAccessIdentity) HandleInitialize(ctx co return next.HandleInitialize(ctx, in) } +type validateOpDeleteContinuousDeploymentPolicy struct { +} + +func (*validateOpDeleteContinuousDeploymentPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteContinuousDeploymentPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteContinuousDeploymentPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteContinuousDeploymentPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDistribution struct { } @@ -730,6 +790,46 @@ func (m *validateOpGetCloudFrontOriginAccessIdentity) HandleInitialize(ctx conte return next.HandleInitialize(ctx, in) } +type validateOpGetContinuousDeploymentPolicyConfig struct { +} + +func (*validateOpGetContinuousDeploymentPolicyConfig) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetContinuousDeploymentPolicyConfig) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetContinuousDeploymentPolicyConfigInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetContinuousDeploymentPolicyConfigInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetContinuousDeploymentPolicy struct { +} + +func (*validateOpGetContinuousDeploymentPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetContinuousDeploymentPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetContinuousDeploymentPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetContinuousDeploymentPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetDistributionConfig struct { } @@ -1430,6 +1530,26 @@ func (m *validateOpUpdateCloudFrontOriginAccessIdentity) HandleInitialize(ctx co return next.HandleInitialize(ctx, in) } +type validateOpUpdateContinuousDeploymentPolicy struct { +} + +func (*validateOpUpdateContinuousDeploymentPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateContinuousDeploymentPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateContinuousDeploymentPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateContinuousDeploymentPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateDistribution struct { } @@ -1654,6 +1774,10 @@ func addOpAssociateAliasValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpAssociateAlias{}, middleware.After) } +func addOpCopyDistributionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCopyDistribution{}, middleware.After) +} + func addOpCreateCachePolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCachePolicy{}, middleware.After) } @@ -1662,6 +1786,10 @@ func addOpCreateCloudFrontOriginAccessIdentityValidationMiddleware(stack *middle return stack.Initialize.Add(&validateOpCreateCloudFrontOriginAccessIdentity{}, middleware.After) } +func addOpCreateContinuousDeploymentPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateContinuousDeploymentPolicy{}, middleware.After) +} + func addOpCreateDistributionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDistribution{}, middleware.After) } @@ -1730,6 +1858,10 @@ func addOpDeleteCloudFrontOriginAccessIdentityValidationMiddleware(stack *middle return stack.Initialize.Add(&validateOpDeleteCloudFrontOriginAccessIdentity{}, middleware.After) } +func addOpDeleteContinuousDeploymentPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteContinuousDeploymentPolicy{}, middleware.After) +} + func addOpDeleteDistributionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDistribution{}, middleware.After) } @@ -1794,6 +1926,14 @@ func addOpGetCloudFrontOriginAccessIdentityValidationMiddleware(stack *middlewar return stack.Initialize.Add(&validateOpGetCloudFrontOriginAccessIdentity{}, middleware.After) } +func addOpGetContinuousDeploymentPolicyConfigValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetContinuousDeploymentPolicyConfig{}, middleware.After) +} + +func addOpGetContinuousDeploymentPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetContinuousDeploymentPolicy{}, middleware.After) +} + func addOpGetDistributionConfigValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDistributionConfig{}, middleware.After) } @@ -1934,6 +2074,10 @@ func addOpUpdateCloudFrontOriginAccessIdentityValidationMiddleware(stack *middle return stack.Initialize.Add(&validateOpUpdateCloudFrontOriginAccessIdentity{}, middleware.After) } +func addOpUpdateContinuousDeploymentPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateContinuousDeploymentPolicy{}, middleware.After) +} + func addOpUpdateDistributionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateDistribution{}, middleware.After) } @@ -2298,6 +2442,71 @@ func validateContentTypeProfiles(v *types.ContentTypeProfiles) error { } } +func validateContinuousDeploymentPolicyConfig(v *types.ContinuousDeploymentPolicyConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ContinuousDeploymentPolicyConfig"} + if v.StagingDistributionDnsNames == nil { + invalidParams.Add(smithy.NewErrParamRequired("StagingDistributionDnsNames")) + } else if v.StagingDistributionDnsNames != nil { + if err := validateStagingDistributionDnsNames(v.StagingDistributionDnsNames); err != nil { + invalidParams.AddNested("StagingDistributionDnsNames", err.(smithy.InvalidParamsError)) + } + } + if v.Enabled == nil { + invalidParams.Add(smithy.NewErrParamRequired("Enabled")) + } + if v.TrafficConfig != nil { + if err := validateTrafficConfig(v.TrafficConfig); err != nil { + invalidParams.AddNested("TrafficConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateContinuousDeploymentSingleHeaderConfig(v *types.ContinuousDeploymentSingleHeaderConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ContinuousDeploymentSingleHeaderConfig"} + if v.Header == nil { + invalidParams.Add(smithy.NewErrParamRequired("Header")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateContinuousDeploymentSingleWeightConfig(v *types.ContinuousDeploymentSingleWeightConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ContinuousDeploymentSingleWeightConfig"} + if v.Weight == nil { + invalidParams.Add(smithy.NewErrParamRequired("Weight")) + } + if v.SessionStickinessConfig != nil { + if err := validateSessionStickinessConfig(v.SessionStickinessConfig); err != nil { + invalidParams.AddNested("SessionStickinessConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCookieNames(v *types.CookieNames) error { if v == nil { return nil @@ -3072,9 +3281,6 @@ func validateOriginAccessControlConfig(v *types.OriginAccessControlConfig) error if v.Name == nil { invalidParams.Add(smithy.NewErrParamRequired("Name")) } - if v.Description == nil { - invalidParams.Add(smithy.NewErrParamRequired("Description")) - } if len(v.SigningProtocol) == 0 { invalidParams.Add(smithy.NewErrParamRequired("SigningProtocol")) } @@ -4045,6 +4251,39 @@ func validateS3OriginConfig(v *types.S3OriginConfig) error { } } +func validateSessionStickinessConfig(v *types.SessionStickinessConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SessionStickinessConfig"} + if v.IdleTTL == nil { + invalidParams.Add(smithy.NewErrParamRequired("IdleTTL")) + } + if v.MaximumTTL == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaximumTTL")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStagingDistributionDnsNames(v *types.StagingDistributionDnsNames) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StagingDistributionDnsNames"} + if v.Quantity == nil { + invalidParams.Add(smithy.NewErrParamRequired("Quantity")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateStatusCodes(v *types.StatusCodes) error { if v == nil { return nil @@ -4204,6 +4443,31 @@ func validateTags(v *types.Tags) error { } } +func validateTrafficConfig(v *types.TrafficConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TrafficConfig"} + if v.SingleWeightConfig != nil { + if err := validateContinuousDeploymentSingleWeightConfig(v.SingleWeightConfig); err != nil { + invalidParams.AddNested("SingleWeightConfig", err.(smithy.InvalidParamsError)) + } + } + if v.SingleHeaderConfig != nil { + if err := validateContinuousDeploymentSingleHeaderConfig(v.SingleHeaderConfig); err != nil { + invalidParams.AddNested("SingleHeaderConfig", err.(smithy.InvalidParamsError)) + } + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTrustedKeyGroups(v *types.TrustedKeyGroups) error { if v == nil { return nil @@ -4258,6 +4522,24 @@ func validateOpAssociateAliasInput(v *AssociateAliasInput) error { } } +func validateOpCopyDistributionInput(v *CopyDistributionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CopyDistributionInput"} + if v.PrimaryDistributionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("PrimaryDistributionId")) + } + if v.CallerReference == nil { + invalidParams.Add(smithy.NewErrParamRequired("CallerReference")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateCachePolicyInput(v *CreateCachePolicyInput) error { if v == nil { return nil @@ -4296,6 +4578,25 @@ func validateOpCreateCloudFrontOriginAccessIdentityInput(v *CreateCloudFrontOrig } } +func validateOpCreateContinuousDeploymentPolicyInput(v *CreateContinuousDeploymentPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateContinuousDeploymentPolicyInput"} + if v.ContinuousDeploymentPolicyConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContinuousDeploymentPolicyConfig")) + } else if v.ContinuousDeploymentPolicyConfig != nil { + if err := validateContinuousDeploymentPolicyConfig(v.ContinuousDeploymentPolicyConfig); err != nil { + invalidParams.AddNested("ContinuousDeploymentPolicyConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateDistributionInput(v *CreateDistributionInput) error { if v == nil { return nil @@ -4632,6 +4933,21 @@ func validateOpDeleteCloudFrontOriginAccessIdentityInput(v *DeleteCloudFrontOrig } } +func validateOpDeleteContinuousDeploymentPolicyInput(v *DeleteContinuousDeploymentPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteContinuousDeploymentPolicyInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDistributionInput(v *DeleteDistributionInput) error { if v == nil { return nil @@ -4875,6 +5191,36 @@ func validateOpGetCloudFrontOriginAccessIdentityInput(v *GetCloudFrontOriginAcce } } +func validateOpGetContinuousDeploymentPolicyConfigInput(v *GetContinuousDeploymentPolicyConfigInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetContinuousDeploymentPolicyConfigInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetContinuousDeploymentPolicyInput(v *GetContinuousDeploymentPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetContinuousDeploymentPolicyInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetDistributionConfigInput(v *GetDistributionConfigInput) error { if v == nil { return nil @@ -5439,6 +5785,28 @@ func validateOpUpdateCloudFrontOriginAccessIdentityInput(v *UpdateCloudFrontOrig } } +func validateOpUpdateContinuousDeploymentPolicyInput(v *UpdateContinuousDeploymentPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateContinuousDeploymentPolicyInput"} + if v.ContinuousDeploymentPolicyConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("ContinuousDeploymentPolicyConfig")) + } else if v.ContinuousDeploymentPolicyConfig != nil { + if err := validateContinuousDeploymentPolicyConfig(v.ContinuousDeploymentPolicyConfig); err != nil { + invalidParams.AddNested("ContinuousDeploymentPolicyConfig", err.(smithy.InvalidParamsError)) + } + } + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateDistributionInput(v *UpdateDistributionInput) error { if v == nil { return nil diff --git a/service/connect/api_op_CreateSecurityProfile.go b/service/connect/api_op_CreateSecurityProfile.go index ca0be621dcf..d38d571a4b5 100644 --- a/service/connect/api_op_CreateSecurityProfile.go +++ b/service/connect/api_op_CreateSecurityProfile.go @@ -40,6 +40,10 @@ type CreateSecurityProfileInput struct { // This member is required. SecurityProfileName *string + // The list of tags that a security profile uses to restrict access to resources in + // Amazon Connect. + AllowedAccessControlTags map[string]string + // The description of the security profile. Description *string @@ -48,6 +52,10 @@ type CreateSecurityProfileInput struct { // (https://docs.aws.amazon.com/connect/latest/adminguide/security-profile-list.html). Permissions []string + // The list of resources that a security profile applies tag restrictions to in + // Amazon Connect. + TagRestrictedResources []string + // The tags used to organize, track, or control access for this resource. For // example, { "tags": {"key1":"value1", "key2":"value2"} }. Tags map[string]string diff --git a/service/connect/api_op_UpdateSecurityProfile.go b/service/connect/api_op_UpdateSecurityProfile.go index 47a4519de1a..3176d55198f 100644 --- a/service/connect/api_op_UpdateSecurityProfile.go +++ b/service/connect/api_op_UpdateSecurityProfile.go @@ -40,6 +40,10 @@ type UpdateSecurityProfileInput struct { // This member is required. SecurityProfileId *string + // The list of tags that a security profile uses to restrict access to resources in + // Amazon Connect. + AllowedAccessControlTags map[string]string + // The description of the security profile. Description *string @@ -48,6 +52,10 @@ type UpdateSecurityProfileInput struct { // (https://docs.aws.amazon.com/connect/latest/adminguide/security-profile-list.html). Permissions []string + // The list of resources that a security profile applies tag restrictions to in + // Amazon Connect. + TagRestrictedResources []string + noSmithyDocumentSerde } diff --git a/service/connect/deserializers.go b/service/connect/deserializers.go index 2cf1ee11c89..820f14cbcb9 100644 --- a/service/connect/deserializers.go +++ b/service/connect/deserializers.go @@ -24100,6 +24100,42 @@ func awsRestjson1_deserializeDocumentAgentStatusSummaryList(v *[]types.AgentStat return nil } +func awsRestjson1_deserializeDocumentAllowedAccessControlTags(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecurityProfilePolicyValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsRestjson1_deserializeDocumentAttachmentReference(v **types.AttachmentReference, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -30819,6 +30855,11 @@ func awsRestjson1_deserializeDocumentSecurityProfile(v **types.SecurityProfile, for key, value := range shape { switch key { + case "AllowedAccessControlTags": + if err := awsRestjson1_deserializeDocumentAllowedAccessControlTags(&sv.AllowedAccessControlTags, value); err != nil { + return err + } + case "Arn": if value != nil { jtv, ok := value.(string) @@ -30864,6 +30905,11 @@ func awsRestjson1_deserializeDocumentSecurityProfile(v **types.SecurityProfile, sv.SecurityProfileName = ptr.String(jtv) } + case "TagRestrictedResources": + if err := awsRestjson1_deserializeDocumentTagRestrictedResourceList(&sv.TagRestrictedResources, value); err != nil { + return err + } + case "Tags": if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { return err @@ -31282,6 +31328,42 @@ func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interfac return nil } +func awsRestjson1_deserializeDocumentTagRestrictedResourceList(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 TagRestrictedResourceName to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTaskTemplateConstraints(v **types.TaskTemplateConstraints, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/connect/serializers.go b/service/connect/serializers.go index 1c828dd567c..7ea8c142b03 100644 --- a/service/connect/serializers.go +++ b/service/connect/serializers.go @@ -1987,6 +1987,13 @@ func awsRestjson1_serializeOpDocumentCreateSecurityProfileInput(v *CreateSecurit object := value.Object() defer object.Close() + if v.AllowedAccessControlTags != nil { + ok := object.Key("AllowedAccessControlTags") + if err := awsRestjson1_serializeDocumentAllowedAccessControlTags(v.AllowedAccessControlTags, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) @@ -2004,6 +2011,13 @@ func awsRestjson1_serializeOpDocumentCreateSecurityProfileInput(v *CreateSecurit ok.String(*v.SecurityProfileName) } + if v.TagRestrictedResources != nil { + ok := object.Key("TagRestrictedResources") + if err := awsRestjson1_serializeDocumentTagRestrictedResourceList(v.TagRestrictedResources, ok); err != nil { + return err + } + } + if v.Tags != nil { ok := object.Key("Tags") if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { @@ -12555,6 +12569,13 @@ func awsRestjson1_serializeOpDocumentUpdateSecurityProfileInput(v *UpdateSecurit object := value.Object() defer object.Close() + if v.AllowedAccessControlTags != nil { + ok := object.Key("AllowedAccessControlTags") + if err := awsRestjson1_serializeDocumentAllowedAccessControlTags(v.AllowedAccessControlTags, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("Description") ok.String(*v.Description) @@ -12567,6 +12588,13 @@ func awsRestjson1_serializeOpDocumentUpdateSecurityProfileInput(v *UpdateSecurit } } + if v.TagRestrictedResources != nil { + ok := object.Key("TagRestrictedResources") + if err := awsRestjson1_serializeDocumentTagRestrictedResourceList(v.TagRestrictedResources, ok); err != nil { + return err + } + } + return nil } @@ -13408,6 +13436,17 @@ func awsRestjson1_serializeOpDocumentUpdateUserSecurityProfilesInput(v *UpdateUs return nil } +func awsRestjson1_serializeDocumentAllowedAccessControlTags(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} + func awsRestjson1_serializeDocumentAllowedMonitorCapabilities(v []types.MonitorCapability, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -14606,6 +14645,17 @@ func awsRestjson1_serializeDocumentTagOrConditionList(v [][]types.TagCondition, return nil } +func awsRestjson1_serializeDocumentTagRestrictedResourceList(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_serializeDocumentTaskTemplateConstraints(v *types.TaskTemplateConstraints, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/connect/types/types.go b/service/connect/types/types.go index af77b4616c7..86448ce6587 100644 --- a/service/connect/types/types.go +++ b/service/connect/types/types.go @@ -1883,6 +1883,10 @@ type SecurityKey struct { // Contains information about a security profile. type SecurityProfile struct { + // The list of tags that a security profile uses to restrict access to resources in + // Amazon Connect. + AllowedAccessControlTags map[string]string + // The Amazon Resource Name (ARN) for the secruity profile. Arn *string @@ -1898,6 +1902,10 @@ type SecurityProfile struct { // The name for the security profile. SecurityProfileName *string + // The list of resources that a security profile applies tag restrictions to in + // Amazon Connect. + TagRestrictedResources []string + // The tags used to organize, track, or control access for this resource. For // example, { "tags": {"key1":"value1", "key2":"value2"} }. Tags map[string]string diff --git a/service/dynamodb/api_op_BatchWriteItem.go b/service/dynamodb/api_op_BatchWriteItem.go index 443de53d6c3..a9bf9082a18 100644 --- a/service/dynamodb/api_op_BatchWriteItem.go +++ b/service/dynamodb/api_op_BatchWriteItem.go @@ -21,17 +21,19 @@ import ( // format for the API call. For more details on this distinction, see Naming Rules // and Data Types // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.NamingRulesDataTypes.html). -// BatchWriteItem cannot update items. To update items, use the UpdateItem action. -// The individual PutItem and DeleteItem operations specified in BatchWriteItem are -// atomic; however BatchWriteItem as a whole is not. If any requested operations -// fail because the table's provisioned throughput is exceeded or an internal -// processing failure occurs, the failed operations are returned in the -// UnprocessedItems response parameter. You can investigate and optionally resend -// the requests. Typically, you would call BatchWriteItem in a loop. Each iteration -// would check for unprocessed items and submit a new BatchWriteItem request with -// those unprocessed items until all items have been processed. If none of the -// items can be processed due to insufficient provisioned throughput on all of the -// tables in the request, then BatchWriteItem returns a +// BatchWriteItem cannot update items. If you perform a BatchWriteItem operation on +// an existing item, that item's values will be overwritten by the operation and it +// will appear like it was updated. To update items, we recommend you use the +// UpdateItem action. The individual PutItem and DeleteItem operations specified in +// BatchWriteItem are atomic; however BatchWriteItem as a whole is not. If any +// requested operations fail because the table's provisioned throughput is exceeded +// or an internal processing failure occurs, the failed operations are returned in +// the UnprocessedItems response parameter. You can investigate and optionally +// resend the requests. Typically, you would call BatchWriteItem in a loop. Each +// iteration would check for unprocessed items and submit a new BatchWriteItem +// request with those unprocessed items until all items have been processed. If +// none of the items can be processed due to insufficient provisioned throughput on +// all of the tables in the request, then BatchWriteItem returns a // ProvisionedThroughputExceededException. If DynamoDB returns any unprocessed // items, you should retry the batch operation on those items. However, we strongly // recommend that you use an exponential backoff algorithm. If you retry the batch @@ -186,7 +188,7 @@ type BatchWriteItemOutput struct { // A map of tables and requests against those tables that were not processed. The // UnprocessedItems value is in the same form as RequestItems, so you can provide - // this value directly to a subsequent BatchGetItem operation. For more + // this value directly to a subsequent BatchWriteItem operation. For more // information, see RequestItems in the Request Parameters section. Each // UnprocessedItems entry consists of a table name and, for that table, a list of // operations to perform (DeleteRequest or PutRequest). diff --git a/service/dynamodb/api_op_PutItem.go b/service/dynamodb/api_op_PutItem.go index ad08fdf862d..2a5c1c43bd0 100644 --- a/service/dynamodb/api_op_PutItem.go +++ b/service/dynamodb/api_op_PutItem.go @@ -20,16 +20,16 @@ import ( // exist), or replace an existing item if it has certain attribute values. You can // return the item's attribute values in the same operation, using the ReturnValues // parameter. When you add an item, the primary key attributes are the only -// required attributes. Attribute values cannot be null. Empty String and Binary -// attribute values are allowed. Attribute values of type String and Binary must -// have a length greater than zero if the attribute is used as a key attribute for -// a table or index. Set type attributes cannot be empty. Invalid Requests with -// empty values will be rejected with a ValidationException exception. To prevent a -// new item from replacing an existing item, use a conditional expression that -// contains the attribute_not_exists function with the name of the attribute being -// used as the partition key for the table. Since every record must contain that -// attribute, the attribute_not_exists function will only succeed if no matching -// item exists. For more information about PutItem, see Working with Items +// required attributes. Empty String and Binary attribute values are allowed. +// Attribute values of type String and Binary must have a length greater than zero +// if the attribute is used as a key attribute for a table or index. Set type +// attributes cannot be empty. Invalid Requests with empty values will be rejected +// with a ValidationException exception. To prevent a new item from replacing an +// existing item, use a conditional expression that contains the +// attribute_not_exists function with the name of the attribute being used as the +// partition key for the table. Since every record must contain that attribute, the +// attribute_not_exists function will only succeed if no matching item exists. For +// more information about PutItem, see Working with Items // (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html) // in the Amazon DynamoDB Developer Guide. func (c *Client) PutItem(ctx context.Context, params *PutItemInput, optFns ...func(*Options)) (*PutItemOutput, error) { diff --git a/service/dynamodb/deserializers.go b/service/dynamodb/deserializers.go index 100bbedd5e6..c49c4547f30 100644 --- a/service/dynamodb/deserializers.go +++ b/service/dynamodb/deserializers.go @@ -10331,7 +10331,7 @@ func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexDescription(v **types.G if err != nil { return err } - sv.IndexSizeBytes = i64 + sv.IndexSizeBytes = ptr.Int64(i64) } case "IndexStatus": @@ -10353,7 +10353,7 @@ func awsAwsjson10_deserializeDocumentGlobalSecondaryIndexDescription(v **types.G if err != nil { return err } - sv.ItemCount = i64 + sv.ItemCount = ptr.Int64(i64) } case "KeySchema": @@ -11206,7 +11206,7 @@ func awsAwsjson10_deserializeDocumentImportTableDescription(v **types.ImportTabl if err != nil { return err } - sv.ProcessedSizeBytes = i64 + sv.ProcessedSizeBytes = ptr.Int64(i64) } case "S3BucketSource": @@ -12271,7 +12271,7 @@ func awsAwsjson10_deserializeDocumentLocalSecondaryIndexDescription(v **types.Lo if err != nil { return err } - sv.IndexSizeBytes = i64 + sv.IndexSizeBytes = ptr.Int64(i64) } case "ItemCount": @@ -12284,7 +12284,7 @@ func awsAwsjson10_deserializeDocumentLocalSecondaryIndexDescription(v **types.Lo if err != nil { return err } - sv.ItemCount = i64 + sv.ItemCount = ptr.Int64(i64) } case "KeySchema": @@ -14246,7 +14246,7 @@ func awsAwsjson10_deserializeDocumentSourceTableDetails(v **types.SourceTableDet if err != nil { return err } - sv.TableSizeBytes = i64 + sv.TableSizeBytes = ptr.Int64(i64) } default: @@ -14832,7 +14832,7 @@ func awsAwsjson10_deserializeDocumentTableDescription(v **types.TableDescription if err != nil { return err } - sv.ItemCount = i64 + sv.ItemCount = ptr.Int64(i64) } case "KeySchema": @@ -14930,7 +14930,7 @@ func awsAwsjson10_deserializeDocumentTableDescription(v **types.TableDescription if err != nil { return err } - sv.TableSizeBytes = i64 + sv.TableSizeBytes = ptr.Int64(i64) } case "TableStatus": diff --git a/service/dynamodb/types/errors.go b/service/dynamodb/types/errors.go index 6bf36637158..62082c1819e 100644 --- a/service/dynamodb/types/errors.go +++ b/service/dynamodb/types/errors.go @@ -371,14 +371,16 @@ func (e *ItemCollectionSizeLimitExceededException) ErrorFault() smithy.ErrorFaul return smithy.FaultClient } -// There is no limit to the number of daily on-demand backups that can be taken. Up -// to 500 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, -// RestoreTableFromBackup, and RestoreTableToPointInTime. The only exception is -// when you are creating a table with one or more secondary indexes. You can have -// up to 250 such requests running at a time; however, if the table or index -// specifications are complex, DynamoDB might temporarily reduce the number of -// concurrent operations. There is a soft account quota of 2,500 tables. +// There is no limit to the number of daily on-demand backups that can be taken. +// For most purposes, up to 500 simultaneous table operations are allowed per +// account. These operations include CreateTable, UpdateTable, +// DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, and +// RestoreTableToPointInTime. When you are creating a table with one or more +// secondary indexes, you can have up to 250 such requests running at a time. +// However, if the table or index specifications are complex, then DynamoDB might +// temporarily reduce the number of concurrent operations. When importing into +// DynamoDB, up to 50 simultaneous import table operations are allowed per account. +// There is a soft account quota of 2,500 tables. type LimitExceededException struct { Message *string diff --git a/service/dynamodb/types/types.go b/service/dynamodb/types/types.go index 6c2ab9d5615..fb8b2ed31c4 100644 --- a/service/dynamodb/types/types.go +++ b/service/dynamodb/types/types.go @@ -560,7 +560,12 @@ type BatchStatementResponse struct { noSmithyDocumentSerde } -// Contains the details for the read/write capacity mode. +// Contains the details for the read/write capacity mode. This page talks about +// PROVISIONED and PAY_PER_REQUEST billing modes. For more information about these +// modes, see Read/write capacity mode +// (https://docs.aws.amazon.com/amazondynamodb/latest/developerguide/HowItWorks.ReadWriteCapacityMode.html). +// You may need to switch to on-demand mode at least once in order to return a +// BillingModeSummary response. type BillingModeSummary struct { // Controls how you are charged for read and write throughput and how you manage @@ -1427,7 +1432,7 @@ type GlobalSecondaryIndexDescription struct { // The total size of the specified index, in bytes. DynamoDB updates this value // approximately every six hours. Recent changes might not be reflected in this // value. - IndexSizeBytes int64 + IndexSizeBytes *int64 // The current state of the global secondary index: // @@ -1445,7 +1450,7 @@ type GlobalSecondaryIndexDescription struct { // The number of items in the specified index. DynamoDB updates this value // approximately every six hours. Recent changes might not be reflected in this // value. - ItemCount int64 + ItemCount *int64 // The complete key schema for a global secondary index, which consists of one or // more pairs of attribute names and key types: @@ -1699,7 +1704,7 @@ type ImportTableDescription struct { ProcessedItemCount int64 // The total size of data processed from the source file, in Bytes. - ProcessedSizeBytes int64 + ProcessedSizeBytes *int64 // Values for the S3 bucket the source file is imported from. Includes bucket name // (required), key prefix (optional) and bucket account owner ID (optional). @@ -1939,12 +1944,12 @@ type LocalSecondaryIndexDescription struct { // The total size of the specified index, in bytes. DynamoDB updates this value // approximately every six hours. Recent changes might not be reflected in this // value. - IndexSizeBytes int64 + IndexSizeBytes *int64 // The number of items in the specified index. DynamoDB updates this value // approximately every six hours. Recent changes might not be reflected in this // value. - ItemCount int64 + ItemCount *int64 // The complete key schema for the local secondary index, consisting of one or more // pairs of attribute names and key types: @@ -2342,10 +2347,11 @@ type ReplicaGlobalSecondaryIndexAutoScalingDescription struct { // * CREATING - The index // is being created. // - // * UPDATING - The index is being updated. + // * UPDATING - The table/index configuration is being updated. + // The table/index remains available for data operations when UPDATING // - // * DELETING - The - // index is being deleted. + // * DELETING + // - The index is being deleted. // // * ACTIVE - The index is ready for use. IndexStatus IndexStatus @@ -2669,7 +2675,7 @@ type SourceTableDetails struct { TableArn *string // Size of the table in bytes. Note that this is an approximate value. - TableSizeBytes int64 + TableSizeBytes *int64 noSmithyDocumentSerde } @@ -2974,7 +2980,7 @@ type TableDescription struct { // The number of items in the specified table. DynamoDB updates this value // approximately every six hours. Recent changes might not be reflected in this // value. - ItemCount int64 + ItemCount *int64 // The primary key structure for the table. Each KeySchemaElement consists of: // @@ -3100,17 +3106,18 @@ type TableDescription struct { // The total size of the specified table, in bytes. DynamoDB updates this value // approximately every six hours. Recent changes might not be reflected in this // value. - TableSizeBytes int64 + TableSizeBytes *int64 // The current state of the table: // // * CREATING - The table is being created. // // * - // UPDATING - The table is being updated. + // UPDATING - The table/index configuration is being updated. The table/index + // remains available for data operations when UPDATING. // - // * DELETING - The table is being - // deleted. + // * DELETING - The table is + // being deleted. // // * ACTIVE - The table is ready for use. // diff --git a/service/dynamodbstreams/types/errors.go b/service/dynamodbstreams/types/errors.go index 73f40371beb..70882df91d1 100644 --- a/service/dynamodbstreams/types/errors.go +++ b/service/dynamodbstreams/types/errors.go @@ -47,14 +47,16 @@ func (e *InternalServerError) ErrorMessage() string { func (e *InternalServerError) ErrorCode() string { return "InternalServerError" } func (e *InternalServerError) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } -// There is no limit to the number of daily on-demand backups that can be taken. Up -// to 500 simultaneous table operations are allowed per account. These operations -// include CreateTable, UpdateTable, DeleteTable,UpdateTimeToLive, -// RestoreTableFromBackup, and RestoreTableToPointInTime. The only exception is -// when you are creating a table with one or more secondary indexes. You can have -// up to 250 such requests running at a time; however, if the table or index -// specifications are complex, DynamoDB might temporarily reduce the number of -// concurrent operations. There is a soft account quota of 2,500 tables. +// There is no limit to the number of daily on-demand backups that can be taken. +// For most purposes, up to 500 simultaneous table operations are allowed per +// account. These operations include CreateTable, UpdateTable, +// DeleteTable,UpdateTimeToLive, RestoreTableFromBackup, and +// RestoreTableToPointInTime. When you are creating a table with one or more +// secondary indexes, you can have up to 250 such requests running at a time. +// However, if the table or index specifications are complex, then DynamoDB might +// temporarily reduce the number of concurrent operations. When importing into +// DynamoDB, up to 50 simultaneous import table operations are allowed per account. +// There is a soft account quota of 2,500 tables. type LimitExceededException struct { Message *string diff --git a/service/ec2/api_op_CancelImageLaunchPermission.go b/service/ec2/api_op_CancelImageLaunchPermission.go index e549f253c40..f7b3ae08ad8 100644 --- a/service/ec2/api_op_CancelImageLaunchPermission.go +++ b/service/ec2/api_op_CancelImageLaunchPermission.go @@ -11,8 +11,8 @@ import ( ) // Removes your Amazon Web Services account from the launch permissions for the -// specified AMI. For more information, see Cancel sharing an AMI with your Amazon -// Web Services account (https://docs.aws.amazon.com/) in the Amazon Elastic +// specified AMI. For more information, see Cancel having an AMI shared with your +// Amazon Web Services account (https://docs.aws.amazon.com/) in the Amazon Elastic // Compute Cloud User Guide. func (c *Client) CancelImageLaunchPermission(ctx context.Context, params *CancelImageLaunchPermissionInput, optFns ...func(*Options)) (*CancelImageLaunchPermissionOutput, error) { if params == nil { diff --git a/service/ec2/api_op_CopyImage.go b/service/ec2/api_op_CopyImage.go index 55957557027..0c714606aba 100644 --- a/service/ec2/api_op_CopyImage.go +++ b/service/ec2/api_op_CopyImage.go @@ -33,7 +33,7 @@ import ( // local snapshots on Outposts // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#ami) // in the Amazon Elastic Compute Cloud User Guide. For more information about the -// prerequisites and limits when copying an AMI, see Copying an AMI +// prerequisites and limits when copying an AMI, see Copy an AMI // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/CopyingAMIs.html) in the // Amazon Elastic Compute Cloud User Guide. func (c *Client) CopyImage(ctx context.Context, params *CopyImageInput, optFns ...func(*Options)) (*CopyImageOutput, error) { @@ -75,6 +75,18 @@ type CopyImageInput struct { // in the Amazon EC2 API Reference. 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 @@ -82,7 +94,7 @@ type CopyImageInput struct { // 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 Copying AMIs from an Amazon Web + // the same Outpost. For more information, see Copy AMIs from an Amazon Web // Services Region to an Outpost // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/snapshots-outposts.html#copy-amis) // in the Amazon Elastic Compute Cloud User Guide. @@ -98,7 +110,7 @@ type CopyImageInput struct { // 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 Amazon EBS Encryption + // KMS key using KmsKeyId. For more information, see Amazon EBS encryption // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSEncryption.html) in the // Amazon Elastic Compute Cloud User Guide. Encrypted *bool diff --git a/service/ec2/api_op_CreateImage.go b/service/ec2/api_op_CreateImage.go index 594ee054157..c73737d2add 100644 --- a/service/ec2/api_op_CreateImage.go +++ b/service/ec2/api_op_CreateImage.go @@ -24,7 +24,7 @@ import ( // 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. For more -// information, see Creating Amazon EBS-Backed Linux AMIs +// information, see Create an Amazon EBS-backed Linux AMI // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami-ebs.html) // in the Amazon Elastic Compute Cloud User Guide. func (c *Client) CreateImage(ctx context.Context, params *CreateImageInput, optFns ...func(*Options)) (*CreateImageOutput, error) { diff --git a/service/ec2/api_op_DescribeImages.go b/service/ec2/api_op_DescribeImages.go index 6a7774f91c3..d5ee41248db 100644 --- a/service/ec2/api_op_DescribeImages.go +++ b/service/ec2/api_op_DescribeImages.go @@ -133,7 +133,7 @@ type DescribeImagesInput struct { // ID of the owner. We recommend that you use the Owner request parameter instead // of this filter. // - // * platform - The platform. To only list Windows-based AMIs, use + // * platform - The platform. The only supported value is // windows. // // * product-code - The product code. diff --git a/service/ec2/api_op_RegisterImage.go b/service/ec2/api_op_RegisterImage.go index 14d3c9b485b..9bc103d7649 100644 --- a/service/ec2/api_op_RegisterImage.go +++ b/service/ec2/api_op_RegisterImage.go @@ -13,7 +13,7 @@ import ( // Registers an AMI. When you're creating an AMI, this is the final step you must // complete before you can launch an instance from the AMI. For more information -// about creating AMIs, see Creating your own AMIs +// about creating AMIs, see Create your own AMI // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/creating-an-ami.html) in // the Amazon Elastic Compute Cloud User Guide. For Amazon EBS-backed instances, // CreateImage creates and registers the AMI in a single request, so you don't have @@ -55,7 +55,7 @@ import ( // 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 Understanding AMI billing +// information of an AMI, see Understand AMI billing information // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html) in // the Amazon Elastic Compute Cloud User Guide. func (c *Client) RegisterImage(ctx context.Context, params *RegisterImageInput, optFns ...func(*Options)) (*RegisterImageOutput, error) { diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 43c1bb9ce34..c6f35b8c353 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -45382,6 +45382,11 @@ func awsEc2query_serializeOpDocumentCopyImageInput(v *CopyImageInput, value quer 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) diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 6c6d5423331..0483308121a 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -4793,7 +4793,7 @@ type Image struct { Platform PlatformValues // The platform details associated with the billing code of the AMI. For more - // information, see Understanding AMI billing + // information, see Understand AMI billing information // (https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ami-billing-info.html) in // the Amazon Elastic Compute Cloud User Guide. PlatformDetails *string @@ -11970,8 +11970,8 @@ type S3ObjectTag struct { 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 - // Managing Amazon Web Services Access Keys + // your access key ID, review and follow the guidance in Best practices for + // managing Amazon Web Services access keys // (https://docs.aws.amazon.com/general/latest/gr/aws-access-keys-best-practices.html). AWSAccessKeyId *string diff --git a/service/glue/api_op_CreateCrawler.go b/service/glue/api_op_CreateCrawler.go index c50300a2588..897468ea2b0 100644 --- a/service/glue/api_op_CreateCrawler.go +++ b/service/glue/api_op_CreateCrawler.go @@ -53,8 +53,9 @@ type CreateCrawlerInput struct { Classifiers []string // Crawler configuration information. This versioned JSON string allows users to - // specify aspects of a crawler's behavior. For more information, see Configuring a - // Crawler (https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html). + // specify aspects of a crawler's behavior. For more information, see Setting + // crawler configuration options + // (https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html). Configuration *string // The name of the SecurityConfiguration structure to be used by this crawler. diff --git a/service/glue/api_op_UpdateCrawler.go b/service/glue/api_op_UpdateCrawler.go index 90fce3a8fc1..a4d2d4a73bd 100644 --- a/service/glue/api_op_UpdateCrawler.go +++ b/service/glue/api_op_UpdateCrawler.go @@ -41,8 +41,9 @@ type UpdateCrawlerInput struct { Classifiers []string // Crawler configuration information. This versioned JSON string allows users to - // specify aspects of a crawler's behavior. For more information, see Configuring a - // Crawler (https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html). + // specify aspects of a crawler's behavior. For more information, see Setting + // crawler configuration options + // (https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html). Configuration *string // The name of the SecurityConfiguration structure to be used by this crawler. diff --git a/service/glue/deserializers.go b/service/glue/deserializers.go index 7d900a3ec9b..3ec6f93483f 100644 --- a/service/glue/deserializers.go +++ b/service/glue/deserializers.go @@ -31005,6 +31005,42 @@ func awsAwsjson11_deserializeDocumentEdgeList(v *[]types.Edge, value interface{} return nil } +func awsAwsjson11_deserializeDocumentEnableAdditionalMetadata(v *[]types.JdbcMetadataEntry, 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.JdbcMetadataEntry + if *v == nil { + cv = []types.JdbcMetadataEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.JdbcMetadataEntry + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JdbcMetadataEntry to be of type string, got %T instead", value) + } + col = types.JdbcMetadataEntry(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentEnclosedInStringProperties(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -33629,6 +33665,11 @@ func awsAwsjson11_deserializeDocumentJdbcTarget(v **types.JdbcTarget, value inte sv.ConnectionName = ptr.String(jtv) } + case "EnableAdditionalMetadata": + if err := awsAwsjson11_deserializeDocumentEnableAdditionalMetadata(&sv.EnableAdditionalMetadata, value); err != nil { + return err + } + case "Exclusions": if err := awsAwsjson11_deserializeDocumentPathList(&sv.Exclusions, value); err != nil { return err diff --git a/service/glue/serializers.go b/service/glue/serializers.go index ba082a4921c..80f6520f23c 100644 --- a/service/glue/serializers.go +++ b/service/glue/serializers.go @@ -12561,6 +12561,17 @@ func awsAwsjson11_serializeDocumentDynamoDBTargetList(v []types.DynamoDBTarget, return nil } +func awsAwsjson11_serializeDocumentEnableAdditionalMetadata(v []types.JdbcMetadataEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(string(v[i])) + } + return nil +} + func awsAwsjson11_serializeDocumentEnclosedInStringProperties(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -13245,6 +13256,13 @@ func awsAwsjson11_serializeDocumentJdbcTarget(v *types.JdbcTarget, value smithyj ok.String(*v.ConnectionName) } + if v.EnableAdditionalMetadata != nil { + ok := object.Key("EnableAdditionalMetadata") + if err := awsAwsjson11_serializeDocumentEnableAdditionalMetadata(v.EnableAdditionalMetadata, ok); err != nil { + return err + } + } + if v.Exclusions != nil { ok := object.Key("Exclusions") if err := awsAwsjson11_serializeDocumentPathList(v.Exclusions, ok); err != nil { diff --git a/service/glue/types/enums.go b/service/glue/types/enums.go index 06f2d0566f4..7ab8afb4a77 100644 --- a/service/glue/types/enums.go +++ b/service/glue/types/enums.go @@ -794,6 +794,24 @@ func (JDBCDataType) Values() []JDBCDataType { } } +type JdbcMetadataEntry string + +// Enum values for JdbcMetadataEntry +const ( + JdbcMetadataEntryComments JdbcMetadataEntry = "COMMENTS" + JdbcMetadataEntryRawtypes JdbcMetadataEntry = "RAWTYPES" +) + +// Values returns all known values for JdbcMetadataEntry. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (JdbcMetadataEntry) Values() []JdbcMetadataEntry { + return []JdbcMetadataEntry{ + "COMMENTS", + "RAWTYPES", + } +} + type JobBookmarksEncryptionMode string // Enum values for JobBookmarksEncryptionMode diff --git a/service/glue/types/types.go b/service/glue/types/types.go index 94cbb3cbf14..0ca733b3d28 100644 --- a/service/glue/types/types.go +++ b/service/glue/types/types.go @@ -1366,9 +1366,9 @@ type Crawler struct { Classifiers []string // Crawler configuration information. This versioned JSON string allows users to - // specify aspects of a crawler's behavior. For more information, see Include and - // Exclude Patterns - // (https://docs.aws.amazon.com/glue/latest/dg/define-crawler.html#crawler-data-stores-exclude). + // specify aspects of a crawler's behavior. For more information, see Setting + // crawler configuration options + // (https://docs.aws.amazon.com/glue/latest/dg/crawler-configuration.html). Configuration *string // If the crawler is running, contains the total time elapsed since the last crawl @@ -2957,6 +2957,12 @@ type JdbcTarget struct { // The name of the connection to use to connect to the JDBC target. ConnectionName *string + // Specify a value of RAWTYPES or COMMENTS to enable additional metadata in table + // responses. RAWTYPES provides the native-level datatype. COMMENTS provides + // comments associated with a column or table in the database. If you do not need + // additional metadata, keep the field empty. + EnableAdditionalMetadata []JdbcMetadataEntry + // A list of glob patterns used to exclude from the crawl. For more information, // see Catalog Tables with a Crawler // (https://docs.aws.amazon.com/glue/latest/dg/add-crawler.html). diff --git a/service/iotroborunner/LICENSE.txt b/service/iotroborunner/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/iotroborunner/LICENSE.txt @@ -0,0 +1,202 @@ + + Apache License + Version 2.0, January 2004 + http://www.apache.org/licenses/ + + TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION + + 1. Definitions. + + "License" shall mean the terms and conditions for use, reproduction, + and distribution as defined by Sections 1 through 9 of this document. + + "Licensor" shall mean the copyright owner or entity authorized by + the copyright owner that is granting the License. + + "Legal Entity" shall mean the union of the acting entity and all + other entities that control, are controlled by, or are under common + control with that entity. For the purposes of this definition, + "control" means (i) the power, direct or indirect, to cause the + direction or management of such entity, whether by contract or + otherwise, or (ii) ownership of fifty percent (50%) or more of the + outstanding shares, or (iii) beneficial ownership of such entity. + + "You" (or "Your") shall mean an individual or Legal Entity + exercising permissions granted by this License. + + "Source" form shall mean the preferred form for making modifications, + including but not limited to software source code, documentation + source, and configuration files. + + "Object" form shall mean any form resulting from mechanical + transformation or translation of a Source form, including but + not limited to compiled object code, generated documentation, + and conversions to other media types. + + "Work" shall mean the work of authorship, whether in Source or + Object form, made available under the License, as indicated by a + copyright notice that is included in or attached to the work + (an example is provided in the Appendix below). + + "Derivative Works" shall mean any work, whether in Source or Object + form, that is based on (or derived from) the Work and for which the + editorial revisions, annotations, elaborations, or other modifications + represent, as a whole, an original work of authorship. For the purposes + of this License, Derivative Works shall not include works that remain + separable from, or merely link (or bind by name) to the interfaces of, + the Work and Derivative Works thereof. + + "Contribution" shall mean any work of authorship, including + the original version of the Work and any modifications or additions + to that Work or Derivative Works thereof, that is intentionally + submitted to Licensor for inclusion in the Work by the copyright owner + or by an individual or Legal Entity authorized to submit on behalf of + the copyright owner. For the purposes of this definition, "submitted" + means any form of electronic, verbal, or written communication sent + to the Licensor or its representatives, including but not limited to + communication on electronic mailing lists, source code control systems, + and issue tracking systems that are managed by, or on behalf of, the + Licensor for the purpose of discussing and improving the Work, but + excluding communication that is conspicuously marked or otherwise + designated in writing by the copyright owner as "Not a Contribution." + + "Contributor" shall mean Licensor and any individual or Legal Entity + on behalf of whom a Contribution has been received by Licensor and + subsequently incorporated within the Work. + + 2. Grant of Copyright License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + copyright license to reproduce, prepare Derivative Works of, + publicly display, publicly perform, sublicense, and distribute the + Work and such Derivative Works in Source or Object form. + + 3. Grant of Patent License. Subject to the terms and conditions of + this License, each Contributor hereby grants to You a perpetual, + worldwide, non-exclusive, no-charge, royalty-free, irrevocable + (except as stated in this section) patent license to make, have made, + use, offer to sell, sell, import, and otherwise transfer the Work, + where such license applies only to those patent claims licensable + by such Contributor that are necessarily infringed by their + Contribution(s) alone or by combination of their Contribution(s) + with the Work to which such Contribution(s) was submitted. If You + institute patent litigation against any entity (including a + cross-claim or counterclaim in a lawsuit) alleging that the Work + or a Contribution incorporated within the Work constitutes direct + or contributory patent infringement, then any patent licenses + granted to You under this License for that Work shall terminate + as of the date such litigation is filed. + + 4. Redistribution. You may reproduce and distribute copies of the + Work or Derivative Works thereof in any medium, with or without + modifications, and in Source or Object form, provided that You + meet the following conditions: + + (a) You must give any other recipients of the Work or + Derivative Works a copy of this License; and + + (b) You must cause any modified files to carry prominent notices + stating that You changed the files; and + + (c) You must retain, in the Source form of any Derivative Works + that You distribute, all copyright, patent, trademark, and + attribution notices from the Source form of the Work, + excluding those notices that do not pertain to any part of + the Derivative Works; and + + (d) If the Work includes a "NOTICE" text file as part of its + distribution, then any Derivative Works that You distribute must + include a readable copy of the attribution notices contained + within such NOTICE file, excluding those notices that do not + pertain to any part of the Derivative Works, in at least one + of the following places: within a NOTICE text file distributed + as part of the Derivative Works; within the Source form or + documentation, if provided along with the Derivative Works; or, + within a display generated by the Derivative Works, if and + wherever such third-party notices normally appear. The contents + of the NOTICE file are for informational purposes only and + do not modify the License. You may add Your own attribution + notices within Derivative Works that You distribute, alongside + or as an addendum to the NOTICE text from the Work, provided + that such additional attribution notices cannot be construed + as modifying the License. + + You may add Your own copyright statement to Your modifications and + may provide additional or different license terms and conditions + for use, reproduction, or distribution of Your modifications, or + for any such Derivative Works as a whole, provided Your use, + reproduction, and distribution of the Work otherwise complies with + the conditions stated in this License. + + 5. Submission of Contributions. Unless You explicitly state otherwise, + any Contribution intentionally submitted for inclusion in the Work + by You to the Licensor shall be under the terms and conditions of + this License, without any additional terms or conditions. + Notwithstanding the above, nothing herein shall supersede or modify + the terms of any separate license agreement you may have executed + with Licensor regarding such Contributions. + + 6. Trademarks. This License does not grant permission to use the trade + names, trademarks, service marks, or product names of the Licensor, + except as required for reasonable and customary use in describing the + origin of the Work and reproducing the content of the NOTICE file. + + 7. Disclaimer of Warranty. Unless required by applicable law or + agreed to in writing, Licensor provides the Work (and each + Contributor provides its Contributions) on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or + implied, including, without limitation, any warranties or conditions + of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A + PARTICULAR PURPOSE. You are solely responsible for determining the + appropriateness of using or redistributing the Work and assume any + risks associated with Your exercise of permissions under this License. + + 8. Limitation of Liability. In no event and under no legal theory, + whether in tort (including negligence), contract, or otherwise, + unless required by applicable law (such as deliberate and grossly + negligent acts) or agreed to in writing, shall any Contributor be + liable to You for damages, including any direct, indirect, special, + incidental, or consequential damages of any character arising as a + result of this License or out of the use or inability to use the + Work (including but not limited to damages for loss of goodwill, + work stoppage, computer failure or malfunction, or any and all + other commercial damages or losses), even if such Contributor + has been advised of the possibility of such damages. + + 9. Accepting Warranty or Additional Liability. While redistributing + the Work or Derivative Works thereof, You may choose to offer, + and charge a fee for, acceptance of support, warranty, indemnity, + or other liability obligations and/or rights consistent with this + License. However, in accepting such obligations, You may act only + on Your own behalf and on Your sole responsibility, not on behalf + of any other Contributor, and only if You agree to indemnify, + defend, and hold each Contributor harmless for any liability + incurred by, or claims asserted against, such Contributor by reason + of your accepting any such warranty or additional liability. + + END OF TERMS AND CONDITIONS + + APPENDIX: How to apply the Apache License to your work. + + To apply the Apache License to your work, attach the following + boilerplate notice, with the fields enclosed by brackets "[]" + replaced with your own identifying information. (Don't include + the brackets!) The text should be enclosed in the appropriate + comment syntax for the file format. We also recommend that a + file or class name and description of purpose be included on the + same "printed page" as the copyright notice for easier + identification within third-party archives. + + Copyright [yyyy] [name of copyright owner] + + Licensed under the Apache License, Version 2.0 (the "License"); + you may not use this file except in compliance with the License. + You may obtain a copy of the License at + + http://www.apache.org/licenses/LICENSE-2.0 + + Unless required by applicable law or agreed to in writing, software + distributed under the License is distributed on an "AS IS" BASIS, + WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. + See the License for the specific language governing permissions and + limitations under the License. diff --git a/service/iotroborunner/api_client.go b/service/iotroborunner/api_client.go new file mode 100644 index 00000000000..49799331814 --- /dev/null +++ b/service/iotroborunner/api_client.go @@ -0,0 +1,453 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + cryptorand "crypto/rand" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + smithy "github.com/aws/smithy-go" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "time" +) + +const ServiceID = "IoT RoboRunner" +const ServiceAPIVersion = "2018-05-10" + +// Client provides the API client to make operations call for AWS IoT RoboRunner. +type Client struct { + options Options +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveDefaultEndpointConfiguration(&options) + + resolveIdempotencyTokenProvider(&options) + + for _, fn := range optFns { + fn(&options) + } + + client := &Client{ + options: options, + } + + return client +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + EndpointResolver EndpointResolver + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // 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 region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. If specified in an operation call's functional + // options with a value that is different than the constructed client's Options, + // the Client's Retryer will be wrapped to use the operation's specific + // RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. When creating a new API Clients this + // member will only be used if the Retryer Options member is nil. This value will + // be ignored if Retryer is not nil. Currently does not support per operation call + // overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig. You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. Currently does not support per operation call + // overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// WithEndpointResolver returns a functional option for setting the Client's +// EndpointResolver option. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} +func (c *Client) invokeOperation(ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error) (result interface{}, metadata middleware.Metadata, err error) { + ctx = middleware.ClearStackValues(ctx) + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttemptOptions(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + handler := middleware.DecorateHandler(smithyhttp.NewClientHandler(options.HTTPClient), stack) + result, metadata, err = handler.Handle(ctx, params) + if err != nil { + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + return result, metadata, err +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttemptOptions(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions, NewDefaultEndpointResolver()) +} + +func addClientUserAgent(stack *middleware.Stack) error { + return awsmiddleware.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "iotroborunner", goModuleVersion)(stack) +} + +func addHTTPSignerV4Middleware(stack *middleware.Stack, o Options) error { + mw := v4.NewSignHTTPRequestMiddleware(v4.SignHTTPRequestMiddlewareOptions{ + CredentialsProvider: o.Credentials, + Signer: o.HTTPSignerV4, + LogSigning: o.ClientLogMode.IsSigning(), + }) + return stack.Finalize.Add(mw, middleware.After) +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + +func addRetryMiddlewares(stack *middleware.Stack, o Options) error { + mo := retry.AddRetryMiddlewaresOptions{ + Retryer: o.Retryer, + LogRetryAttempts: o.ClientLogMode.IsRetries(), + } + return retry.AddRetryMiddlewares(stack, mo) +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return awsmiddleware.AddRequestIDRetrieverMiddleware(stack) +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return awshttp.AddResponseErrorMiddleware(stack) +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} diff --git a/service/iotroborunner/api_client_test.go b/service/iotroborunner/api_client_test.go new file mode 100644 index 00000000000..bd6b285d6df --- /dev/null +++ b/service/iotroborunner/api_client_test.go @@ -0,0 +1,123 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/iotroborunner/api_op_CreateDestination.go b/service/iotroborunner/api_op_CreateDestination.go new file mode 100644 index 00000000000..2d1330c038c --- /dev/null +++ b/service/iotroborunner/api_op_CreateDestination.go @@ -0,0 +1,196 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +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/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to create a destination +func (c *Client) CreateDestination(ctx context.Context, params *CreateDestinationInput, optFns ...func(*Options)) (*CreateDestinationOutput, error) { + if params == nil { + params = &CreateDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDestination", params, optFns, c.addOperationCreateDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDestinationInput struct { + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Site ARN. + // + // This member is required. + Site *string + + // JSON document containing additional fixed properties regarding the destination + AdditionalFixedProperties *string + + // Token used for detecting replayed requests. Replayed requests will not be + // performed multiple times. + ClientToken *string + + // The state of the destination. Default used if not specified. + State types.DestinationState + + noSmithyDocumentSerde +} + +type CreateDestinationOutput struct { + + // Destination ARN. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the destination's identifier + // + // This member is required. + Id *string + + // State of the destination. + // + // This member is required. + State types.DestinationState + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateDestinationMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateDestination struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateDestination) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateDestination) 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.(*CreateDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateDestinationInput ") + } + + 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_opCreateDestinationMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateDestination{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "CreateDestination", + } +} diff --git a/service/iotroborunner/api_op_CreateSite.go b/service/iotroborunner/api_op_CreateSite.go new file mode 100644 index 00000000000..828ff826d25 --- /dev/null +++ b/service/iotroborunner/api_op_CreateSite.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +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" + "time" +) + +// Grants permission to create a site +func (c *Client) CreateSite(ctx context.Context, params *CreateSiteInput, optFns ...func(*Options)) (*CreateSiteOutput, error) { + if params == nil { + params = &CreateSiteInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateSite", params, optFns, c.addOperationCreateSiteMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateSiteOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateSiteInput struct { + + // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. e.g., + // US. + // + // This member is required. + CountryCode *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Token used for detecting replayed requests. Replayed requests will not be + // performed multiple times. + ClientToken *string + + // A high-level description of the site. + Description *string + + noSmithyDocumentSerde +} + +type CreateSiteOutput struct { + + // Site ARN. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the site's identifier + // + // This member is required. + Id *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateSiteMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateSite{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateSite{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateSiteMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateSiteValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateSite(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateSite struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateSite) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateSite) 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.(*CreateSiteInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateSiteInput ") + } + + 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_opCreateSiteMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateSite{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateSite(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "CreateSite", + } +} diff --git a/service/iotroborunner/api_op_CreateWorker.go b/service/iotroborunner/api_op_CreateWorker.go new file mode 100644 index 00000000000..070ba30c086 --- /dev/null +++ b/service/iotroborunner/api_op_CreateWorker.go @@ -0,0 +1,207 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +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/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to create a worker +func (c *Client) CreateWorker(ctx context.Context, params *CreateWorkerInput, optFns ...func(*Options)) (*CreateWorkerOutput, error) { + if params == nil { + params = &CreateWorkerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWorker", params, optFns, c.addOperationCreateWorkerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWorkerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateWorkerInput struct { + + // Full ARN of the worker fleet. + // + // This member is required. + Fleet *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // JSON blob containing unstructured worker properties that are fixed and won't + // change during regular operation. + AdditionalFixedProperties *string + + // JSON blob containing unstructured worker properties that are transient and may + // change during regular operation. + AdditionalTransientProperties *string + + // Token used for detecting replayed requests. Replayed requests will not be + // performed multiple times. + ClientToken *string + + // Worker orientation measured in units clockwise from north. + Orientation types.Orientation + + // Supported coordinates for worker position. + Position types.PositionCoordinates + + // Properties of the worker that are provided by the vendor FMS. + VendorProperties *types.VendorProperties + + noSmithyDocumentSerde +} + +type CreateWorkerOutput struct { + + // Full ARN of the worker. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the workers identifier + // + // This member is required. + Id *string + + // Site ARN. + // + // This member is required. + Site *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorker{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorker{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateWorkerMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateWorkerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorker(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateWorker struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateWorker) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateWorker) 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.(*CreateWorkerInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWorkerInput ") + } + + 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_opCreateWorkerMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWorker{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateWorker(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "CreateWorker", + } +} diff --git a/service/iotroborunner/api_op_CreateWorkerFleet.go b/service/iotroborunner/api_op_CreateWorkerFleet.go new file mode 100644 index 00000000000..06cf7b30c50 --- /dev/null +++ b/service/iotroborunner/api_op_CreateWorkerFleet.go @@ -0,0 +1,187 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +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" + "time" +) + +// Grants permission to create a worker fleet +func (c *Client) CreateWorkerFleet(ctx context.Context, params *CreateWorkerFleetInput, optFns ...func(*Options)) (*CreateWorkerFleetOutput, error) { + if params == nil { + params = &CreateWorkerFleetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateWorkerFleet", params, optFns, c.addOperationCreateWorkerFleetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateWorkerFleetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateWorkerFleetInput struct { + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Site ARN. + // + // This member is required. + Site *string + + // JSON blob containing additional fixed properties regarding the worker fleet + AdditionalFixedProperties *string + + // Token used for detecting replayed requests. Replayed requests will not be + // performed multiple times. + ClientToken *string + + noSmithyDocumentSerde +} + +type CreateWorkerFleetOutput struct { + + // Full ARN of the worker fleet. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the worker fleet's identifier + // + // This member is required. + Id *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateWorkerFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateWorkerFleet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateWorkerFleet{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addIdempotencyToken_opCreateWorkerFleetMiddleware(stack, options); err != nil { + return err + } + if err = addOpCreateWorkerFleetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateWorkerFleet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpCreateWorkerFleet struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpCreateWorkerFleet) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpCreateWorkerFleet) 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.(*CreateWorkerFleetInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *CreateWorkerFleetInput ") + } + + 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_opCreateWorkerFleetMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpCreateWorkerFleet{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opCreateWorkerFleet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "CreateWorkerFleet", + } +} diff --git a/service/iotroborunner/api_op_DeleteDestination.go b/service/iotroborunner/api_op_DeleteDestination.go new file mode 100644 index 00000000000..3cd4a21767a --- /dev/null +++ b/service/iotroborunner/api_op_DeleteDestination.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Grants permission to delete a destination +func (c *Client) DeleteDestination(ctx context.Context, params *DeleteDestinationInput, optFns ...func(*Options)) (*DeleteDestinationOutput, error) { + if params == nil { + params = &DeleteDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDestination", params, optFns, c.addOperationDeleteDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDestinationInput struct { + + // Destination ARN. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteDestinationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "DeleteDestination", + } +} diff --git a/service/iotroborunner/api_op_DeleteSite.go b/service/iotroborunner/api_op_DeleteSite.go new file mode 100644 index 00000000000..4b48abe0264 --- /dev/null +++ b/service/iotroborunner/api_op_DeleteSite.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Grants permission to delete a site +func (c *Client) DeleteSite(ctx context.Context, params *DeleteSiteInput, optFns ...func(*Options)) (*DeleteSiteOutput, error) { + if params == nil { + params = &DeleteSiteInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteSite", params, optFns, c.addOperationDeleteSiteMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteSiteOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteSiteInput struct { + + // Site ARN. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteSiteOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteSiteMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteSite{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteSite{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteSiteValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteSite(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteSite(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "DeleteSite", + } +} diff --git a/service/iotroborunner/api_op_DeleteWorker.go b/service/iotroborunner/api_op_DeleteWorker.go new file mode 100644 index 00000000000..71325d601ba --- /dev/null +++ b/service/iotroborunner/api_op_DeleteWorker.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Grants permission to delete a worker +func (c *Client) DeleteWorker(ctx context.Context, params *DeleteWorkerInput, optFns ...func(*Options)) (*DeleteWorkerOutput, error) { + if params == nil { + params = &DeleteWorkerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWorker", params, optFns, c.addOperationDeleteWorkerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWorkerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteWorkerInput struct { + + // Full ARN of the worker. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteWorkerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorker{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorker{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteWorkerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorker(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteWorker(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "DeleteWorker", + } +} diff --git a/service/iotroborunner/api_op_DeleteWorkerFleet.go b/service/iotroborunner/api_op_DeleteWorkerFleet.go new file mode 100644 index 00000000000..ad89bfd91cc --- /dev/null +++ b/service/iotroborunner/api_op_DeleteWorkerFleet.go @@ -0,0 +1,116 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Grants permission to delete a worker fleet +func (c *Client) DeleteWorkerFleet(ctx context.Context, params *DeleteWorkerFleetInput, optFns ...func(*Options)) (*DeleteWorkerFleetOutput, error) { + if params == nil { + params = &DeleteWorkerFleetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteWorkerFleet", params, optFns, c.addOperationDeleteWorkerFleetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteWorkerFleetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteWorkerFleetInput struct { + + // Full ARN of the worker fleet. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type DeleteWorkerFleetOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteWorkerFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteWorkerFleet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteWorkerFleet{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteWorkerFleetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteWorkerFleet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteWorkerFleet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "DeleteWorkerFleet", + } +} diff --git a/service/iotroborunner/api_op_GetDestination.go b/service/iotroborunner/api_op_GetDestination.go new file mode 100644 index 00000000000..13da3375db1 --- /dev/null +++ b/service/iotroborunner/api_op_GetDestination.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to get a destination +func (c *Client) GetDestination(ctx context.Context, params *GetDestinationInput, optFns ...func(*Options)) (*GetDestinationOutput, error) { + if params == nil { + params = &GetDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDestination", params, optFns, c.addOperationGetDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDestinationInput struct { + + // Destination ARN. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetDestinationOutput struct { + + // Destination ARN. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the destination's identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Site ARN. + // + // This member is required. + Site *string + + // State of the destination. + // + // This member is required. + State types.DestinationState + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON document containing additional fixed properties regarding the destination + AdditionalFixedProperties *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "GetDestination", + } +} diff --git a/service/iotroborunner/api_op_GetSite.go b/service/iotroborunner/api_op_GetSite.go new file mode 100644 index 00000000000..6ffa4527814 --- /dev/null +++ b/service/iotroborunner/api_op_GetSite.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to get a site +func (c *Client) GetSite(ctx context.Context, params *GetSiteInput, optFns ...func(*Options)) (*GetSiteOutput, error) { + if params == nil { + params = &GetSiteInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetSite", params, optFns, c.addOperationGetSiteMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetSiteOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetSiteInput struct { + + // Site ARN. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetSiteOutput struct { + + // Site ARN. + // + // This member is required. + Arn *string + + // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. e.g., + // US. + // + // This member is required. + CountryCode *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the site's identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // A high-level description of the site. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetSiteMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetSite{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetSite{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetSiteValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetSite(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetSite(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "GetSite", + } +} diff --git a/service/iotroborunner/api_op_GetWorker.go b/service/iotroborunner/api_op_GetWorker.go new file mode 100644 index 00000000000..3877af5443a --- /dev/null +++ b/service/iotroborunner/api_op_GetWorker.go @@ -0,0 +1,171 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to get a worker +func (c *Client) GetWorker(ctx context.Context, params *GetWorkerInput, optFns ...func(*Options)) (*GetWorkerOutput, error) { + if params == nil { + params = &GetWorkerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWorker", params, optFns, c.addOperationGetWorkerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWorkerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWorkerInput struct { + + // Full ARN of the worker. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetWorkerOutput struct { + + // Full ARN of the worker. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Full ARN of the worker fleet. + // + // This member is required. + Fleet *string + + // Filters access by the workers identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Site ARN. + // + // This member is required. + Site *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON blob containing unstructured worker properties that are fixed and won't + // change during regular operation. + AdditionalFixedProperties *string + + // JSON blob containing unstructured worker properties that are transient and may + // change during regular operation. + AdditionalTransientProperties *string + + // Worker orientation measured in units clockwise from north. + Orientation types.Orientation + + // Supported coordinates for worker position. + Position types.PositionCoordinates + + // Properties of the worker that are provided by the vendor FMS. + VendorProperties *types.VendorProperties + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorker{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorker{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWorkerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorker(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetWorker(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "GetWorker", + } +} diff --git a/service/iotroborunner/api_op_GetWorkerFleet.go b/service/iotroborunner/api_op_GetWorkerFleet.go new file mode 100644 index 00000000000..d5e75d83e13 --- /dev/null +++ b/service/iotroborunner/api_op_GetWorkerFleet.go @@ -0,0 +1,151 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to get a worker fleet +func (c *Client) GetWorkerFleet(ctx context.Context, params *GetWorkerFleetInput, optFns ...func(*Options)) (*GetWorkerFleetOutput, error) { + if params == nil { + params = &GetWorkerFleetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetWorkerFleet", params, optFns, c.addOperationGetWorkerFleetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetWorkerFleetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetWorkerFleetInput struct { + + // Full ARN of the worker fleet. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + +type GetWorkerFleetOutput struct { + + // Full ARN of the worker fleet. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the worker fleet's identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Site ARN. + // + // This member is required. + Site *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON blob containing additional fixed properties regarding the worker fleet + AdditionalFixedProperties *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetWorkerFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetWorkerFleet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetWorkerFleet{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpGetWorkerFleetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetWorkerFleet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetWorkerFleet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "GetWorkerFleet", + } +} diff --git a/service/iotroborunner/api_op_ListDestinations.go b/service/iotroborunner/api_op_ListDestinations.go new file mode 100644 index 00000000000..52f1da41ae0 --- /dev/null +++ b/service/iotroborunner/api_op_ListDestinations.go @@ -0,0 +1,226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +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/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Grants permission to list destinations +func (c *Client) ListDestinations(ctx context.Context, params *ListDestinationsInput, optFns ...func(*Options)) (*ListDestinationsOutput, error) { + if params == nil { + params = &ListDestinationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDestinations", params, optFns, c.addOperationListDestinationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDestinationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDestinationsInput struct { + + // Site ARN. + // + // This member is required. + Site *string + + // Maximum number of results to retrieve in a single call. + MaxResults *int32 + + // Pagination token returned when another page of data exists. Provide it in your + // next call to the API to receive the next page. + NextToken *string + + // State of the destination. + State types.DestinationState + + noSmithyDocumentSerde +} + +type ListDestinationsOutput struct { + + // List of destinations. + Destinations []types.Destination + + // Pagination token returned when another page of data exists. Provide it in your + // next call to the API to receive the next page. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDestinationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListDestinations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListDestinations{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListDestinationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDestinations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListDestinationsAPIClient is a client that implements the ListDestinations +// operation. +type ListDestinationsAPIClient interface { + ListDestinations(context.Context, *ListDestinationsInput, ...func(*Options)) (*ListDestinationsOutput, error) +} + +var _ ListDestinationsAPIClient = (*Client)(nil) + +// ListDestinationsPaginatorOptions is the paginator options for ListDestinations +type ListDestinationsPaginatorOptions struct { + // Maximum number of results to retrieve 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 +} + +// ListDestinationsPaginator is a paginator for ListDestinations +type ListDestinationsPaginator struct { + options ListDestinationsPaginatorOptions + client ListDestinationsAPIClient + params *ListDestinationsInput + nextToken *string + firstPage bool +} + +// NewListDestinationsPaginator returns a new ListDestinationsPaginator +func NewListDestinationsPaginator(client ListDestinationsAPIClient, params *ListDestinationsInput, optFns ...func(*ListDestinationsPaginatorOptions)) *ListDestinationsPaginator { + if params == nil { + params = &ListDestinationsInput{} + } + + options := ListDestinationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListDestinationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListDestinationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListDestinations page. +func (p *ListDestinationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListDestinationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListDestinations(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListDestinations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "ListDestinations", + } +} diff --git a/service/iotroborunner/api_op_ListSites.go b/service/iotroborunner/api_op_ListSites.go new file mode 100644 index 00000000000..11e311be59c --- /dev/null +++ b/service/iotroborunner/api_op_ListSites.go @@ -0,0 +1,214 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +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/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Grants permission to list sites +func (c *Client) ListSites(ctx context.Context, params *ListSitesInput, optFns ...func(*Options)) (*ListSitesOutput, error) { + if params == nil { + params = &ListSitesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListSites", params, optFns, c.addOperationListSitesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListSitesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListSitesInput struct { + + // Maximum number of results to retrieve in a single ListSites call. + MaxResults *int32 + + // Pagination token returned when another page of data exists. Provide it in your + // next call to the API to receive the next page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListSitesOutput struct { + + // Pagination token returned when another page of data exists. Provide it in your + // next call to the API to receive the next page. + NextToken *string + + // List of facilities. + Sites []types.Site + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListSitesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListSites{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListSites{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListSites(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListSitesAPIClient is a client that implements the ListSites operation. +type ListSitesAPIClient interface { + ListSites(context.Context, *ListSitesInput, ...func(*Options)) (*ListSitesOutput, error) +} + +var _ ListSitesAPIClient = (*Client)(nil) + +// ListSitesPaginatorOptions is the paginator options for ListSites +type ListSitesPaginatorOptions struct { + // Maximum number of results to retrieve in a single ListSites 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 +} + +// ListSitesPaginator is a paginator for ListSites +type ListSitesPaginator struct { + options ListSitesPaginatorOptions + client ListSitesAPIClient + params *ListSitesInput + nextToken *string + firstPage bool +} + +// NewListSitesPaginator returns a new ListSitesPaginator +func NewListSitesPaginator(client ListSitesAPIClient, params *ListSitesInput, optFns ...func(*ListSitesPaginatorOptions)) *ListSitesPaginator { + if params == nil { + params = &ListSitesInput{} + } + + options := ListSitesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListSitesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListSitesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListSites page. +func (p *ListSitesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListSitesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListSites(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListSites(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "ListSites", + } +} diff --git a/service/iotroborunner/api_op_ListWorkerFleets.go b/service/iotroborunner/api_op_ListWorkerFleets.go new file mode 100644 index 00000000000..22a439a690d --- /dev/null +++ b/service/iotroborunner/api_op_ListWorkerFleets.go @@ -0,0 +1,223 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +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/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Grants permission to list worker fleets +func (c *Client) ListWorkerFleets(ctx context.Context, params *ListWorkerFleetsInput, optFns ...func(*Options)) (*ListWorkerFleetsOutput, error) { + if params == nil { + params = &ListWorkerFleetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWorkerFleets", params, optFns, c.addOperationListWorkerFleetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWorkerFleetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListWorkerFleetsInput struct { + + // Site ARN. + // + // This member is required. + Site *string + + // Maximum number of results to retrieve in a single ListWorkerFleets call. + MaxResults *int32 + + // Pagination token returned when another page of data exists. Provide it in your + // next call to the API to receive the next page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListWorkerFleetsOutput struct { + + // Pagination token returned when another page of data exists. Provide it in your + // next call to the API to receive the next page. + NextToken *string + + // List of worker fleets. + WorkerFleets []types.WorkerFleet + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListWorkerFleetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkerFleets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkerFleets{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListWorkerFleetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkerFleets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListWorkerFleetsAPIClient is a client that implements the ListWorkerFleets +// operation. +type ListWorkerFleetsAPIClient interface { + ListWorkerFleets(context.Context, *ListWorkerFleetsInput, ...func(*Options)) (*ListWorkerFleetsOutput, error) +} + +var _ ListWorkerFleetsAPIClient = (*Client)(nil) + +// ListWorkerFleetsPaginatorOptions is the paginator options for ListWorkerFleets +type ListWorkerFleetsPaginatorOptions struct { + // Maximum number of results to retrieve in a single ListWorkerFleets 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 +} + +// ListWorkerFleetsPaginator is a paginator for ListWorkerFleets +type ListWorkerFleetsPaginator struct { + options ListWorkerFleetsPaginatorOptions + client ListWorkerFleetsAPIClient + params *ListWorkerFleetsInput + nextToken *string + firstPage bool +} + +// NewListWorkerFleetsPaginator returns a new ListWorkerFleetsPaginator +func NewListWorkerFleetsPaginator(client ListWorkerFleetsAPIClient, params *ListWorkerFleetsInput, optFns ...func(*ListWorkerFleetsPaginatorOptions)) *ListWorkerFleetsPaginator { + if params == nil { + params = &ListWorkerFleetsInput{} + } + + options := ListWorkerFleetsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListWorkerFleetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkerFleetsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListWorkerFleets page. +func (p *ListWorkerFleetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkerFleetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListWorkerFleets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListWorkerFleets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "ListWorkerFleets", + } +} diff --git a/service/iotroborunner/api_op_ListWorkers.go b/service/iotroborunner/api_op_ListWorkers.go new file mode 100644 index 00000000000..eec3615d70b --- /dev/null +++ b/service/iotroborunner/api_op_ListWorkers.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +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/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Grants permission to list workers +func (c *Client) ListWorkers(ctx context.Context, params *ListWorkersInput, optFns ...func(*Options)) (*ListWorkersOutput, error) { + if params == nil { + params = &ListWorkersInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListWorkers", params, optFns, c.addOperationListWorkersMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListWorkersOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListWorkersInput struct { + + // Site ARN. + // + // This member is required. + Site *string + + // Full ARN of the worker fleet. + Fleet *string + + // Maximum number of results to retrieve in a single ListWorkers call. + MaxResults *int32 + + // Pagination token returned when another page of data exists. Provide it in your + // next call to the API to receive the next page. + NextToken *string + + noSmithyDocumentSerde +} + +type ListWorkersOutput struct { + + // Pagination token returned when another page of data exists. Provide it in your + // next call to the API to receive the next page. + NextToken *string + + // List of workers. + Workers []types.Worker + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListWorkersMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpListWorkers{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListWorkers{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpListWorkersValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListWorkers(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// ListWorkersAPIClient is a client that implements the ListWorkers operation. +type ListWorkersAPIClient interface { + ListWorkers(context.Context, *ListWorkersInput, ...func(*Options)) (*ListWorkersOutput, error) +} + +var _ ListWorkersAPIClient = (*Client)(nil) + +// ListWorkersPaginatorOptions is the paginator options for ListWorkers +type ListWorkersPaginatorOptions struct { + // Maximum number of results to retrieve in a single ListWorkers 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 +} + +// ListWorkersPaginator is a paginator for ListWorkers +type ListWorkersPaginator struct { + options ListWorkersPaginatorOptions + client ListWorkersAPIClient + params *ListWorkersInput + nextToken *string + firstPage bool +} + +// NewListWorkersPaginator returns a new ListWorkersPaginator +func NewListWorkersPaginator(client ListWorkersAPIClient, params *ListWorkersInput, optFns ...func(*ListWorkersPaginatorOptions)) *ListWorkersPaginator { + if params == nil { + params = &ListWorkersInput{} + } + + options := ListWorkersPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListWorkersPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListWorkersPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListWorkers page. +func (p *ListWorkersPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListWorkersOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.ListWorkers(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opListWorkers(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "ListWorkers", + } +} diff --git a/service/iotroborunner/api_op_UpdateDestination.go b/service/iotroborunner/api_op_UpdateDestination.go new file mode 100644 index 00000000000..c2f46657754 --- /dev/null +++ b/service/iotroborunner/api_op_UpdateDestination.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to update a destination +func (c *Client) UpdateDestination(ctx context.Context, params *UpdateDestinationInput, optFns ...func(*Options)) (*UpdateDestinationOutput, error) { + if params == nil { + params = &UpdateDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDestination", params, optFns, c.addOperationUpdateDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDestinationInput struct { + + // Destination ARN. + // + // This member is required. + Id *string + + // JSON document containing additional fixed properties regarding the destination + AdditionalFixedProperties *string + + // Human friendly name of the resource. + Name *string + + // State of the destination. + State types.DestinationState + + noSmithyDocumentSerde +} + +type UpdateDestinationOutput struct { + + // Destination ARN. + // + // This member is required. + Arn *string + + // Filters access by the destination's identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // State of the destination. + // + // This member is required. + State types.DestinationState + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON document containing additional fixed properties regarding the destination + AdditionalFixedProperties *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateDestination{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateDestinationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "UpdateDestination", + } +} diff --git a/service/iotroborunner/api_op_UpdateSite.go b/service/iotroborunner/api_op_UpdateSite.go new file mode 100644 index 00000000000..38f60e1fc4f --- /dev/null +++ b/service/iotroborunner/api_op_UpdateSite.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to update a site +func (c *Client) UpdateSite(ctx context.Context, params *UpdateSiteInput, optFns ...func(*Options)) (*UpdateSiteOutput, error) { + if params == nil { + params = &UpdateSiteInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateSite", params, optFns, c.addOperationUpdateSiteMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateSiteOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateSiteInput struct { + + // Site ARN. + // + // This member is required. + Id *string + + // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. e.g., + // US. + CountryCode *string + + // A high-level description of the site. + Description *string + + // Human friendly name of the resource. + Name *string + + noSmithyDocumentSerde +} + +type UpdateSiteOutput struct { + + // Site ARN. + // + // This member is required. + Arn *string + + // Filters access by the site's identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. e.g., + // US. + CountryCode *string + + // A high-level description of the site. + Description *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateSiteMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateSite{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateSite{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateSiteValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateSite(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateSite(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "UpdateSite", + } +} diff --git a/service/iotroborunner/api_op_UpdateWorker.go b/service/iotroborunner/api_op_UpdateWorker.go new file mode 100644 index 00000000000..3a4d41763ac --- /dev/null +++ b/service/iotroborunner/api_op_UpdateWorker.go @@ -0,0 +1,181 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to update a worker +func (c *Client) UpdateWorker(ctx context.Context, params *UpdateWorkerInput, optFns ...func(*Options)) (*UpdateWorkerOutput, error) { + if params == nil { + params = &UpdateWorkerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateWorker", params, optFns, c.addOperationUpdateWorkerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateWorkerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateWorkerInput struct { + + // Full ARN of the worker. + // + // This member is required. + Id *string + + // JSON blob containing unstructured worker properties that are fixed and won't + // change during regular operation. + AdditionalFixedProperties *string + + // JSON blob containing unstructured worker properties that are transient and may + // change during regular operation. + AdditionalTransientProperties *string + + // Human friendly name of the resource. + Name *string + + // Worker orientation measured in units clockwise from north. + Orientation types.Orientation + + // Supported coordinates for worker position. + Position types.PositionCoordinates + + // Properties of the worker that are provided by the vendor FMS. + VendorProperties *types.VendorProperties + + noSmithyDocumentSerde +} + +type UpdateWorkerOutput struct { + + // Full ARN of the worker. + // + // This member is required. + Arn *string + + // Full ARN of the worker fleet. + // + // This member is required. + Fleet *string + + // Filters access by the workers identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON blob containing unstructured worker properties that are fixed and won't + // change during regular operation. + AdditionalFixedProperties *string + + // JSON blob containing unstructured worker properties that are transient and may + // change during regular operation. + AdditionalTransientProperties *string + + // Worker orientation measured in units clockwise from north. + Orientation types.Orientation + + // Supported coordinates for worker position. + Position types.PositionCoordinates + + // Properties of the worker that are provided by the vendor FMS. + VendorProperties *types.VendorProperties + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateWorkerMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWorker{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWorker{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateWorkerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWorker(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateWorker(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "UpdateWorker", + } +} diff --git a/service/iotroborunner/api_op_UpdateWorkerFleet.go b/service/iotroborunner/api_op_UpdateWorkerFleet.go new file mode 100644 index 00000000000..57d674cfad9 --- /dev/null +++ b/service/iotroborunner/api_op_UpdateWorkerFleet.go @@ -0,0 +1,147 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Grants permission to update a worker fleet +func (c *Client) UpdateWorkerFleet(ctx context.Context, params *UpdateWorkerFleetInput, optFns ...func(*Options)) (*UpdateWorkerFleetOutput, error) { + if params == nil { + params = &UpdateWorkerFleetInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateWorkerFleet", params, optFns, c.addOperationUpdateWorkerFleetMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateWorkerFleetOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateWorkerFleetInput struct { + + // Full ARN of the worker fleet. + // + // This member is required. + Id *string + + // JSON blob containing additional fixed properties regarding the worker fleet + AdditionalFixedProperties *string + + // Human friendly name of the resource. + Name *string + + noSmithyDocumentSerde +} + +type UpdateWorkerFleetOutput struct { + + // Full ARN of the worker fleet. + // + // This member is required. + Arn *string + + // Filters access by the worker fleet's identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON blob containing additional fixed properties regarding the worker fleet + AdditionalFixedProperties *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateWorkerFleetMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateWorkerFleet{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateWorkerFleet{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpUpdateWorkerFleetValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateWorkerFleet(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateWorkerFleet(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "iotroborunner", + OperationName: "UpdateWorkerFleet", + } +} diff --git a/service/iotroborunner/deserializers.go b/service/iotroborunner/deserializers.go new file mode 100644 index 00000000000..f6b15f18b65 --- /dev/null +++ b/service/iotroborunner/deserializers.go @@ -0,0 +1,5193 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" + smithy "github.com/aws/smithy-go" + smithyio "github.com/aws/smithy-go/io" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + smithytime "github.com/aws/smithy-go/time" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "math" + "strings" +) + +type awsRestjson1_deserializeOpCreateDestination struct { +} + +func (*awsRestjson1_deserializeOpCreateDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateDestination(response, &metadata) + } + output := &CreateDestinationOutput{} + 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_deserializeOpDocumentCreateDestinationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDestinationOutput(v **CreateDestinationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateDestinationOutput + if *v == nil { + sv = &CreateDestinationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationState to be of type string, got %T instead", value) + } + sv.State = types.DestinationState(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateSite struct { +} + +func (*awsRestjson1_deserializeOpCreateSite) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateSite) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateSite(response, &metadata) + } + output := &CreateSiteOutput{} + 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_deserializeOpDocumentCreateSiteOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateSite(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateSiteOutput(v **CreateSiteOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateSiteOutput + if *v == nil { + sv = &CreateSiteOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateWorker struct { +} + +func (*awsRestjson1_deserializeOpCreateWorker) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateWorker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateWorker(response, &metadata) + } + output := &CreateWorkerOutput{} + 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_deserializeOpDocumentCreateWorkerOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateWorker(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateWorkerOutput(v **CreateWorkerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateWorkerOutput + if *v == nil { + sv = &CreateWorkerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "site": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Site = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateWorkerFleet struct { +} + +func (*awsRestjson1_deserializeOpCreateWorkerFleet) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateWorkerFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorCreateWorkerFleet(response, &metadata) + } + output := &CreateWorkerFleetOutput{} + 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_deserializeOpDocumentCreateWorkerFleetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateWorkerFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateWorkerFleetOutput(v **CreateWorkerFleetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *CreateWorkerFleetOutput + if *v == nil { + sv = &CreateWorkerFleetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteDestination struct { +} + +func (*awsRestjson1_deserializeOpDeleteDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDestination(response, &metadata) + } + output := &DeleteDestinationOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteSite struct { +} + +func (*awsRestjson1_deserializeOpDeleteSite) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteSite) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteSite(response, &metadata) + } + output := &DeleteSiteOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteSite(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteWorker struct { +} + +func (*awsRestjson1_deserializeOpDeleteWorker) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWorker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorker(response, &metadata) + } + output := &DeleteWorkerOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteWorker(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteWorkerFleet struct { +} + +func (*awsRestjson1_deserializeOpDeleteWorkerFleet) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteWorkerFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteWorkerFleet(response, &metadata) + } + output := &DeleteWorkerFleetOutput{} + out.Result = output + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteWorkerFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetDestination struct { +} + +func (*awsRestjson1_deserializeOpGetDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetDestination(response, &metadata) + } + output := &GetDestinationOutput{} + 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_deserializeOpDocumentGetDestinationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDestinationOutput(v **GetDestinationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetDestinationOutput + if *v == nil { + sv = &GetDestinationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationAdditionalFixedProperties to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "site": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Site = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationState to be of type string, got %T instead", value) + } + sv.State = types.DestinationState(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSite struct { +} + +func (*awsRestjson1_deserializeOpGetSite) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSite) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetSite(response, &metadata) + } + output := &GetSiteOutput{} + 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_deserializeOpDocumentGetSiteOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSite(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSiteOutput(v **GetSiteOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetSiteOutput + if *v == nil { + sv = &GetSiteOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "countryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteCountryCode to be of type string, got %T instead", value) + } + sv.CountryCode = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWorker struct { +} + +func (*awsRestjson1_deserializeOpGetWorker) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWorker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetWorker(response, &metadata) + } + output := &GetWorkerOutput{} + 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_deserializeOpDocumentGetWorkerOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetWorker(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWorkerOutput(v **GetWorkerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetWorkerOutput + if *v == nil { + sv = &GetWorkerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerAdditionalFixedPropertiesJson to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "additionalTransientProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerAdditionalTransientPropertiesJson to be of type string, got %T instead", value) + } + sv.AdditionalTransientProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "fleet": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) + } + sv.Fleet = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "orientation": + if err := awsRestjson1_deserializeDocumentOrientation(&sv.Orientation, value); err != nil { + return err + } + + case "position": + if err := awsRestjson1_deserializeDocumentPositionCoordinates(&sv.Position, value); err != nil { + return err + } + + case "site": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Site = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "vendorProperties": + if err := awsRestjson1_deserializeDocumentVendorProperties(&sv.VendorProperties, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetWorkerFleet struct { +} + +func (*awsRestjson1_deserializeOpGetWorkerFleet) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetWorkerFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetWorkerFleet(response, &metadata) + } + output := &GetWorkerFleetOutput{} + 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_deserializeOpDocumentGetWorkerFleetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetWorkerFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetWorkerFleetOutput(v **GetWorkerFleetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *GetWorkerFleetOutput + if *v == nil { + sv = &GetWorkerFleetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetAdditionalFixedProperties to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "site": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Site = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListDestinations struct { +} + +func (*awsRestjson1_deserializeOpListDestinations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListDestinations(response, &metadata) + } + output := &ListDestinationsOutput{} + 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_deserializeOpDocumentListDestinationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListDestinationsOutput(v **ListDestinationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListDestinationsOutput + if *v == nil { + sv = &ListDestinationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "destinations": + if err := awsRestjson1_deserializeDocumentDestinations(&sv.Destinations, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListSites struct { +} + +func (*awsRestjson1_deserializeOpListSites) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListSites) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListSites(response, &metadata) + } + output := &ListSitesOutput{} + 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_deserializeOpDocumentListSitesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListSites(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListSitesOutput(v **ListSitesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListSitesOutput + if *v == nil { + sv = &ListSitesOutput{} + } 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 PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "sites": + if err := awsRestjson1_deserializeDocumentSites(&sv.Sites, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListWorkerFleets struct { +} + +func (*awsRestjson1_deserializeOpListWorkerFleets) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWorkerFleets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListWorkerFleets(response, &metadata) + } + output := &ListWorkerFleetsOutput{} + 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_deserializeOpDocumentListWorkerFleetsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListWorkerFleets(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListWorkerFleetsOutput(v **ListWorkerFleetsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListWorkerFleetsOutput + if *v == nil { + sv = &ListWorkerFleetsOutput{} + } 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 PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "workerFleets": + if err := awsRestjson1_deserializeDocumentWorkerFleets(&sv.WorkerFleets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListWorkers struct { +} + +func (*awsRestjson1_deserializeOpListWorkers) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListWorkers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListWorkers(response, &metadata) + } + output := &ListWorkersOutput{} + 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_deserializeOpDocumentListWorkersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListWorkers(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListWorkersOutput(v **ListWorkersOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *ListWorkersOutput + if *v == nil { + sv = &ListWorkersOutput{} + } 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 PaginationToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "workers": + if err := awsRestjson1_deserializeDocumentWorkers(&sv.Workers, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateDestination struct { +} + +func (*awsRestjson1_deserializeOpUpdateDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateDestination(response, &metadata) + } + output := &UpdateDestinationOutput{} + 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_deserializeOpDocumentUpdateDestinationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateDestinationOutput(v **UpdateDestinationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateDestinationOutput + if *v == nil { + sv = &UpdateDestinationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationAdditionalFixedProperties to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationState to be of type string, got %T instead", value) + } + sv.State = types.DestinationState(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateSite struct { +} + +func (*awsRestjson1_deserializeOpUpdateSite) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateSite) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateSite(response, &metadata) + } + output := &UpdateSiteOutput{} + 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_deserializeOpDocumentUpdateSiteOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateSite(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateSiteOutput(v **UpdateSiteOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateSiteOutput + if *v == nil { + sv = &UpdateSiteOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "countryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteCountryCode to be of type string, got %T instead", value) + } + sv.CountryCode = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateWorker struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorker) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorker) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorker(response, &metadata) + } + output := &UpdateWorkerOutput{} + 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_deserializeOpDocumentUpdateWorkerOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateWorker(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateWorkerOutput(v **UpdateWorkerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateWorkerOutput + if *v == nil { + sv = &UpdateWorkerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerAdditionalFixedPropertiesJson to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "additionalTransientProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerAdditionalTransientPropertiesJson to be of type string, got %T instead", value) + } + sv.AdditionalTransientProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "fleet": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) + } + sv.Fleet = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "orientation": + if err := awsRestjson1_deserializeDocumentOrientation(&sv.Orientation, value); err != nil { + return err + } + + case "position": + if err := awsRestjson1_deserializeDocumentPositionCoordinates(&sv.Position, value); err != nil { + return err + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "vendorProperties": + if err := awsRestjson1_deserializeDocumentVendorProperties(&sv.VendorProperties, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateWorkerFleet struct { +} + +func (*awsRestjson1_deserializeOpUpdateWorkerFleet) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateWorkerFleet) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdateWorkerFleet(response, &metadata) + } + output := &UpdateWorkerFleetOutput{} + 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_deserializeOpDocumentUpdateWorkerFleetOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateWorkerFleet(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateWorkerFleetOutput(v **UpdateWorkerFleetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *UpdateWorkerFleetOutput + if *v == nil { + sv = &UpdateWorkerFleetOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetAdditionalFixedProperties to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.AccessDeniedException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentAccessDeniedException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ConflictException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentConflictException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorInternalServerException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InternalServerException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentInternalServerException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ResourceNotFoundException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentResourceNotFoundException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ServiceQuotaExceededException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentServiceQuotaExceededException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ThrottlingException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentThrottlingException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_deserializeDocumentAccessDeniedException(v **types.AccessDeniedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AccessDeniedException + if *v == nil { + sv = &types.AccessDeniedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentCartesianCoordinates(v **types.CartesianCoordinates, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.CartesianCoordinates + if *v == nil { + sv = &types.CartesianCoordinates{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "x": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.X = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.X = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "y": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Y = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Y = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + case "z": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Z = ptr.Float64(f64) + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.Z = ptr.Float64(f64) + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDestination(v **types.Destination, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Destination + if *v == nil { + sv = &types.Destination{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationAdditionalFixedProperties to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "site": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Site = ptr.String(jtv) + } + + case "state": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationState to be of type string, got %T instead", value) + } + sv.State = types.DestinationState(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDestinations(v *[]types.Destination, 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.Destination + if *v == nil { + cv = []types.Destination{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Destination + destAddr := &col + if err := awsRestjson1_deserializeDocumentDestination(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentOrientation(v *types.Orientation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.Orientation +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "degrees": + var mv float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + mv = f64 + + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() + + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) + + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) + + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + mv = f64 + + default: + return fmt.Errorf("expected Double to be a JSON Number, got %T instead", value) + + } + } + uv = &types.OrientationMemberDegrees{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentPositionCoordinates(v *types.PositionCoordinates, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var uv types.PositionCoordinates +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "cartesianCoordinates": + var mv types.CartesianCoordinates + destAddr := &mv + if err := awsRestjson1_deserializeDocumentCartesianCoordinates(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.PositionCoordinatesMemberCartesianCoordinates{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ServiceQuotaExceededException + if *v == nil { + sv = &types.ServiceQuotaExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSite(v **types.Site, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Site + if *v == nil { + sv = &types.Site{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "countryCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteCountryCode to be of type string, got %T instead", value) + } + sv.CountryCode = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSites(v *[]types.Site, 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.Site + if *v == nil { + cv = []types.Site{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Site + destAddr := &col + if err := awsRestjson1_deserializeDocumentSite(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentVendorProperties(v **types.VendorProperties, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.VendorProperties + if *v == nil { + sv = &types.VendorProperties{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "vendorAdditionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VendorAdditionalFixedPropertiesJson to be of type string, got %T instead", value) + } + sv.VendorAdditionalFixedProperties = ptr.String(jtv) + } + + case "vendorAdditionalTransientProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VendorAdditionalTransientPropertiesJson to be of type string, got %T instead", value) + } + sv.VendorAdditionalTransientProperties = ptr.String(jtv) + } + + case "vendorWorkerId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VendorWorkerId to be of type string, got %T instead", value) + } + sv.VendorWorkerId = ptr.String(jtv) + } + + case "vendorWorkerIpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VendorWorkerIpAddress to be of type string, got %T instead", value) + } + sv.VendorWorkerIpAddress = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWorker(v **types.Worker, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.Worker + if *v == nil { + sv = &types.Worker{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerAdditionalFixedPropertiesJson to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "additionalTransientProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerAdditionalTransientPropertiesJson to be of type string, got %T instead", value) + } + sv.AdditionalTransientProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "fleet": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) + } + sv.Fleet = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "orientation": + if err := awsRestjson1_deserializeDocumentOrientation(&sv.Orientation, value); err != nil { + return err + } + + case "position": + if err := awsRestjson1_deserializeDocumentPositionCoordinates(&sv.Position, value); err != nil { + return err + } + + case "site": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Site = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "vendorProperties": + if err := awsRestjson1_deserializeDocumentVendorProperties(&sv.VendorProperties, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWorkerFleet(v **types.WorkerFleet, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.WorkerFleet + if *v == nil { + sv = &types.WorkerFleet{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "additionalFixedProperties": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetAdditionalFixedProperties to be of type string, got %T instead", value) + } + sv.AdditionalFixedProperties = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "createdAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WorkerFleetId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Name to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "site": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SiteArn to be of type string, got %T instead", value) + } + sv.Site = ptr.String(jtv) + } + + case "updatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected UpdatedAtTimestamp to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentWorkerFleets(v *[]types.WorkerFleet, 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.WorkerFleet + if *v == nil { + cv = []types.WorkerFleet{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.WorkerFleet + destAddr := &col + if err := awsRestjson1_deserializeDocumentWorkerFleet(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentWorkers(v *[]types.Worker, 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.Worker + if *v == nil { + cv = []types.Worker{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Worker + destAddr := &col + if err := awsRestjson1_deserializeDocumentWorker(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/iotroborunner/doc.go b/service/iotroborunner/doc.go new file mode 100644 index 00000000000..dc60a0abfcd --- /dev/null +++ b/service/iotroborunner/doc.go @@ -0,0 +1,8 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package iotroborunner provides the API client, operations, and parameter types +// for AWS IoT RoboRunner. +// +// An example service, deployed with the Octane Service creator, which will echo +// the string +package iotroborunner diff --git a/service/iotroborunner/endpoints.go b/service/iotroborunner/endpoints.go new file mode 100644 index 00000000000..5c367a03409 --- /dev/null +++ b/service/iotroborunner/endpoints.go @@ -0,0 +1,200 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/iotroborunner/internal/endpoints" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/url" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +func resolveDefaultEndpointConfiguration(o *Options) { + if o.EndpointResolver != nil { + return + } + o.EndpointResolver = NewDefaultEndpointResolver() +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "iotroborunner" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions + resolver EndpointResolver +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + if w.awsResolver == nil { + goto fallback + } + endpoint, err = w.awsResolver.ResolveEndpoint(ServiceID, region, options) + if err == nil { + return endpoint, nil + } + + if nf := (&aws.EndpointNotFoundError{}); !errors.As(err, &nf) { + return endpoint, err + } + +fallback: + if w.resolver == nil { + return endpoint, fmt.Errorf("default endpoint resolver provided was nil") + } + return w.resolver.ResolveEndpoint(region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an EndpointResolver that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the resolver will use the the provided +// fallbackResolver for resolution. +// +// fallbackResolver must not be nil +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions, fallbackResolver EndpointResolver) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + resolver: fallbackResolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} diff --git a/service/iotroborunner/generated.json b/service/iotroborunner/generated.json new file mode 100644 index 00000000000..79fa5e98c3e --- /dev/null +++ b/service/iotroborunner/generated.json @@ -0,0 +1,48 @@ +{ + "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_CreateDestination.go", + "api_op_CreateSite.go", + "api_op_CreateWorker.go", + "api_op_CreateWorkerFleet.go", + "api_op_DeleteDestination.go", + "api_op_DeleteSite.go", + "api_op_DeleteWorker.go", + "api_op_DeleteWorkerFleet.go", + "api_op_GetDestination.go", + "api_op_GetSite.go", + "api_op_GetWorker.go", + "api_op_GetWorkerFleet.go", + "api_op_ListDestinations.go", + "api_op_ListSites.go", + "api_op_ListWorkerFleets.go", + "api_op_ListWorkers.go", + "api_op_UpdateDestination.go", + "api_op_UpdateSite.go", + "api_op_UpdateWorker.go", + "api_op_UpdateWorkerFleet.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "protocol_test.go", + "serializers.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "types/types_exported_test.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/iotroborunner", + "unstable": false +} diff --git a/service/iotroborunner/go.mod b/service/iotroborunner/go.mod new file mode 100644 index 00000000000..73ce891451d --- /dev/null +++ b/service/iotroborunner/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/iotroborunner + +go 1.15 + +require ( + github.com/aws/aws-sdk-go-v2 v1.17.1 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.1.25 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.4.19 + github.com/aws/smithy-go v1.13.4 +) + +replace github.com/aws/aws-sdk-go-v2 => ../../ + +replace github.com/aws/aws-sdk-go-v2/internal/configsources => ../../internal/configsources/ + +replace github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 => ../../internal/endpoints/v2/ diff --git a/service/iotroborunner/go.sum b/service/iotroborunner/go.sum new file mode 100644 index 00000000000..b5b882cefe7 --- /dev/null +++ b/service/iotroborunner/go.sum @@ -0,0 +1,11 @@ +github.com/aws/smithy-go v1.13.4 h1:/RN2z1txIJWeXeOkzX+Hk/4Uuvv7dWtCjbmVJcrskyk= +github.com/aws/smithy-go v1.13.4/go.mod h1:Tg+OJXh4MB2R/uN61Ko2f6hTZwB/ZYGOtib8J3gBHzA= +github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= +github.com/google/go-cmp v0.5.8 h1:e6P7q2lk1O+qJJb4BtCQXlK8vWEO8V1ZeuEdJNOqZyg= +github.com/google/go-cmp v0.5.8/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= +github.com/jmespath/go-jmespath v0.4.0/go.mod h1:T8mJZnbsbmF+m6zOOFylbeCJqk5+pHWvzYPziyZiYoo= +github.com/jmespath/go-jmespath/internal/testify v1.5.1/go.mod h1:L3OGu8Wl2/fWfCI6z80xFu9LTZmf1ZRjMHUOPmWr69U= +github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= +github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= +gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= +gopkg.in/yaml.v2 v2.2.8/go.mod h1:hI93XBmqTisBFMUTm0b8Fm+jr3Dg1NNxqwp+5A1VGuI= diff --git a/service/iotroborunner/go_module_metadata.go b/service/iotroborunner/go_module_metadata.go new file mode 100644 index 00000000000..628977a3e42 --- /dev/null +++ b/service/iotroborunner/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package iotroborunner + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/iotroborunner/internal/endpoints/endpoints.go b/service/iotroborunner/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..bfa7feecab7 --- /dev/null +++ b/service/iotroborunner/internal/endpoints/endpoints.go @@ -0,0 +1,258 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "github.com/aws/aws-sdk-go-v2/aws" + endpoints "github.com/aws/aws-sdk-go-v2/internal/endpoints/v2" + "github.com/aws/smithy-go/logging" + "regexp" +) + +// Options is the endpoint resolver configuration options +type Options struct { + // Logger is a logging implementation that log events should be sent to. + Logger logging.Logger + + // LogDeprecated indicates that deprecated endpoints should be logged to the + // provided logger. + LogDeprecated bool + + // ResolvedRegion is used to override the region to be resolved, rather then the + // using the value passed to the ResolveEndpoint method. This value is used by the + // SDK to translate regions like fips-us-east-1 or us-east-1-fips to an alternative + // name. You must not set this value directly in your application. + ResolvedRegion string + + // DisableHTTPS informs the resolver to return an endpoint that does not use the + // HTTPS scheme. + DisableHTTPS bool + + // UseDualStackEndpoint specifies the resolver must resolve a dual-stack endpoint. + UseDualStackEndpoint aws.DualStackEndpointState + + // UseFIPSEndpoint specifies the resolver must resolve a FIPS endpoint. + UseFIPSEndpoint aws.FIPSEndpointState +} + +func (o Options) GetResolvedRegion() string { + return o.ResolvedRegion +} + +func (o Options) GetDisableHTTPS() bool { + return o.DisableHTTPS +} + +func (o Options) GetUseDualStackEndpoint() aws.DualStackEndpointState { + return o.UseDualStackEndpoint +} + +func (o Options) GetUseFIPSEndpoint() aws.FIPSEndpointState { + return o.UseFIPSEndpoint +} + +func transformToSharedOptions(options Options) endpoints.Options { + return endpoints.Options{ + Logger: options.Logger, + LogDeprecated: options.LogDeprecated, + ResolvedRegion: options.ResolvedRegion, + DisableHTTPS: options.DisableHTTPS, + UseDualStackEndpoint: options.UseDualStackEndpoint, + UseFIPSEndpoint: options.UseFIPSEndpoint, + } +} + +// Resolver IoT RoboRunner endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "iotroborunner.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "iotroborunner-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "iotroborunner-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "iotroborunner.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{}, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "iotroborunner.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "iotroborunner-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "iotroborunner-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "iotroborunner.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "iotroborunner-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "iotroborunner.{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: "iotroborunner-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "iotroborunner.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "iotroborunner.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "iotroborunner-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "iotroborunner-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "iotroborunner.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/iotroborunner/internal/endpoints/endpoints_test.go b/service/iotroborunner/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/iotroborunner/internal/endpoints/endpoints_test.go @@ -0,0 +1,11 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package endpoints + +import ( + "testing" +) + +func TestRegexCompile(t *testing.T) { + _ = defaultPartitions +} diff --git a/service/iotroborunner/protocol_test.go b/service/iotroborunner/protocol_test.go new file mode 100644 index 00000000000..ca067cafb16 --- /dev/null +++ b/service/iotroborunner/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner diff --git a/service/iotroborunner/serializers.go b/service/iotroborunner/serializers.go new file mode 100644 index 00000000000..068849d6cd8 --- /dev/null +++ b/service/iotroborunner/serializers.go @@ -0,0 +1,1594 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "bytes" + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "math" +) + +type awsRestjson1_serializeOpCreateDestination struct { +} + +func (*awsRestjson1_serializeOpCreateDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/createDestination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateDestinationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateDestinationInput(v *CreateDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDestinationInput(v *CreateDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFixedProperties != nil { + ok := object.Key("additionalFixedProperties") + ok.String(*v.AdditionalFixedProperties) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Site != nil { + ok := object.Key("site") + ok.String(*v.Site) + } + + if len(v.State) > 0 { + ok := object.Key("state") + ok.String(string(v.State)) + } + + return nil +} + +type awsRestjson1_serializeOpCreateSite struct { +} + +func (*awsRestjson1_serializeOpCreateSite) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateSite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateSiteInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/createSite") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateSiteInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateSiteInput(v *CreateSiteInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateSiteInput(v *CreateSiteInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.CountryCode != nil { + ok := object.Key("countryCode") + ok.String(*v.CountryCode) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpCreateWorker struct { +} + +func (*awsRestjson1_serializeOpCreateWorker) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateWorker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWorkerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/createWorker") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateWorkerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateWorkerInput(v *CreateWorkerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateWorkerInput(v *CreateWorkerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFixedProperties != nil { + ok := object.Key("additionalFixedProperties") + ok.String(*v.AdditionalFixedProperties) + } + + if v.AdditionalTransientProperties != nil { + ok := object.Key("additionalTransientProperties") + ok.String(*v.AdditionalTransientProperties) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Fleet != nil { + ok := object.Key("fleet") + ok.String(*v.Fleet) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Orientation != nil { + ok := object.Key("orientation") + if err := awsRestjson1_serializeDocumentOrientation(v.Orientation, ok); err != nil { + return err + } + } + + if v.Position != nil { + ok := object.Key("position") + if err := awsRestjson1_serializeDocumentPositionCoordinates(v.Position, ok); err != nil { + return err + } + } + + if v.VendorProperties != nil { + ok := object.Key("vendorProperties") + if err := awsRestjson1_serializeDocumentVendorProperties(v.VendorProperties, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateWorkerFleet struct { +} + +func (*awsRestjson1_serializeOpCreateWorkerFleet) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateWorkerFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateWorkerFleetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/createWorkerFleet") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateWorkerFleetInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateWorkerFleetInput(v *CreateWorkerFleetInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateWorkerFleetInput(v *CreateWorkerFleetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFixedProperties != nil { + ok := object.Key("additionalFixedProperties") + ok.String(*v.AdditionalFixedProperties) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Site != nil { + ok := object.Key("site") + ok.String(*v.Site) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteDestination struct { +} + +func (*awsRestjson1_serializeOpDeleteDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/deleteDestination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteDestinationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteDestinationInput(v *DeleteDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteDestinationInput(v *DeleteDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteSite struct { +} + +func (*awsRestjson1_serializeOpDeleteSite) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteSite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteSiteInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/deleteSite") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteSiteInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteSiteInput(v *DeleteSiteInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteSiteInput(v *DeleteSiteInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWorker struct { +} + +func (*awsRestjson1_serializeOpDeleteWorker) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWorker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWorkerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/deleteWorker") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteWorkerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteWorkerInput(v *DeleteWorkerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteWorkerInput(v *DeleteWorkerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteWorkerFleet struct { +} + +func (*awsRestjson1_serializeOpDeleteWorkerFleet) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteWorkerFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteWorkerFleetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/deleteWorkerFleet") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDeleteWorkerFleetInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteWorkerFleetInput(v *DeleteWorkerFleetInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDeleteWorkerFleetInput(v *DeleteWorkerFleetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + +type awsRestjson1_serializeOpGetDestination struct { +} + +func (*awsRestjson1_serializeOpGetDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/getDestination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetDestinationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetDestinationInput(v *GetDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id != nil { + encoder.SetQuery("id").String(*v.Id) + } + + return nil +} + +type awsRestjson1_serializeOpGetSite struct { +} + +func (*awsRestjson1_serializeOpGetSite) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetSite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetSiteInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/getSite") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetSiteInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetSiteInput(v *GetSiteInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id != nil { + encoder.SetQuery("id").String(*v.Id) + } + + return nil +} + +type awsRestjson1_serializeOpGetWorker struct { +} + +func (*awsRestjson1_serializeOpGetWorker) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWorker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWorkerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/getWorker") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetWorkerInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetWorkerInput(v *GetWorkerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id != nil { + encoder.SetQuery("id").String(*v.Id) + } + + return nil +} + +type awsRestjson1_serializeOpGetWorkerFleet struct { +} + +func (*awsRestjson1_serializeOpGetWorkerFleet) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetWorkerFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetWorkerFleetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/getWorkerFleet") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetWorkerFleetInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetWorkerFleetInput(v *GetWorkerFleetInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Id != nil { + encoder.SetQuery("id").String(*v.Id) + } + + return nil +} + +type awsRestjson1_serializeOpListDestinations struct { +} + +func (*awsRestjson1_serializeOpListDestinations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListDestinations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDestinationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/listDestinations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListDestinationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListDestinationsInput(v *ListDestinationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.Site != nil { + encoder.SetQuery("site").String(*v.Site) + } + + if len(v.State) > 0 { + encoder.SetQuery("state").String(string(v.State)) + } + + return nil +} + +type awsRestjson1_serializeOpListSites struct { +} + +func (*awsRestjson1_serializeOpListSites) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListSites) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListSitesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/listSites") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListSitesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListSitesInput(v *ListSitesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpListWorkerFleets struct { +} + +func (*awsRestjson1_serializeOpListWorkerFleets) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWorkerFleets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWorkerFleetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/listWorkerFleets") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListWorkerFleetsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListWorkerFleetsInput(v *ListWorkerFleetsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.Site != nil { + encoder.SetQuery("site").String(*v.Site) + } + + return nil +} + +type awsRestjson1_serializeOpListWorkers struct { +} + +func (*awsRestjson1_serializeOpListWorkers) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListWorkers) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListWorkersInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/listWorkers") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListWorkersInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListWorkersInput(v *ListWorkersInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Fleet != nil { + encoder.SetQuery("fleet").String(*v.Fleet) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.Site != nil { + encoder.SetQuery("site").String(*v.Site) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateDestination struct { +} + +func (*awsRestjson1_serializeOpUpdateDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/updateDestination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateDestinationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateDestinationInput(v *UpdateDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateDestinationInput(v *UpdateDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFixedProperties != nil { + ok := object.Key("additionalFixedProperties") + ok.String(*v.AdditionalFixedProperties) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if len(v.State) > 0 { + ok := object.Key("state") + ok.String(string(v.State)) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateSite struct { +} + +func (*awsRestjson1_serializeOpUpdateSite) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateSite) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateSiteInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/updateSite") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateSiteInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateSiteInput(v *UpdateSiteInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateSiteInput(v *UpdateSiteInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CountryCode != nil { + ok := object.Key("countryCode") + ok.String(*v.CountryCode) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +type awsRestjson1_serializeOpUpdateWorker struct { +} + +func (*awsRestjson1_serializeOpUpdateWorker) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateWorker) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateWorkerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/updateWorker") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateWorkerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateWorkerInput(v *UpdateWorkerInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateWorkerInput(v *UpdateWorkerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFixedProperties != nil { + ok := object.Key("additionalFixedProperties") + ok.String(*v.AdditionalFixedProperties) + } + + if v.AdditionalTransientProperties != nil { + ok := object.Key("additionalTransientProperties") + ok.String(*v.AdditionalTransientProperties) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Orientation != nil { + ok := object.Key("orientation") + if err := awsRestjson1_serializeDocumentOrientation(v.Orientation, ok); err != nil { + return err + } + } + + if v.Position != nil { + ok := object.Key("position") + if err := awsRestjson1_serializeDocumentPositionCoordinates(v.Position, ok); err != nil { + return err + } + } + + if v.VendorProperties != nil { + ok := object.Key("vendorProperties") + if err := awsRestjson1_serializeDocumentVendorProperties(v.VendorProperties, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateWorkerFleet struct { +} + +func (*awsRestjson1_serializeOpUpdateWorkerFleet) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateWorkerFleet) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateWorkerFleetInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/updateWorkerFleet") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateWorkerFleetInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateWorkerFleetInput(v *UpdateWorkerFleetInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateWorkerFleetInput(v *UpdateWorkerFleetInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AdditionalFixedProperties != nil { + ok := object.Key("additionalFixedProperties") + ok.String(*v.AdditionalFixedProperties) + } + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentCartesianCoordinates(v *types.CartesianCoordinates, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.X != nil { + ok := object.Key("x") + switch { + case math.IsNaN(*v.X): + ok.String("NaN") + + case math.IsInf(*v.X, 1): + ok.String("Infinity") + + case math.IsInf(*v.X, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.X) + + } + } + + if v.Y != nil { + ok := object.Key("y") + switch { + case math.IsNaN(*v.Y): + ok.String("NaN") + + case math.IsInf(*v.Y, 1): + ok.String("Infinity") + + case math.IsInf(*v.Y, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Y) + + } + } + + if v.Z != nil { + ok := object.Key("z") + switch { + case math.IsNaN(*v.Z): + ok.String("NaN") + + case math.IsInf(*v.Z, 1): + ok.String("Infinity") + + case math.IsInf(*v.Z, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.Z) + + } + } + + return nil +} + +func awsRestjson1_serializeDocumentOrientation(v types.Orientation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.OrientationMemberDegrees: + av := object.Key("degrees") + switch { + case math.IsNaN(uv.Value): + av.String("NaN") + + case math.IsInf(uv.Value, 1): + av.String("Infinity") + + case math.IsInf(uv.Value, -1): + av.String("-Infinity") + + default: + av.Double(uv.Value) + + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentPositionCoordinates(v types.PositionCoordinates, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.PositionCoordinatesMemberCartesianCoordinates: + av := object.Key("cartesianCoordinates") + if err := awsRestjson1_serializeDocumentCartesianCoordinates(&uv.Value, av); err != nil { + return err + } + + default: + return fmt.Errorf("attempted to serialize unknown member type %T for union %T", uv, v) + + } + return nil +} + +func awsRestjson1_serializeDocumentVendorProperties(v *types.VendorProperties, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.VendorAdditionalFixedProperties != nil { + ok := object.Key("vendorAdditionalFixedProperties") + ok.String(*v.VendorAdditionalFixedProperties) + } + + if v.VendorAdditionalTransientProperties != nil { + ok := object.Key("vendorAdditionalTransientProperties") + ok.String(*v.VendorAdditionalTransientProperties) + } + + if v.VendorWorkerId != nil { + ok := object.Key("vendorWorkerId") + ok.String(*v.VendorWorkerId) + } + + if v.VendorWorkerIpAddress != nil { + ok := object.Key("vendorWorkerIpAddress") + ok.String(*v.VendorWorkerIpAddress) + } + + return nil +} diff --git a/service/iotroborunner/types/enums.go b/service/iotroborunner/types/enums.go new file mode 100644 index 00000000000..019e33b1761 --- /dev/null +++ b/service/iotroborunner/types/enums.go @@ -0,0 +1,23 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type DestinationState string + +// Enum values for DestinationState +const ( + DestinationStateEnabled DestinationState = "ENABLED" + DestinationStateDisabled DestinationState = "DISABLED" + DestinationStateDecommissioned DestinationState = "DECOMMISSIONED" +) + +// Values returns all known values for DestinationState. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (DestinationState) Values() []DestinationState { + return []DestinationState{ + "ENABLED", + "DISABLED", + "DECOMMISSIONED", + } +} diff --git a/service/iotroborunner/types/errors.go b/service/iotroborunner/types/errors.go new file mode 100644 index 00000000000..e73e4550068 --- /dev/null +++ b/service/iotroborunner/types/errors.go @@ -0,0 +1,142 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + "fmt" + smithy "github.com/aws/smithy-go" +) + +// User does not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { return "AccessDeniedException" } +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception thrown if a resource in a create request already exists. +type ConflictException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { return "ConflictException" } +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception thrown if something goes wrong within the service. +type InternalServerException struct { + Message *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 { return "InternalServerException" } +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Exception thrown if a resource referenced in the request doesn't exist. +type ResourceNotFoundException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { return "ResourceNotFoundException" } +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception thrown if the user's AWS account has reached a service limit and the +// operation cannot proceed. +type ServiceQuotaExceededException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { return "ServiceQuotaExceededException" } +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception thrown if the api has been called too quickly be the client. +type ThrottlingException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { return "ThrottlingException" } +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Exception thrown if an invalid parameter is provided to an API. +type ValidationException struct { + Message *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { return "ValidationException" } +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iotroborunner/types/types.go b/service/iotroborunner/types/types.go new file mode 100644 index 00000000000..658c4b81748 --- /dev/null +++ b/service/iotroborunner/types/types.go @@ -0,0 +1,267 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// Cartesian coordinates in 3D space relative to the RoboRunner origin. +type CartesianCoordinates struct { + + // X coordinate. + // + // This member is required. + X *float64 + + // Y coordinate. + // + // This member is required. + Y *float64 + + // Z coordinate. + Z *float64 + + noSmithyDocumentSerde +} + +// Area within a facility where work can be performed. +type Destination struct { + + // Destination ARN. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the destination's identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Site ARN. + // + // This member is required. + Site *string + + // State of the destination. + // + // This member is required. + State DestinationState + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON document containing additional fixed properties regarding the destination + AdditionalFixedProperties *string + + noSmithyDocumentSerde +} + +// Worker orientation measured in units clockwise from north. +// +// The following types satisfy this interface: +// +// OrientationMemberDegrees +type Orientation interface { + isOrientation() +} + +// Degrees, limited on [0, 360) +type OrientationMemberDegrees struct { + Value float64 + + noSmithyDocumentSerde +} + +func (*OrientationMemberDegrees) isOrientation() {} + +// Supported coordinates for worker position. +// +// The following types satisfy this interface: +// +// PositionCoordinatesMemberCartesianCoordinates +type PositionCoordinates interface { + isPositionCoordinates() +} + +// Cartesian coordinates. +type PositionCoordinatesMemberCartesianCoordinates struct { + Value CartesianCoordinates + + noSmithyDocumentSerde +} + +func (*PositionCoordinatesMemberCartesianCoordinates) isPositionCoordinates() {} + +// Facility containing destinations, workers, activities, and tasks. +type Site struct { + + // Site ARN. + // + // This member is required. + Arn *string + + // A valid ISO 3166-1 alpha-2 code for the country in which the site resides. e.g., + // US. + // + // This member is required. + CountryCode *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // The name of the site. Mutable after creation and unique within a given account. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Properties of the worker that are provided by the vendor FMS. +type VendorProperties struct { + + // The worker ID defined by the vendor FMS. + // + // This member is required. + VendorWorkerId *string + + // JSON blob containing unstructured vendor properties that are fixed and won't + // change during regular operation. + VendorAdditionalFixedProperties *string + + // JSON blob containing unstructured vendor properties that are transient and may + // change during regular operation. + VendorAdditionalTransientProperties *string + + // The worker IP address defined by the vendor FMS. + VendorWorkerIpAddress *string + + noSmithyDocumentSerde +} + +// A unit capable of performing tasks. +type Worker struct { + + // Full ARN of the worker. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Full ARN of the worker fleet. + // + // This member is required. + Fleet *string + + // Filters access by the workers identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Site ARN. + // + // This member is required. + Site *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON blob containing unstructured worker properties that are fixed and won't + // change during regular operation. + AdditionalFixedProperties *string + + // JSON blob containing unstructured worker properties that are transient and may + // change during regular operation. + AdditionalTransientProperties *string + + // Worker orientation measured in units clockwise from north. + Orientation Orientation + + // Supported coordinates for worker position. + Position PositionCoordinates + + // Properties of the worker that are provided by the vendor FMS. + VendorProperties *VendorProperties + + noSmithyDocumentSerde +} + +// A collection of workers organized within a facility. +type WorkerFleet struct { + + // Full ARN of the worker fleet. + // + // This member is required. + Arn *string + + // Timestamp at which the resource was created. + // + // This member is required. + CreatedAt *time.Time + + // Filters access by the worker fleet's identifier + // + // This member is required. + Id *string + + // Human friendly name of the resource. + // + // This member is required. + Name *string + + // Site ARN. + // + // This member is required. + Site *string + + // Timestamp at which the resource was last updated. + // + // This member is required. + UpdatedAt *time.Time + + // JSON blob containing additional fixed properties regarding the worker fleet + AdditionalFixedProperties *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +// UnknownUnionMember is returned when a union member is returned over the wire, +// but has an unknown tag. +type UnknownUnionMember struct { + Tag string + Value []byte + + noSmithyDocumentSerde +} + +func (*UnknownUnionMember) isOrientation() {} +func (*UnknownUnionMember) isPositionCoordinates() {} diff --git a/service/iotroborunner/types/types_exported_test.go b/service/iotroborunner/types/types_exported_test.go new file mode 100644 index 00000000000..9e42a7135cc --- /dev/null +++ b/service/iotroborunner/types/types_exported_test.go @@ -0,0 +1,44 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" +) + +func ExampleOrientation_outputUsage() { + var union types.Orientation + // type switches can be used to check the union value + switch v := union.(type) { + case *types.OrientationMemberDegrees: + _ = v.Value // Value is float64 + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *float64 + +func ExamplePositionCoordinates_outputUsage() { + var union types.PositionCoordinates + // type switches can be used to check the union value + switch v := union.(type) { + case *types.PositionCoordinatesMemberCartesianCoordinates: + _ = v.Value // Value is types.CartesianCoordinates + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.CartesianCoordinates diff --git a/service/iotroborunner/validators.go b/service/iotroborunner/validators.go new file mode 100644 index 00000000000..1ae565ef72e --- /dev/null +++ b/service/iotroborunner/validators.go @@ -0,0 +1,836 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotroborunner + +import ( + "context" + "fmt" + "github.com/aws/aws-sdk-go-v2/service/iotroborunner/types" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpCreateDestination struct { +} + +func (*validateOpCreateDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateSite struct { +} + +func (*validateOpCreateSite) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateSiteInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateSiteInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWorkerFleet struct { +} + +func (*validateOpCreateWorkerFleet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWorkerFleetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWorkerFleetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateWorker struct { +} + +func (*validateOpCreateWorker) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateWorkerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateWorkerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteDestination struct { +} + +func (*validateOpDeleteDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteSite struct { +} + +func (*validateOpDeleteSite) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteSiteInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteSiteInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWorkerFleet struct { +} + +func (*validateOpDeleteWorkerFleet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWorkerFleetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWorkerFleetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteWorker struct { +} + +func (*validateOpDeleteWorker) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteWorkerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteWorkerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetDestination struct { +} + +func (*validateOpGetDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetSite struct { +} + +func (*validateOpGetSite) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetSiteInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetSiteInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWorkerFleet struct { +} + +func (*validateOpGetWorkerFleet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWorkerFleetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWorkerFleetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetWorker struct { +} + +func (*validateOpGetWorker) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetWorkerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetWorkerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListDestinations struct { +} + +func (*validateOpListDestinations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListDestinations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListDestinationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListDestinationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListWorkerFleets struct { +} + +func (*validateOpListWorkerFleets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListWorkerFleets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListWorkerFleetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListWorkerFleetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListWorkers struct { +} + +func (*validateOpListWorkers) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListWorkers) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListWorkersInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListWorkersInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateDestination struct { +} + +func (*validateOpUpdateDestination) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDestination) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDestinationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDestinationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateSite struct { +} + +func (*validateOpUpdateSite) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateSite) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateSiteInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateSiteInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateWorkerFleet struct { +} + +func (*validateOpUpdateWorkerFleet) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateWorkerFleet) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateWorkerFleetInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateWorkerFleetInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateWorker struct { +} + +func (*validateOpUpdateWorker) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateWorker) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateWorkerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateWorkerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpCreateDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDestination{}, middleware.After) +} + +func addOpCreateSiteValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateSite{}, middleware.After) +} + +func addOpCreateWorkerFleetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWorkerFleet{}, middleware.After) +} + +func addOpCreateWorkerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateWorker{}, middleware.After) +} + +func addOpDeleteDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDestination{}, middleware.After) +} + +func addOpDeleteSiteValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteSite{}, middleware.After) +} + +func addOpDeleteWorkerFleetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWorkerFleet{}, middleware.After) +} + +func addOpDeleteWorkerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteWorker{}, middleware.After) +} + +func addOpGetDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDestination{}, middleware.After) +} + +func addOpGetSiteValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetSite{}, middleware.After) +} + +func addOpGetWorkerFleetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWorkerFleet{}, middleware.After) +} + +func addOpGetWorkerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetWorker{}, middleware.After) +} + +func addOpListDestinationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListDestinations{}, middleware.After) +} + +func addOpListWorkerFleetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListWorkerFleets{}, middleware.After) +} + +func addOpListWorkersValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListWorkers{}, middleware.After) +} + +func addOpUpdateDestinationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDestination{}, middleware.After) +} + +func addOpUpdateSiteValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateSite{}, middleware.After) +} + +func addOpUpdateWorkerFleetValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateWorkerFleet{}, middleware.After) +} + +func addOpUpdateWorkerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateWorker{}, middleware.After) +} + +func validateCartesianCoordinates(v *types.CartesianCoordinates) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CartesianCoordinates"} + if v.X == nil { + invalidParams.Add(smithy.NewErrParamRequired("X")) + } + if v.Y == nil { + invalidParams.Add(smithy.NewErrParamRequired("Y")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePositionCoordinates(v types.PositionCoordinates) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PositionCoordinates"} + switch uv := v.(type) { + case *types.PositionCoordinatesMemberCartesianCoordinates: + if err := validateCartesianCoordinates(&uv.Value); err != nil { + invalidParams.AddNested("[cartesianCoordinates]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateVendorProperties(v *types.VendorProperties) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "VendorProperties"} + if v.VendorWorkerId == nil { + invalidParams.Add(smithy.NewErrParamRequired("VendorWorkerId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDestinationInput(v *CreateDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDestinationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Site == nil { + invalidParams.Add(smithy.NewErrParamRequired("Site")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateSiteInput(v *CreateSiteInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateSiteInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.CountryCode == nil { + invalidParams.Add(smithy.NewErrParamRequired("CountryCode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateWorkerFleetInput(v *CreateWorkerFleetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWorkerFleetInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Site == nil { + invalidParams.Add(smithy.NewErrParamRequired("Site")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateWorkerInput(v *CreateWorkerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateWorkerInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Fleet == nil { + invalidParams.Add(smithy.NewErrParamRequired("Fleet")) + } + if v.VendorProperties != nil { + if err := validateVendorProperties(v.VendorProperties); err != nil { + invalidParams.AddNested("VendorProperties", err.(smithy.InvalidParamsError)) + } + } + if v.Position != nil { + if err := validatePositionCoordinates(v.Position); err != nil { + invalidParams.AddNested("Position", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDestinationInput(v *DeleteDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDestinationInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteSiteInput(v *DeleteSiteInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteSiteInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWorkerFleetInput(v *DeleteWorkerFleetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkerFleetInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteWorkerInput(v *DeleteWorkerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteWorkerInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetDestinationInput(v *GetDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDestinationInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetSiteInput(v *GetSiteInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetSiteInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWorkerFleetInput(v *GetWorkerFleetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWorkerFleetInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetWorkerInput(v *GetWorkerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetWorkerInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListDestinationsInput(v *ListDestinationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListDestinationsInput"} + if v.Site == nil { + invalidParams.Add(smithy.NewErrParamRequired("Site")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListWorkerFleetsInput(v *ListWorkerFleetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListWorkerFleetsInput"} + if v.Site == nil { + invalidParams.Add(smithy.NewErrParamRequired("Site")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListWorkersInput(v *ListWorkersInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListWorkersInput"} + if v.Site == nil { + invalidParams.Add(smithy.NewErrParamRequired("Site")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateDestinationInput(v *UpdateDestinationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDestinationInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateSiteInput(v *UpdateSiteInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateSiteInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateWorkerFleetInput(v *UpdateWorkerFleetInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateWorkerFleetInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateWorkerInput(v *UpdateWorkerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateWorkerInput"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.VendorProperties != nil { + if err := validateVendorProperties(v.VendorProperties); err != nil { + invalidParams.AddNested("VendorProperties", err.(smithy.InvalidParamsError)) + } + } + if v.Position != nil { + if err := validatePositionCoordinates(v.Position); err != nil { + invalidParams.AddNested("Position", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/proton/internal/endpoints/endpoints.go b/service/proton/internal/endpoints/endpoints.go index 69d5672b6aa..87ae75e2058 100644 --- a/service/proton/internal/endpoints/endpoints.go +++ b/service/proton/internal/endpoints/endpoints.go @@ -138,9 +138,27 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{}, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, diff --git a/service/quicksight/api_op_DeleteAccountSubscription.go b/service/quicksight/api_op_DeleteAccountSubscription.go new file mode 100644 index 00000000000..a3b90e51b21 --- /dev/null +++ b/service/quicksight/api_op_DeleteAccountSubscription.go @@ -0,0 +1,128 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package quicksight + +import ( + "context" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use the DeleteAccountSubscription operation to delete an Amazon QuickSight +// account. This operation will result in an error message if you have configured +// your account termination protection settings to True. To change this setting and +// delete your account, call the UpdateAccountSettings API and set the value of the +// TerminationProtectionEnabled parameter to False, then make another call to the +// DeleteAccountSubscription API. +func (c *Client) DeleteAccountSubscription(ctx context.Context, params *DeleteAccountSubscriptionInput, optFns ...func(*Options)) (*DeleteAccountSubscriptionOutput, error) { + if params == nil { + params = &DeleteAccountSubscriptionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteAccountSubscription", params, optFns, c.addOperationDeleteAccountSubscriptionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteAccountSubscriptionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteAccountSubscriptionInput struct { + + // The Amazon Web Services account ID of the account that you want to delete. + // + // This member is required. + AwsAccountId *string + + noSmithyDocumentSerde +} + +type DeleteAccountSubscriptionOutput struct { + + // The Amazon Web Services request ID for this operation. + RequestId *string + + // The HTTP status of the request. + Status int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteAccountSubscriptionMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteAccountSubscription{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteAccountSubscription{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpDeleteAccountSubscriptionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteAccountSubscription(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteAccountSubscription(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "quicksight", + OperationName: "DeleteAccountSubscription", + } +} diff --git a/service/quicksight/api_op_DescribeAccountSubscription.go b/service/quicksight/api_op_DescribeAccountSubscription.go index b8066a33b8e..76c884ae8c4 100644 --- a/service/quicksight/api_op_DescribeAccountSubscription.go +++ b/service/quicksight/api_op_DescribeAccountSubscription.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Use the DescribeAccountSubscription operation to receive a description of a +// Use the DescribeAccountSubscription operation to receive a description of an // Amazon QuickSight account's subscription. A successful API call returns an // AccountInfo object that includes an account's name, subscription status, // authentication type, edition, and notification email address. diff --git a/service/quicksight/api_op_GenerateEmbedUrlForAnonymousUser.go b/service/quicksight/api_op_GenerateEmbedUrlForAnonymousUser.go index 18054eb7ca3..5678b328f2b 100644 --- a/service/quicksight/api_op_GenerateEmbedUrlForAnonymousUser.go +++ b/service/quicksight/api_op_GenerateEmbedUrlForAnonymousUser.go @@ -108,6 +108,11 @@ type GenerateEmbedUrlForAnonymousUserInput struct { type GenerateEmbedUrlForAnonymousUserOutput struct { + // The Amazon Resource Name (ARN) to use for the anonymous Amazon QuickSight user. + // + // This member is required. + AnonymousUserArn *string + // The embed URL for the dashboard. // // This member is required. diff --git a/service/quicksight/api_op_SearchDataSets.go b/service/quicksight/api_op_SearchDataSets.go new file mode 100644 index 00000000000..e447825be65 --- /dev/null +++ b/service/quicksight/api_op_SearchDataSets.go @@ -0,0 +1,233 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package quicksight + +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/quicksight/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use the SearchDataSets operation to search for datasets that belong to an +// account. +func (c *Client) SearchDataSets(ctx context.Context, params *SearchDataSetsInput, optFns ...func(*Options)) (*SearchDataSetsOutput, error) { + if params == nil { + params = &SearchDataSetsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchDataSets", params, optFns, c.addOperationSearchDataSetsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchDataSetsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchDataSetsInput struct { + + // The Amazon Web Services account ID. + // + // This member is required. + AwsAccountId *string + + // The filters to apply to the search. + // + // This member is required. + Filters []types.DataSetSearchFilter + + // The maximum number of results to be returned per request. + MaxResults *int32 + + // A pagination token that can be used in a subsequent request. + NextToken *string + + noSmithyDocumentSerde +} + +type SearchDataSetsOutput struct { + + // A DataSetSummaries object that returns a summary of a dataset. + DataSetSummaries []types.DataSetSummary + + // A pagination token that can be used in a subsequent request. + NextToken *string + + // The Amazon Web Services request ID for this operation. + RequestId *string + + // The HTTP status of the request. + Status int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchDataSetsMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchDataSets{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchDataSets{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchDataSetsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchDataSets(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// SearchDataSetsAPIClient is a client that implements the SearchDataSets +// operation. +type SearchDataSetsAPIClient interface { + SearchDataSets(context.Context, *SearchDataSetsInput, ...func(*Options)) (*SearchDataSetsOutput, error) +} + +var _ SearchDataSetsAPIClient = (*Client)(nil) + +// SearchDataSetsPaginatorOptions is the paginator options for SearchDataSets +type SearchDataSetsPaginatorOptions struct { + // The maximum number of results to be returned per 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 +} + +// SearchDataSetsPaginator is a paginator for SearchDataSets +type SearchDataSetsPaginator struct { + options SearchDataSetsPaginatorOptions + client SearchDataSetsAPIClient + params *SearchDataSetsInput + nextToken *string + firstPage bool +} + +// NewSearchDataSetsPaginator returns a new SearchDataSetsPaginator +func NewSearchDataSetsPaginator(client SearchDataSetsAPIClient, params *SearchDataSetsInput, optFns ...func(*SearchDataSetsPaginatorOptions)) *SearchDataSetsPaginator { + if params == nil { + params = &SearchDataSetsInput{} + } + + options := SearchDataSetsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchDataSetsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchDataSetsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchDataSets page. +func (p *SearchDataSetsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchDataSetsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.SearchDataSets(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opSearchDataSets(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "quicksight", + OperationName: "SearchDataSets", + } +} diff --git a/service/quicksight/api_op_SearchDataSources.go b/service/quicksight/api_op_SearchDataSources.go new file mode 100644 index 00000000000..845ba404bb3 --- /dev/null +++ b/service/quicksight/api_op_SearchDataSources.go @@ -0,0 +1,233 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package quicksight + +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/quicksight/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use the SearchDataSources operation to search for data sources that belong to an +// account. +func (c *Client) SearchDataSources(ctx context.Context, params *SearchDataSourcesInput, optFns ...func(*Options)) (*SearchDataSourcesOutput, error) { + if params == nil { + params = &SearchDataSourcesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SearchDataSources", params, optFns, c.addOperationSearchDataSourcesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SearchDataSourcesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SearchDataSourcesInput struct { + + // The Amazon Web Services account ID. + // + // This member is required. + AwsAccountId *string + + // The filters to apply to the search. + // + // This member is required. + Filters []types.DataSourceSearchFilter + + // The maximum number of results to be returned per request. + MaxResults *int32 + + // A pagination token that can be used in a subsequent request. + NextToken *string + + noSmithyDocumentSerde +} + +type SearchDataSourcesOutput struct { + + // A DataSourceSummaries object that returns a summary of a data source. + DataSourceSummaries []types.DataSourceSummary + + // A pagination token that can be used in a subsequent request. + NextToken *string + + // The Amazon Web Services request ID for this operation. + RequestId *string + + // The HTTP status of the request. + Status int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSearchDataSourcesMiddlewares(stack *middleware.Stack, options Options) (err error) { + err = stack.Serialize.Add(&awsRestjson1_serializeOpSearchDataSources{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSearchDataSources{}, middleware.After) + if err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddClientRequestIDMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddComputeContentLengthMiddleware(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = v4.AddComputePayloadSHA256Middleware(stack); err != nil { + return err + } + if err = addRetryMiddlewares(stack, options); err != nil { + return err + } + if err = addHTTPSignerV4Middleware(stack, options); err != nil { + return err + } + if err = awsmiddleware.AddRawResponseToMetadata(stack); err != nil { + return err + } + if err = awsmiddleware.AddRecordResponseTiming(stack); err != nil { + return err + } + if err = addClientUserAgent(stack); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addOpSearchDataSourcesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSearchDataSources(options.Region), middleware.Before); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + return nil +} + +// SearchDataSourcesAPIClient is a client that implements the SearchDataSources +// operation. +type SearchDataSourcesAPIClient interface { + SearchDataSources(context.Context, *SearchDataSourcesInput, ...func(*Options)) (*SearchDataSourcesOutput, error) +} + +var _ SearchDataSourcesAPIClient = (*Client)(nil) + +// SearchDataSourcesPaginatorOptions is the paginator options for SearchDataSources +type SearchDataSourcesPaginatorOptions struct { + // The maximum number of results to be returned per 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 +} + +// SearchDataSourcesPaginator is a paginator for SearchDataSources +type SearchDataSourcesPaginator struct { + options SearchDataSourcesPaginatorOptions + client SearchDataSourcesAPIClient + params *SearchDataSourcesInput + nextToken *string + firstPage bool +} + +// NewSearchDataSourcesPaginator returns a new SearchDataSourcesPaginator +func NewSearchDataSourcesPaginator(client SearchDataSourcesAPIClient, params *SearchDataSourcesInput, optFns ...func(*SearchDataSourcesPaginatorOptions)) *SearchDataSourcesPaginator { + if params == nil { + params = &SearchDataSourcesInput{} + } + + options := SearchDataSourcesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &SearchDataSourcesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *SearchDataSourcesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next SearchDataSources page. +func (p *SearchDataSourcesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*SearchDataSourcesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + result, err := p.client.SearchDataSources(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +func newServiceMetadataMiddleware_opSearchDataSources(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + SigningName: "quicksight", + OperationName: "SearchDataSources", + } +} diff --git a/service/quicksight/api_op_UpdateAccountSettings.go b/service/quicksight/api_op_UpdateAccountSettings.go index a2357e55663..8acf69d9aeb 100644 --- a/service/quicksight/api_op_UpdateAccountSettings.go +++ b/service/quicksight/api_op_UpdateAccountSettings.go @@ -46,6 +46,12 @@ type UpdateAccountSettingsInput struct { // regarding your Amazon Web Services account or Amazon QuickSight subscription. NotificationEmail *string + // A boolean value that determines whether or not an Amazon QuickSight account can + // be deleted. A True value doesn't allow the account to be deleted and results in + // an error message if a user tries to make a DeleteAccountSubscription request. A + // False value will allow the account to be deleted. + TerminationProtectionEnabled bool + noSmithyDocumentSerde } diff --git a/service/quicksight/deserializers.go b/service/quicksight/deserializers.go index 69b862d6bfe..0be0c0b5d6f 100644 --- a/service/quicksight/deserializers.go +++ b/service/quicksight/deserializers.go @@ -3955,6 +3955,189 @@ func awsRestjson1_deserializeOpDocumentDeleteAccountCustomizationOutput(v **Dele return nil } +type awsRestjson1_deserializeOpDeleteAccountSubscription struct { +} + +func (*awsRestjson1_deserializeOpDeleteAccountSubscription) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteAccountSubscription) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorDeleteAccountSubscription(response, &metadata) + } + output := &DeleteAccountSubscriptionOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsDeleteAccountSubscriptionOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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_deserializeOpDocumentDeleteAccountSubscriptionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteAccountSubscription(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("PreconditionNotMetException", errorCode): + return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsDeleteAccountSubscriptionOutput(v *DeleteAccountSubscriptionOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + v.Status = int32(response.StatusCode) + + return nil +} +func awsRestjson1_deserializeOpDocumentDeleteAccountSubscriptionOutput(v **DeleteAccountSubscriptionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *DeleteAccountSubscriptionOutput + if *v == nil { + sv = &DeleteAccountSubscriptionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDeleteAnalysis struct { } @@ -12408,6 +12591,15 @@ func awsRestjson1_deserializeOpDocumentGenerateEmbedUrlForAnonymousUserOutput(v for key, value := range shape { switch key { + case "AnonymousUserArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.AnonymousUserArn = ptr.String(jtv) + } + case "EmbedUrl": if value != nil { jtv, ok := value.(string) @@ -18110,14 +18302,14 @@ func awsRestjson1_deserializeOpDocumentSearchDashboardsOutput(v **SearchDashboar return nil } -type awsRestjson1_deserializeOpSearchFolders struct { +type awsRestjson1_deserializeOpSearchDataSets struct { } -func (*awsRestjson1_deserializeOpSearchFolders) ID() string { +func (*awsRestjson1_deserializeOpSearchDataSets) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchFolders) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchDataSets) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -18131,12 +18323,12 @@ func (m *awsRestjson1_deserializeOpSearchFolders) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchFolders(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchDataSets(response, &metadata) } - output := &SearchFoldersOutput{} + output := &SearchDataSetsOutput{} out.Result = output - err = awsRestjson1_deserializeOpHttpBindingsSearchFoldersOutput(output, response) + err = awsRestjson1_deserializeOpHttpBindingsSearchDataSetsOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -18159,7 +18351,7 @@ func (m *awsRestjson1_deserializeOpSearchFolders) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchFoldersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchDataSetsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -18172,7 +18364,7 @@ func (m *awsRestjson1_deserializeOpSearchFolders) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchFolders(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchDataSets(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -18231,9 +18423,6 @@ func awsRestjson1_deserializeOpErrorSearchFolders(response *smithyhttp.Response, case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnsupportedUserEditionException", errorCode): - return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -18244,7 +18433,7 @@ func awsRestjson1_deserializeOpErrorSearchFolders(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpHttpBindingsSearchFoldersOutput(v *SearchFoldersOutput, response *smithyhttp.Response) error { +func awsRestjson1_deserializeOpHttpBindingsSearchDataSetsOutput(v *SearchDataSetsOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -18253,7 +18442,7 @@ func awsRestjson1_deserializeOpHttpBindingsSearchFoldersOutput(v *SearchFoldersO return nil } -func awsRestjson1_deserializeOpDocumentSearchFoldersOutput(v **SearchFoldersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchDataSetsOutput(v **SearchDataSetsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -18266,17 +18455,17 @@ func awsRestjson1_deserializeOpDocumentSearchFoldersOutput(v **SearchFoldersOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchFoldersOutput + var sv *SearchDataSetsOutput if *v == nil { - sv = &SearchFoldersOutput{} + sv = &SearchDataSetsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "FolderSummaryList": - if err := awsRestjson1_deserializeDocumentFolderSummaryList(&sv.FolderSummaryList, value); err != nil { + case "DataSetSummaries": + if err := awsRestjson1_deserializeDocumentDataSetSummaryList(&sv.DataSetSummaries, value); err != nil { return err } @@ -18307,14 +18496,14 @@ func awsRestjson1_deserializeOpDocumentSearchFoldersOutput(v **SearchFoldersOutp return nil } -type awsRestjson1_deserializeOpSearchGroups struct { +type awsRestjson1_deserializeOpSearchDataSources struct { } -func (*awsRestjson1_deserializeOpSearchGroups) ID() string { +func (*awsRestjson1_deserializeOpSearchDataSources) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchDataSources) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -18328,12 +18517,12 @@ func (m *awsRestjson1_deserializeOpSearchGroups) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchGroups(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchDataSources(response, &metadata) } - output := &SearchGroupsOutput{} + output := &SearchDataSourcesOutput{} out.Result = output - err = awsRestjson1_deserializeOpHttpBindingsSearchGroupsOutput(output, response) + err = awsRestjson1_deserializeOpHttpBindingsSearchDataSourcesOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -18356,7 +18545,7 @@ func (m *awsRestjson1_deserializeOpSearchGroups) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchGroupsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchDataSourcesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -18369,7 +18558,7 @@ func (m *awsRestjson1_deserializeOpSearchGroups) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchDataSources(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -18422,15 +18611,9 @@ func awsRestjson1_deserializeOpErrorSearchGroups(response *smithyhttp.Response, case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) - case strings.EqualFold("PreconditionNotMetException", errorCode): - return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ResourceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -18444,7 +18627,7 @@ func awsRestjson1_deserializeOpErrorSearchGroups(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpHttpBindingsSearchGroupsOutput(v *SearchGroupsOutput, response *smithyhttp.Response) error { +func awsRestjson1_deserializeOpHttpBindingsSearchDataSourcesOutput(v *SearchDataSourcesOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -18453,7 +18636,7 @@ func awsRestjson1_deserializeOpHttpBindingsSearchGroupsOutput(v *SearchGroupsOut return nil } -func awsRestjson1_deserializeOpDocumentSearchGroupsOutput(v **SearchGroupsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchDataSourcesOutput(v **SearchDataSourcesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -18466,17 +18649,17 @@ func awsRestjson1_deserializeOpDocumentSearchGroupsOutput(v **SearchGroupsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchGroupsOutput + var sv *SearchDataSourcesOutput if *v == nil { - sv = &SearchGroupsOutput{} + sv = &SearchDataSourcesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "GroupList": - if err := awsRestjson1_deserializeDocumentGroupList(&sv.GroupList, value); err != nil { + case "DataSourceSummaries": + if err := awsRestjson1_deserializeDocumentDataSourceSummaryList(&sv.DataSourceSummaries, value); err != nil { return err } @@ -18507,14 +18690,14 @@ func awsRestjson1_deserializeOpDocumentSearchGroupsOutput(v **SearchGroupsOutput return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpSearchFolders struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpSearchFolders) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchFolders) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -18528,12 +18711,12 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchFolders(response, &metadata) } - output := &TagResourceOutput{} + output := &SearchFoldersOutput{} out.Result = output - err = awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(output, response) + err = awsRestjson1_deserializeOpHttpBindingsSearchFoldersOutput(output, response) if err != nil { return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } @@ -18556,7 +18739,7 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentTagResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchFoldersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -18569,7 +18752,7 @@ func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchFolders(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -18616,11 +18799,14 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) + case strings.EqualFold("InvalidParameterValueException", errorCode): return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -18628,6 +18814,9 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnsupportedUserEditionException", errorCode): + return awsRestjson1_deserializeErrorUnsupportedUserEditionException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -18638,7 +18827,7 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(v *TagResourceOutput, response *smithyhttp.Response) error { +func awsRestjson1_deserializeOpHttpBindingsSearchFoldersOutput(v *SearchFoldersOutput, response *smithyhttp.Response) error { if v == nil { return fmt.Errorf("unsupported deserialization for nil %T", v) } @@ -18647,7 +18836,7 @@ func awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(v *TagResourceOutpu return nil } -func awsRestjson1_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchFoldersOutput(v **SearchFoldersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -18660,16 +18849,410 @@ func awsRestjson1_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *TagResourceOutput + var sv *SearchFoldersOutput if *v == nil { - sv = &TagResourceOutput{} + sv = &SearchFoldersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "RequestId": + case "FolderSummaryList": + if err := awsRestjson1_deserializeDocumentFolderSummaryList(&sv.FolderSummaryList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSearchGroups struct { +} + +func (*awsRestjson1_deserializeOpSearchGroups) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSearchGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorSearchGroups(response, &metadata) + } + output := &SearchGroupsOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsSearchGroupsOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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_deserializeOpDocumentSearchGroupsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSearchGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsRestjson1_deserializeErrorInvalidNextTokenException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("PreconditionNotMetException", errorCode): + return awsRestjson1_deserializeErrorPreconditionNotMetException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ResourceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorResourceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsSearchGroupsOutput(v *SearchGroupsOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + v.Status = int32(response.StatusCode) + + return nil +} +func awsRestjson1_deserializeOpDocumentSearchGroupsOutput(v **SearchGroupsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *SearchGroupsOutput + if *v == nil { + sv = &SearchGroupsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "GroupList": + if err := awsRestjson1_deserializeDocumentGroupList(&sv.GroupList, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + err = awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(output, response) + if err != nil { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} + } + + 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_deserializeOpDocumentTagResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + code := response.Header.Get("X-Amzn-ErrorType") + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + code, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(code) != 0 { + errorCode = restjson.SanitizeErrorCode(code) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidParameterValueException", errorCode): + return awsRestjson1_deserializeErrorInvalidParameterValueException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpHttpBindingsTagResourceOutput(v *TagResourceOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + v.Status = int32(response.StatusCode) + + return nil +} +func awsRestjson1_deserializeOpDocumentTagResourceOutput(v **TagResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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 *TagResourceOutput + if *v == nil { + sv = &TagResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RequestId": if value != nil { jtv, ok := value.(string) if !ok { @@ -23935,8 +24518,44 @@ func awsRestjson1_deserializeErrorInternalFailureException(response *smithyhttp. return output } -func awsRestjson1_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidNextTokenException{} +func awsRestjson1_deserializeErrorInvalidNextTokenException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidNextTokenException{} + 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_deserializeDocumentInvalidNextTokenException(&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_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidParameterValueException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -23954,7 +24573,7 @@ func awsRestjson1_deserializeErrorInvalidNextTokenException(response *smithyhttp return err } - err := awsRestjson1_deserializeDocumentInvalidNextTokenException(&output, shape) + err := awsRestjson1_deserializeDocumentInvalidParameterValueException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -23971,8 +24590,8 @@ func awsRestjson1_deserializeErrorInvalidNextTokenException(response *smithyhttp return output } -func awsRestjson1_deserializeErrorInvalidParameterValueException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.InvalidParameterValueException{} +func awsRestjson1_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequestException{} var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -23990,7 +24609,7 @@ func awsRestjson1_deserializeErrorInvalidParameterValueException(response *smith return err } - err := awsRestjson1_deserializeDocumentInvalidParameterValueException(&output, shape) + err := awsRestjson1_deserializeDocumentInvalidRequestException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -24608,6 +25227,15 @@ func awsRestjson1_deserializeDocumentAccountSettings(v **types.AccountSettings, sv.PublicSharingEnabled = jtv } + case "TerminationProtectionEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.TerminationProtectionEnabled = jtv + } + default: _, _ = key, value @@ -25177,6 +25805,15 @@ func awsRestjson1_deserializeDocumentAthenaParameters(v **types.AthenaParameters for key, value := range shape { switch key { + case "RoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + case "WorkGroup": if value != nil { jtv, ok := value.(string) @@ -26996,6 +27633,68 @@ func awsRestjson1_deserializeDocumentDashboardVersionSummaryList(v *[]types.Dash return nil } +func awsRestjson1_deserializeDocumentDatabricksParameters(v **types.DatabricksParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.DatabricksParameters + if *v == nil { + sv = &types.DatabricksParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Host": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Host to be of type string, got %T instead", value) + } + sv.Host = ptr.String(jtv) + } + + case "Port": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Port to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Port = int32(i64) + } + + case "SqlEndpointPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SqlEndpointPath to be of type string, got %T instead", value) + } + sv.SqlEndpointPath = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDataColorPalette(v **types.DataColorPalette, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -27869,6 +28568,16 @@ loop: uv = &types.DataSourceParametersMemberAwsIotAnalyticsParameters{Value: mv} break loop + case "DatabricksParameters": + var mv types.DatabricksParameters + destAddr := &mv + if err := awsRestjson1_deserializeDocumentDatabricksParameters(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.DataSourceParametersMemberDatabricksParameters{Value: mv} + break loop + case "ExasolParameters": var mv types.ExasolParameters destAddr := &mv @@ -28071,6 +28780,139 @@ func awsRestjson1_deserializeDocumentDataSourceParametersList(v *[]types.DataSou return nil } +func awsRestjson1_deserializeDocumentDataSourceSummary(v **types.DataSourceSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.DataSourceSummary + if *v == nil { + sv = &types.DataSourceSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "CreatedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "DataSourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.DataSourceId = ptr.String(jtv) + } + + case "LastUpdatedTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataSourceType to be of type string, got %T instead", value) + } + sv.Type = types.DataSourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDataSourceSummaryList(v *[]types.DataSourceSummary, 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.DataSourceSummary + if *v == nil { + cv = []types.DataSourceSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DataSourceSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentDataSourceSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentDomainNotWhitelistedException(v **types.DomainNotWhitelistedException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -29656,6 +30498,55 @@ func awsRestjson1_deserializeDocumentInvalidParameterValueException(v **types.In 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": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "RequestId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.RequestId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentIpRestrictionRuleMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/quicksight/generated.json b/service/quicksight/generated.json index ab4f262685e..082ecfc7389 100644 --- a/service/quicksight/generated.json +++ b/service/quicksight/generated.json @@ -27,6 +27,7 @@ "api_op_CreateTheme.go", "api_op_CreateThemeAlias.go", "api_op_DeleteAccountCustomization.go", + "api_op_DeleteAccountSubscription.go", "api_op_DeleteAnalysis.go", "api_op_DeleteDashboard.go", "api_op_DeleteDataSet.go", @@ -100,6 +101,8 @@ "api_op_RestoreAnalysis.go", "api_op_SearchAnalyses.go", "api_op_SearchDashboards.go", + "api_op_SearchDataSets.go", + "api_op_SearchDataSources.go", "api_op_SearchFolders.go", "api_op_SearchGroups.go", "api_op_TagResource.go", diff --git a/service/quicksight/serializers.go b/service/quicksight/serializers.go index 0fc00fd9273..2e544e4db89 100644 --- a/service/quicksight/serializers.go +++ b/service/quicksight/serializers.go @@ -2066,6 +2066,64 @@ func awsRestjson1_serializeOpHttpBindingsDeleteAccountCustomizationInput(v *Dele return nil } +type awsRestjson1_serializeOpDeleteAccountSubscription struct { +} + +func (*awsRestjson1_serializeOpDeleteAccountSubscription) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteAccountSubscription) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteAccountSubscriptionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/account/{AwsAccountId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteAccountSubscriptionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteAccountSubscriptionInput(v *DeleteAccountSubscriptionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AwsAccountId == nil || len(*v.AwsAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AwsAccountId must not be empty")} + } + if v.AwsAccountId != nil { + if err := encoder.SetURI("AwsAccountId").String(*v.AwsAccountId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpDeleteAnalysis struct { } @@ -7513,6 +7571,192 @@ func awsRestjson1_serializeOpDocumentSearchDashboardsInput(v *SearchDashboardsIn return nil } +type awsRestjson1_serializeOpSearchDataSets struct { +} + +func (*awsRestjson1_serializeOpSearchDataSets) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchDataSets) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchDataSetsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accounts/{AwsAccountId}/search/data-sets") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchDataSetsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchDataSetsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchDataSetsInput(v *SearchDataSetsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AwsAccountId == nil || len(*v.AwsAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AwsAccountId must not be empty")} + } + if v.AwsAccountId != nil { + if err := encoder.SetURI("AwsAccountId").String(*v.AwsAccountId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchDataSetsInput(v *SearchDataSetsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentDataSetSearchFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + +type awsRestjson1_serializeOpSearchDataSources struct { +} + +func (*awsRestjson1_serializeOpSearchDataSources) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSearchDataSources) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SearchDataSourcesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/accounts/{AwsAccountId}/search/data-sources") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + restEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSearchDataSourcesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentSearchDataSourcesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSearchDataSourcesInput(v *SearchDataSourcesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AwsAccountId == nil || len(*v.AwsAccountId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member AwsAccountId must not be empty")} + } + if v.AwsAccountId != nil { + if err := encoder.SetURI("AwsAccountId").String(*v.AwsAccountId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentSearchDataSourcesInput(v *SearchDataSourcesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentDataSourceSearchFilterList(v.Filters, ok); err != nil { + return err + } + } + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpSearchFolders struct { } @@ -8023,6 +8267,11 @@ func awsRestjson1_serializeOpDocumentUpdateAccountSettingsInput(v *UpdateAccount ok.String(*v.NotificationEmail) } + if v.TerminationProtectionEnabled { + ok := object.Key("TerminationProtectionEnabled") + ok.Boolean(v.TerminationProtectionEnabled) + } + return nil } @@ -10489,6 +10738,25 @@ func awsRestjson1_serializeDocumentAnonymousUserEmbeddingExperienceConfiguration } } + if v.QSearchBar != nil { + ok := object.Key("QSearchBar") + if err := awsRestjson1_serializeDocumentAnonymousUserQSearchBarEmbeddingConfiguration(v.QSearchBar, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentAnonymousUserQSearchBarEmbeddingConfiguration(v *types.AnonymousUserQSearchBarEmbeddingConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InitialTopicId != nil { + ok := object.Key("InitialTopicId") + ok.String(*v.InitialTopicId) + } + return nil } @@ -10507,6 +10775,11 @@ func awsRestjson1_serializeDocumentAthenaParameters(v *types.AthenaParameters, v object := value.Object() defer object.Close() + if v.RoleArn != nil { + ok := object.Key("RoleArn") + ok.String(*v.RoleArn) + } + if v.WorkGroup != nil { ok := object.Key("WorkGroup") ok.String(*v.WorkGroup) @@ -10974,6 +11247,28 @@ func awsRestjson1_serializeDocumentDashboardVisualId(v *types.DashboardVisualId, return nil } +func awsRestjson1_serializeDocumentDatabricksParameters(v *types.DatabricksParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Host != nil { + ok := object.Key("Host") + ok.String(*v.Host) + } + + { + ok := object.Key("Port") + ok.Integer(v.Port) + } + + if v.SqlEndpointPath != nil { + ok := object.Key("SqlEndpointPath") + ok.String(*v.SqlEndpointPath) + } + + return nil +} + func awsRestjson1_serializeDocumentDataColorPalette(v *types.DataColorPalette, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11030,6 +11325,41 @@ func awsRestjson1_serializeDocumentDataSetReferenceList(v []types.DataSetReferen return nil } +func awsRestjson1_serializeDocumentDataSetSearchFilter(v *types.DataSetSearchFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Name) > 0 { + ok := object.Key("Name") + ok.String(string(v.Name)) + } + + if len(v.Operator) > 0 { + ok := object.Key("Operator") + ok.String(string(v.Operator)) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentDataSetSearchFilterList(v []types.DataSetSearchFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDataSetSearchFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentDataSetUsageConfiguration(v *types.DataSetUsageConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -11112,6 +11442,12 @@ func awsRestjson1_serializeDocumentDataSourceParameters(v types.DataSourceParame return err } + case *types.DataSourceParametersMemberDatabricksParameters: + av := object.Key("DatabricksParameters") + if err := awsRestjson1_serializeDocumentDatabricksParameters(&uv.Value, av); err != nil { + return err + } + case *types.DataSourceParametersMemberExasolParameters: av := object.Key("ExasolParameters") if err := awsRestjson1_serializeDocumentExasolParameters(&uv.Value, av); err != nil { @@ -11231,6 +11567,41 @@ func awsRestjson1_serializeDocumentDataSourceParametersList(v []types.DataSource return nil } +func awsRestjson1_serializeDocumentDataSourceSearchFilter(v *types.DataSourceSearchFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Name) > 0 { + ok := object.Key("Name") + ok.String(string(v.Name)) + } + + if len(v.Operator) > 0 { + ok := object.Key("Operator") + ok.String(string(v.Operator)) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsRestjson1_serializeDocumentDataSourceSearchFilterList(v []types.DataSourceSearchFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentDataSourceSearchFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentDateTimeParameter(v *types.DateTimeParameter, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/quicksight/types/enums.go b/service/quicksight/types/enums.go index d933215e5da..4858f8bc2df 100644 --- a/service/quicksight/types/enums.go +++ b/service/quicksight/types/enums.go @@ -40,7 +40,13 @@ type AnalysisFilterAttribute string // Enum values for AnalysisFilterAttribute const ( - AnalysisFilterAttributeQuicksightUser AnalysisFilterAttribute = "QUICKSIGHT_USER" + AnalysisFilterAttributeQuicksightUser AnalysisFilterAttribute = "QUICKSIGHT_USER" + AnalysisFilterAttributeQuicksightViewerOrOwner AnalysisFilterAttribute = "QUICKSIGHT_VIEWER_OR_OWNER" + AnalysisFilterAttributeDirectQuicksightViewerOrOwner AnalysisFilterAttribute = "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER" + AnalysisFilterAttributeQuicksightOwner AnalysisFilterAttribute = "QUICKSIGHT_OWNER" + AnalysisFilterAttributeDirectQuicksightOwner AnalysisFilterAttribute = "DIRECT_QUICKSIGHT_OWNER" + AnalysisFilterAttributeDirectQuicksightSoleOwner AnalysisFilterAttribute = "DIRECT_QUICKSIGHT_SOLE_OWNER" + AnalysisFilterAttributeAnalysisName AnalysisFilterAttribute = "ANALYSIS_NAME" ) // Values returns all known values for AnalysisFilterAttribute. Note that this can @@ -49,6 +55,12 @@ const ( func (AnalysisFilterAttribute) Values() []AnalysisFilterAttribute { return []AnalysisFilterAttribute{ "QUICKSIGHT_USER", + "QUICKSIGHT_VIEWER_OR_OWNER", + "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER", + "QUICKSIGHT_OWNER", + "DIRECT_QUICKSIGHT_OWNER", + "DIRECT_QUICKSIGHT_SOLE_OWNER", + "ANALYSIS_NAME", } } @@ -188,7 +200,13 @@ type DashboardFilterAttribute string // Enum values for DashboardFilterAttribute const ( - DashboardFilterAttributeQuicksightUser DashboardFilterAttribute = "QUICKSIGHT_USER" + DashboardFilterAttributeQuicksightUser DashboardFilterAttribute = "QUICKSIGHT_USER" + DashboardFilterAttributeQuicksightViewerOrOwner DashboardFilterAttribute = "QUICKSIGHT_VIEWER_OR_OWNER" + DashboardFilterAttributeDirectQuicksightViewerOrOwner DashboardFilterAttribute = "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER" + DashboardFilterAttributeQuicksightOwner DashboardFilterAttribute = "QUICKSIGHT_OWNER" + DashboardFilterAttributeDirectQuicksightOwner DashboardFilterAttribute = "DIRECT_QUICKSIGHT_OWNER" + DashboardFilterAttributeDirectQuicksightSoleOwner DashboardFilterAttribute = "DIRECT_QUICKSIGHT_SOLE_OWNER" + DashboardFilterAttributeDashboardName DashboardFilterAttribute = "DASHBOARD_NAME" ) // Values returns all known values for DashboardFilterAttribute. Note that this can @@ -197,6 +215,12 @@ const ( func (DashboardFilterAttribute) Values() []DashboardFilterAttribute { return []DashboardFilterAttribute{ "QUICKSIGHT_USER", + "QUICKSIGHT_VIEWER_OR_OWNER", + "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER", + "QUICKSIGHT_OWNER", + "DIRECT_QUICKSIGHT_OWNER", + "DIRECT_QUICKSIGHT_SOLE_OWNER", + "DASHBOARD_NAME", } } @@ -218,6 +242,32 @@ func (DashboardUIState) Values() []DashboardUIState { } } +type DataSetFilterAttribute string + +// Enum values for DataSetFilterAttribute +const ( + DataSetFilterAttributeQuicksightViewerOrOwner DataSetFilterAttribute = "QUICKSIGHT_VIEWER_OR_OWNER" + DataSetFilterAttributeQuicksightOwner DataSetFilterAttribute = "QUICKSIGHT_OWNER" + DataSetFilterAttributeDirectQuicksightViewerOrOwner DataSetFilterAttribute = "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER" + DataSetFilterAttributeDirectQuicksightOwner DataSetFilterAttribute = "DIRECT_QUICKSIGHT_OWNER" + DataSetFilterAttributeDirectQuicksightSoleOwner DataSetFilterAttribute = "DIRECT_QUICKSIGHT_SOLE_OWNER" + DataSetFilterAttributeDatasetName DataSetFilterAttribute = "DATASET_NAME" +) + +// Values returns all known values for DataSetFilterAttribute. Note that this can +// be expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (DataSetFilterAttribute) Values() []DataSetFilterAttribute { + return []DataSetFilterAttribute{ + "QUICKSIGHT_VIEWER_OR_OWNER", + "QUICKSIGHT_OWNER", + "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER", + "DIRECT_QUICKSIGHT_OWNER", + "DIRECT_QUICKSIGHT_SOLE_OWNER", + "DATASET_NAME", + } +} + type DataSetImportMode string // Enum values for DataSetImportMode @@ -266,6 +316,28 @@ func (DataSourceErrorInfoType) Values() []DataSourceErrorInfoType { } } +type DataSourceFilterAttribute string + +// Enum values for DataSourceFilterAttribute +const ( + DataSourceFilterAttributeDirectQuicksightViewerOrOwner DataSourceFilterAttribute = "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER" + DataSourceFilterAttributeDirectQuicksightOwner DataSourceFilterAttribute = "DIRECT_QUICKSIGHT_OWNER" + DataSourceFilterAttributeDirectQuicksightSoleOwner DataSourceFilterAttribute = "DIRECT_QUICKSIGHT_SOLE_OWNER" + DataSourceFilterAttributeDatasourceName DataSourceFilterAttribute = "DATASOURCE_NAME" +) + +// Values returns all known values for DataSourceFilterAttribute. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// The ordering of this slice is not guaranteed to be stable across updates. +func (DataSourceFilterAttribute) Values() []DataSourceFilterAttribute { + return []DataSourceFilterAttribute{ + "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER", + "DIRECT_QUICKSIGHT_OWNER", + "DIRECT_QUICKSIGHT_SOLE_OWNER", + "DATASOURCE_NAME", + } +} + type DataSourceType string // Enum values for DataSourceType @@ -295,6 +367,7 @@ const ( DataSourceTypeTimestream DataSourceType = "TIMESTREAM" DataSourceTypeAmazonOpensearch DataSourceType = "AMAZON_OPENSEARCH" DataSourceTypeExasol DataSourceType = "EXASOL" + DataSourceTypeDatabricks DataSourceType = "DATABRICKS" ) // Values returns all known values for DataSourceType. Note that this can be @@ -327,6 +400,7 @@ func (DataSourceType) Values() []DataSourceType { "TIMESTREAM", "AMAZON_OPENSEARCH", "EXASOL", + "DATABRICKS", } } @@ -433,6 +507,7 @@ type FilterOperator string // Enum values for FilterOperator const ( FilterOperatorStringEquals FilterOperator = "StringEquals" + FilterOperatorStringLike FilterOperator = "StringLike" ) // Values returns all known values for FilterOperator. Note that this can be @@ -441,6 +516,7 @@ const ( func (FilterOperator) Values() []FilterOperator { return []FilterOperator{ "StringEquals", + "StringLike", } } @@ -448,7 +524,13 @@ type FolderFilterAttribute string // Enum values for FolderFilterAttribute const ( - FolderFilterAttributeParentFolderArn FolderFilterAttribute = "PARENT_FOLDER_ARN" + FolderFilterAttributeParentFolderArn FolderFilterAttribute = "PARENT_FOLDER_ARN" + FolderFilterAttributeDirectQuicksightOwner FolderFilterAttribute = "DIRECT_QUICKSIGHT_OWNER" + FolderFilterAttributeDirectQuicksightSoleOwner FolderFilterAttribute = "DIRECT_QUICKSIGHT_SOLE_OWNER" + FolderFilterAttributeDirectQuicksightViewerOrOwner FolderFilterAttribute = "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER" + FolderFilterAttributeQuicksightOwner FolderFilterAttribute = "QUICKSIGHT_OWNER" + FolderFilterAttributeQuicksightViewerOrOwner FolderFilterAttribute = "QUICKSIGHT_VIEWER_OR_OWNER" + FolderFilterAttributeFolderName FolderFilterAttribute = "FOLDER_NAME" ) // Values returns all known values for FolderFilterAttribute. Note that this can be @@ -457,6 +539,12 @@ const ( func (FolderFilterAttribute) Values() []FolderFilterAttribute { return []FolderFilterAttribute{ "PARENT_FOLDER_ARN", + "DIRECT_QUICKSIGHT_OWNER", + "DIRECT_QUICKSIGHT_SOLE_OWNER", + "DIRECT_QUICKSIGHT_VIEWER_OR_OWNER", + "QUICKSIGHT_OWNER", + "QUICKSIGHT_VIEWER_OR_OWNER", + "FOLDER_NAME", } } diff --git a/service/quicksight/types/errors.go b/service/quicksight/types/errors.go index 52b732ed563..98c41b0113f 100644 --- a/service/quicksight/types/errors.go +++ b/service/quicksight/types/errors.go @@ -184,6 +184,28 @@ func (e *InvalidParameterValueException) ErrorMessage() string { func (e *InvalidParameterValueException) ErrorCode() string { return "InvalidParameterValueException" } func (e *InvalidParameterValueException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// You don't have this feature activated for your account. To fix this issue, +// contact Amazon Web Services support. +type InvalidRequestException struct { + Message *string + + RequestId *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 { return "InvalidRequestException" } +func (e *InvalidRequestException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // A limit is exceeded. type LimitExceededException struct { Message *string diff --git a/service/quicksight/types/types.go b/service/quicksight/types/types.go index 5b605c7c7a1..c96742b2f8d 100644 --- a/service/quicksight/types/types.go +++ b/service/quicksight/types/types.go @@ -84,6 +84,12 @@ type AccountSettings struct { // (https://docs.aws.amazon.com/quicksight/latest/APIReference/API_UpdatePublicSharingSettings.html). PublicSharingEnabled bool + // A boolean value that determines whether or not an Amazon QuickSight account can + // be deleted. A True value doesn't allow the account to be deleted and results in + // an error message if a user tries to make a DeleteAccountSubsctiption request. A + // False value will allow the ccount to be deleted. + TerminationProtectionEnabled bool + noSmithyDocumentSerde } @@ -183,11 +189,47 @@ type AnalysisError struct { type AnalysisSearchFilter struct { // The name of the value that you want to use as a filter, for example "Name": - // "QUICKSIGHT_USER". + // "QUICKSIGHT_OWNER". Valid values are defined as follows: + // + // * + // QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any analyses + // with that ARN listed as one of the analysis' owners or viewers are returned. + // Implicit permissions from folders or groups are considered. + // + // * QUICKSIGHT_OWNER: + // Provide an ARN of a user or group, and any analyses with that ARN listed as one + // of the owners of the analyses are returned. Implicit permissions from folders or + // groups are considered. + // + // * DIRECT_QUICKSIGHT_SOLE_OWNER: Provide an ARN of a user + // or group, and any analyses with that ARN listed as the only owner of the + // analysis are returned. Implicit permissions from folders or groups are not + // considered. + // + // * DIRECT_QUICKSIGHT_OWNER: Provide an ARN of a user or group, and + // any analyses with that ARN listed as one of the owners of the analyses are + // returned. Implicit permissions from folders or groups are not considered. + // + // * + // DIRECT_QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any + // analyses with that ARN listed as one of the owners or viewers of the analyses + // are returned. Implicit permissions from folders or groups are not considered. + // + // * + // ANALYSIS_NAME: Any analyses whose names have a substring match to this value + // will be returned. Name AnalysisFilterAttribute // The comparison operator that you want to use as a filter, for example - // "Operator": "StringEquals". + // "Operator": "StringEquals". Valid values are "StringEquals" and "StringLike". If + // you set the operator value to "StringEquals", you need to provide an ownership + // related filter in the "NAME" field and the arn of the user or group whose + // folders you want to search in the "Value" field. For example, + // "Name":"DIRECT_QUICKSIGHT_OWNER", "Operator": "StringEquals", "Value": + // "arn:aws:quicksight:us-east-1:1:user/default/UserName1". If you set the value to + // "StringLike", you need to provide the name of the folders you are searching for. + // For example, "Name":"ANALYSIS_NAME", "Operator": "StringLike", "Value": "Test". + // The "StringLike" operator only supports the NAME value ANALYSIS_NAME. Operator FilterOperator // The value of the named item, in this case QUICKSIGHT_USER, that you want to use @@ -289,12 +331,39 @@ type AnonymousUserEmbeddingExperienceConfiguration struct { // The type of embedding experience. In this case, Amazon QuickSight visuals. DashboardVisual *AnonymousUserDashboardVisualEmbeddingConfiguration + // The Q search bar that you want to use for anonymous user embedding. + QSearchBar *AnonymousUserQSearchBarEmbeddingConfiguration + + noSmithyDocumentSerde +} + +// The settings that you want to use with the Q search bar. +type AnonymousUserQSearchBarEmbeddingConfiguration struct { + + // The QuickSight Q topic ID of the topic that you want the anonymous user to see + // first. This ID is included in the output URL. When the URL in response is + // accessed, Amazon QuickSight renders the Q search bar with this topic + // pre-selected. The Amazon Resource Name (ARN) of this Q topic must be included in + // the AuthorizedResourceArns parameter. Otherwise, the request will fail with + // InvalidParameterValueException. + // + // This member is required. + InitialTopicId *string + noSmithyDocumentSerde } // Parameters for Amazon Athena. type AthenaParameters struct { + // Use the RoleArn structure to override an account-wide role for a specific Athena + // data source. For example, say an account administrator has turned off all Athena + // access with an account-wide role. The administrator can then use RoleArn to + // bypass the account-wide role and allow Athena access for the single Athena data + // source that is specified in the structure, even if the account-wide role + // forbidding Athena access is still active. + RoleArn *string + // The workgroup that Amazon Athena uses. WorkGroup *string @@ -613,14 +682,51 @@ type DashboardPublishOptions struct { // A filter that you apply when searching for dashboards. type DashboardSearchFilter struct { - // The comparison operator that you want to use as a filter, for example, - // "Operator": "StringEquals". + // The comparison operator that you want to use as a filter, for example + // "Operator": "StringEquals". Valid values are "StringEquals" and "StringLike". If + // you set the operator value to "StringEquals", you need to provide an ownership + // related filter in the "NAME" field and the arn of the user or group whose + // folders you want to search in the "Value" field. For example, + // "Name":"DIRECT_QUICKSIGHT_OWNER", "Operator": "StringEquals", "Value": + // "arn:aws:quicksight:us-east-1:1:user/default/UserName1". If you set the value to + // "StringLike", you need to provide the name of the folders you are searching for. + // For example, "Name":"DASHBOARD_NAME", "Operator": "StringLike", "Value": "Test". + // The "StringLike" operator only supports the NAME value DASHBOARD_NAME. // // This member is required. Operator FilterOperator // The name of the value that you want to use as a filter, for example, "Name": - // "QUICKSIGHT_USER". + // "QUICKSIGHT_OWNER". Valid values are defined as follows: + // + // * + // QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any + // dashboards with that ARN listed as one of the dashboards's owners or viewers are + // returned. Implicit permissions from folders or groups are considered. + // + // * + // QUICKSIGHT_OWNER: Provide an ARN of a user or group, and any dashboards with + // that ARN listed as one of the owners of the dashboards are returned. Implicit + // permissions from folders or groups are considered. + // + // * + // DIRECT_QUICKSIGHT_SOLE_OWNER: Provide an ARN of a user or group, and any + // dashboards with that ARN listed as the only owner of the dashboard are returned. + // Implicit permissions from folders or groups are not considered. + // + // * + // DIRECT_QUICKSIGHT_OWNER: Provide an ARN of a user or group, and any dashboards + // with that ARN listed as one of the owners of the dashboards are returned. + // Implicit permissions from folders or groups are not considered. + // + // * + // DIRECT_QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any + // dashboards with that ARN listed as one of the owners or viewers of the + // dashboards are returned. Implicit permissions from folders or groups are not + // considered. + // + // * DASHBOARD_NAME: Any dashboards whose names have a substring match + // to this value will be returned. Name DashboardFilterAttribute // The value of the named item, in this case QUICKSIGHT_USER, that you want to use @@ -787,6 +893,27 @@ type DashboardVisualId struct { noSmithyDocumentSerde } +// The required parameters that are needed to connect to a Databricks data source. +type DatabricksParameters struct { + + // The host name of the Databricks data source. + // + // This member is required. + Host *string + + // The port for the Databricks data source. + // + // This member is required. + Port int32 + + // The HTTP path of the Databricks data source. + // + // This member is required. + SqlEndpointPath *string + + noSmithyDocumentSerde +} + // The theme colors that are used for data colors in charts. The colors description // is a hexadecimal color code that consists of six alphanumerical characters, // prefixed with #, for example #37BFF5. @@ -905,6 +1032,67 @@ type DataSetSchema struct { noSmithyDocumentSerde } +// A filter that you apply when searching for datasets. +type DataSetSearchFilter struct { + + // The name of the value that you want to use as a filter, for example, "Name": + // "QUICKSIGHT_OWNER". Valid values are defined as follows: + // + // * + // QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any datasets + // with that ARN listed as one of the dataset owners or viewers are returned. + // Implicit permissions from folders or groups are considered. + // + // * QUICKSIGHT_OWNER: + // Provide an ARN of a user or group, and any datasets with that ARN listed as one + // of the owners of the dataset are returned. Implicit permissions from folders or + // groups are considered. + // + // * DIRECT_QUICKSIGHT_SOLE_OWNER: Provide an ARN of a user + // or group, and any datasets with that ARN listed as the only owner of the dataset + // are returned. Implicit permissions from folders or groups are not considered. + // + // * + // DIRECT_QUICKSIGHT_OWNER: Provide an ARN of a user or group, and any datasets + // with that ARN listed as one of the owners if the dataset are returned. Implicit + // permissions from folders or groups are not considered. + // + // * + // DIRECT_QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any + // datasets with that ARN listed as one of the owners or viewers of the dataset are + // returned. Implicit permissions from folders or groups are not considered. + // + // * + // DATASET_NAME: Any datasets whose names have a substring match to this value will + // be returned. + // + // This member is required. + Name DataSetFilterAttribute + + // The comparison operator that you want to use as a filter, for example + // "Operator": "StringEquals". Valid values are "StringEquals" and "StringLike". If + // you set the operator value to "StringEquals", you need to provide an ownership + // related filter in the "NAME" field and the arn of the user or group whose + // datasets you want to search in the "Value" field. For example, + // "Name":"QUICKSIGHT_OWNER", "Operator": "StringEquals", "Value": + // "arn:aws:quicksight:us-east- 1:1:user/default/UserName1". If you set the value + // to "StringLike", you need to provide the name of the datasets you are searching + // for. For example, "Name":"DATASET_NAME", "Operator": "StringLike", "Value": + // "Test". The "StringLike" operator only supports the NAME value DATASET_NAME. + // + // This member is required. + Operator FilterOperator + + // The value of the named item, in this case QUICKSIGHT_OWNER, that you want to use + // as a filter, for example, "Value": + // "arn:aws:quicksight:us-east-1:1:user/default/UserName1". + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + // Dataset summary. type DataSetSummary struct { @@ -1059,6 +1247,7 @@ type DataSourceErrorInfo struct { // DataSourceParametersMemberAuroraParameters // DataSourceParametersMemberAuroraPostgreSqlParameters // DataSourceParametersMemberAwsIotAnalyticsParameters +// DataSourceParametersMemberDatabricksParameters // DataSourceParametersMemberExasolParameters // DataSourceParametersMemberJiraParameters // DataSourceParametersMemberMariaDbParameters @@ -1133,6 +1322,15 @@ type DataSourceParametersMemberAwsIotAnalyticsParameters struct { func (*DataSourceParametersMemberAwsIotAnalyticsParameters) isDataSourceParameters() {} +// The required parameters that are needed to connect to a Databricks data source. +type DataSourceParametersMemberDatabricksParameters struct { + Value DatabricksParameters + + noSmithyDocumentSerde +} + +func (*DataSourceParametersMemberDatabricksParameters) isDataSourceParameters() {} + // The parameters for Exasol. type DataSourceParametersMemberExasolParameters struct { Value ExasolParameters @@ -1277,6 +1475,84 @@ type DataSourceParametersMemberTwitterParameters struct { func (*DataSourceParametersMemberTwitterParameters) isDataSourceParameters() {} +// A filter that you apply when searching for data sources. +type DataSourceSearchFilter struct { + + // The name of the value that you want to use as a filter, for example, "Name": + // "DIRECT_QUICKSIGHT_OWNER". Valid values are defined as follows: + // + // * + // DIRECT_QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any + // data sources with that ARN listed as one of the owners or viewers of the data + // sources are returned. Implicit permissions from folders or groups are not + // considered. + // + // * DIRECT_QUICKSIGHT_OWNER: Provide an ARN of a user or group, and + // any data sources with that ARN listed as one of the owners if the data source + // are returned. Implicit permissions from folders or groups are not considered. + // + // * + // DIRECT_QUICKSIGHT_SOLE_OWNER: Provide an ARN of a user or group, and any data + // sources with that ARN listed as the only owner of the data source are returned. + // Implicit permissions from folders or groups are not considered. + // + // * + // DATASOURCE_NAME: Any data sources whose names have a substring match to the + // provided value are returned. + // + // This member is required. + Name DataSourceFilterAttribute + + // The comparison operator that you want to use as a filter, for example + // "Operator": "StringEquals". Valid values are "StringEquals" and "StringLike". If + // you set the operator value to "StringEquals", you need to provide an ownership + // related filter in the "NAME" field and the arn of the user or group whose data + // sources you want to search in the "Value" field. For example, + // "Name":"DIRECT_QUICKSIGHT_OWNER", "Operator": "StringEquals", "Value": + // "arn:aws:quicksight:us-east-1:1:user/default/UserName1". If you set the value to + // "StringLike", you need to provide the name of the data sources you are searching + // for. For example, "Name":"DATASOURCE_NAME", "Operator": "StringLike", "Value": + // "Test". The "StringLike" operator only supports the NAME value DATASOURCE_NAME. + // + // This member is required. + Operator FilterOperator + + // The value of the named item, for example DIRECT_QUICKSIGHT_OWNER, that you want + // to use as a filter, for example, "Value": + // "arn:aws:quicksight:us-east-1:1:user/default/UserName1". + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// A DataSourceSummary object that returns a summary of a data source. +type DataSourceSummary struct { + + // The arn of the datasource. + Arn *string + + // The date and time that the data source was created. This value is expressed in + // MM-DD-YYYY HH:MM:SS format. + CreatedTime *time.Time + + // The unique ID of the data source. + DataSourceId *string + + // The date and time the data source was last updated. This value is expressed in + // MM-DD-YYYY HH:MM:SS format. + LastUpdatedTime *time.Time + + // The name of the data source. + Name *string + + // The type of the data source. + Type DataSourceType + + noSmithyDocumentSerde +} + // A date-time parameter. type DateTimeParameter struct { @@ -1410,15 +1686,56 @@ type FolderMember struct { noSmithyDocumentSerde } -// A filter to use to search a Amazon QuickSight folder. +// A filter to use to search an Amazon QuickSight folder. type FolderSearchFilter struct { // The name of a value that you want to use in the filter. For example, "Name": - // "PARENT_FOLDER_ARN". + // "QUICKSIGHT_OWNER". Valid values are defined as follows: + // + // * + // QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any folders + // with that ARN listed as one of the folder's owners or viewers are returned. + // Implicit permissions from folders or groups are considered. + // + // * QUICKSIGHT_OWNER: + // Provide an ARN of a user or group, and any folders with that ARN listed as one + // of the owners of the folders are returned. Implicit permissions from folders or + // groups are considered. + // + // * DIRECT_QUICKSIGHT_SOLE_OWNER: Provide an ARN of a user + // or group, and any folders with that ARN listed as the only owner of the folder + // are returned. Implicit permissions from folders or groups are not considered. + // + // * + // DIRECT_QUICKSIGHT_OWNER: Provide an ARN of a user or group, and any folders with + // that ARN listed as one of the owners of the folders are returned. Implicit + // permissions from folders or groups are not considered. + // + // * + // DIRECT_QUICKSIGHT_VIEWER_OR_OWNER: Provide an ARN of a user or group, and any + // folders with that ARN listed as one of the owners or viewers of the folders are + // returned. Implicit permissions from folders or groups are not considered. + // + // * + // FOLDER_NAME: Any folders whose names have a substring match to this value will + // be returned. + // + // * PARENT_FOLDER_ARN: Provide an ARN of a folder, and any folders + // that are directly under that parent folder are returned. If you choose to use + // this option and leave the value blank, all root-level folders in the account are + // returned. Name FolderFilterAttribute - // The comparison operator that you want to use in the filter. For example, - // "Operator": "StringEquals". + // The comparison operator that you want to use as a filter, for example + // "Operator": "StringEquals". Valid values are "StringEquals" and "StringLike". If + // you set the operator value to "StringEquals", you need to provide an ownership + // related filter in the "NAME" field and the arn of the user or group whose + // folders you want to search in the "Value" field. For example, + // "Name":"DIRECT_QUICKSIGHT_OWNER", "Operator": "StringEquals", "Value": + // "arn:aws:quicksight:us-east-1:1:user/default/UserName1". If you set the value to + // "StringLike", you need to provide the name of the folders you are searching for. + // For example, "Name":"FOLDER_NAME", "Operator": "StringLike", "Value": "Test". + // The "StringLike" operator only supports the NAME value FOLDER_NAME. Operator FilterOperator // The value of the named item (in this example, PARENT_FOLDER_ARN), that you want diff --git a/service/quicksight/types/types_exported_test.go b/service/quicksight/types/types_exported_test.go index 8df31e146c1..2ca6e2bccd5 100644 --- a/service/quicksight/types/types_exported_test.go +++ b/service/quicksight/types/types_exported_test.go @@ -29,6 +29,9 @@ func ExampleDataSourceParameters_outputUsage() { case *types.DataSourceParametersMemberAwsIotAnalyticsParameters: _ = v.Value // Value is types.AwsIotAnalyticsParameters + case *types.DataSourceParametersMemberDatabricksParameters: + _ = v.Value // Value is types.DatabricksParameters + case *types.DataSourceParametersMemberExasolParameters: _ = v.Value // Value is types.ExasolParameters @@ -91,6 +94,7 @@ var _ *types.MariaDbParameters var _ *types.RdsParameters var _ *types.AmazonOpenSearchParameters var _ *types.RedshiftParameters +var _ *types.DatabricksParameters var _ *types.OracleParameters var _ *types.JiraParameters var _ *types.TeradataParameters diff --git a/service/quicksight/validators.go b/service/quicksight/validators.go index 1b54d3142ca..ff287cb2b60 100644 --- a/service/quicksight/validators.go +++ b/service/quicksight/validators.go @@ -390,6 +390,26 @@ func (m *validateOpDeleteAccountCustomization) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDeleteAccountSubscription struct { +} + +func (*validateOpDeleteAccountSubscription) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteAccountSubscription) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteAccountSubscriptionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteAccountSubscriptionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteAnalysis struct { } @@ -1850,6 +1870,46 @@ func (m *validateOpSearchDashboards) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpSearchDataSets struct { +} + +func (*validateOpSearchDataSets) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchDataSets) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchDataSetsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchDataSetsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSearchDataSources struct { +} + +func (*validateOpSearchDataSources) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSearchDataSources) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SearchDataSourcesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSearchDataSourcesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpSearchFolders struct { } @@ -2486,6 +2546,10 @@ func addOpDeleteAccountCustomizationValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDeleteAccountCustomization{}, middleware.After) } +func addOpDeleteAccountSubscriptionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteAccountSubscription{}, middleware.After) +} + func addOpDeleteAnalysisValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteAnalysis{}, middleware.After) } @@ -2778,6 +2842,14 @@ func addOpSearchDashboardsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSearchDashboards{}, middleware.After) } +func addOpSearchDataSetsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchDataSets{}, middleware.After) +} + +func addOpSearchDataSourcesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSearchDataSources{}, middleware.After) +} + func addOpSearchFoldersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpSearchFolders{}, middleware.After) } @@ -3008,6 +3080,26 @@ func validateAnonymousUserEmbeddingExperienceConfiguration(v *types.AnonymousUse invalidParams.AddNested("DashboardVisual", err.(smithy.InvalidParamsError)) } } + if v.QSearchBar != nil { + if err := validateAnonymousUserQSearchBarEmbeddingConfiguration(v.QSearchBar); err != nil { + invalidParams.AddNested("QSearchBar", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateAnonymousUserQSearchBarEmbeddingConfiguration(v *types.AnonymousUserQSearchBarEmbeddingConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AnonymousUserQSearchBarEmbeddingConfiguration"} + if v.InitialTopicId == nil { + invalidParams.Add(smithy.NewErrParamRequired("InitialTopicId")) + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -3316,6 +3408,24 @@ func validateDashboardVisualId(v *types.DashboardVisualId) error { } } +func validateDatabricksParameters(v *types.DatabricksParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DatabricksParameters"} + if v.Host == nil { + invalidParams.Add(smithy.NewErrParamRequired("Host")) + } + if v.SqlEndpointPath == nil { + invalidParams.Add(smithy.NewErrParamRequired("SqlEndpointPath")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDataSetReference(v *types.DataSetReference) error { if v == nil { return nil @@ -3351,6 +3461,44 @@ func validateDataSetReferenceList(v []types.DataSetReference) error { } } +func validateDataSetSearchFilter(v *types.DataSetSearchFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataSetSearchFilter"} + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if len(v.Name) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDataSetSearchFilterList(v []types.DataSetSearchFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataSetSearchFilterList"} + for i := range v { + if err := validateDataSetSearchFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDataSourceCredentials(v *types.DataSourceCredentials) error { if v == nil { return nil @@ -3399,6 +3547,11 @@ func validateDataSourceParameters(v types.DataSourceParameters) error { invalidParams.AddNested("[AwsIotAnalyticsParameters]", err.(smithy.InvalidParamsError)) } + case *types.DataSourceParametersMemberDatabricksParameters: + if err := validateDatabricksParameters(&uv.Value); err != nil { + invalidParams.AddNested("[DatabricksParameters]", err.(smithy.InvalidParamsError)) + } + case *types.DataSourceParametersMemberExasolParameters: if err := validateExasolParameters(&uv.Value); err != nil { invalidParams.AddNested("[ExasolParameters]", err.(smithy.InvalidParamsError)) @@ -3504,6 +3657,44 @@ func validateDataSourceParametersList(v []types.DataSourceParameters) error { } } +func validateDataSourceSearchFilter(v *types.DataSourceSearchFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataSourceSearchFilter"} + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if len(v.Name) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDataSourceSearchFilterList(v []types.DataSourceSearchFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataSourceSearchFilterList"} + for i := range v { + if err := validateDataSourceSearchFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDateTimeParameter(v *types.DateTimeParameter) error { if v == nil { return nil @@ -5299,6 +5490,21 @@ func validateOpDeleteAccountCustomizationInput(v *DeleteAccountCustomizationInpu } } +func validateOpDeleteAccountSubscriptionInput(v *DeleteAccountSubscriptionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccountSubscriptionInput"} + if v.AwsAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsAccountId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteAnalysisInput(v *DeleteAnalysisInput) error { if v == nil { return nil @@ -6672,6 +6878,50 @@ func validateOpSearchDashboardsInput(v *SearchDashboardsInput) error { } } +func validateOpSearchDataSetsInput(v *SearchDataSetsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchDataSetsInput"} + if v.AwsAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsAccountId")) + } + if v.Filters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Filters")) + } else if v.Filters != nil { + if err := validateDataSetSearchFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSearchDataSourcesInput(v *SearchDataSourcesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SearchDataSourcesInput"} + if v.AwsAccountId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AwsAccountId")) + } + if v.Filters == nil { + invalidParams.Add(smithy.NewErrParamRequired("Filters")) + } else if v.Filters != nil { + if err := validateDataSourceSearchFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpSearchFoldersInput(v *SearchFoldersInput) error { if v == nil { return nil diff --git a/service/sagemaker/deserializers.go b/service/sagemaker/deserializers.go index 1a7f0353b44..002ee23aea6 100644 --- a/service/sagemaker/deserializers.go +++ b/service/sagemaker/deserializers.go @@ -54637,6 +54637,15 @@ func awsAwsjson11_deserializeDocumentProfilerConfig(v **types.ProfilerConfig, va for key, value := range shape { switch key { + case "DisableProfiler": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected DisableProfiler to be of type *bool, got %T instead", value) + } + sv.DisableProfiler = jtv + } + case "ProfilingIntervalInMilliseconds": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/sagemaker/serializers.go b/service/sagemaker/serializers.go index e8727194d66..6e708f40513 100644 --- a/service/sagemaker/serializers.go +++ b/service/sagemaker/serializers.go @@ -20689,6 +20689,11 @@ func awsAwsjson11_serializeDocumentProfilerConfig(v *types.ProfilerConfig, value object := value.Object() defer object.Close() + if v.DisableProfiler { + ok := object.Key("DisableProfiler") + ok.Boolean(v.DisableProfiler) + } + if v.ProfilingIntervalInMilliseconds != nil { ok := object.Key("ProfilingIntervalInMilliseconds") ok.Long(*v.ProfilingIntervalInMilliseconds) diff --git a/service/sagemaker/types/types.go b/service/sagemaker/types/types.go index 38ff221027c..98d1251c0d1 100644 --- a/service/sagemaker/types/types.go +++ b/service/sagemaker/types/types.go @@ -11113,10 +11113,8 @@ type ProductionVariantSummary struct { // and storage paths. type ProfilerConfig struct { - // Path to Amazon S3 storage location for system and framework metrics. - // - // This member is required. - S3OutputPath *string + // To disable system monitoring and profiling, set to True. + DisableProfiler bool // A time interval for capturing system metrics in milliseconds. Available values // are 100, 200, 500, 1000 (1 second), 5000 (5 seconds), and 60000 (1 minute) @@ -11133,6 +11131,9 @@ type ProfilerConfig struct { // (https://docs.aws.amazon.com/sagemaker/latest/dg/debugger-createtrainingjob-api.html). ProfilingParameters map[string]string + // Path to Amazon S3 storage location for system and framework metrics. + S3OutputPath *string + noSmithyDocumentSerde } diff --git a/service/sagemaker/validators.go b/service/sagemaker/validators.go index b7bfd291f0b..0d0b033baa4 100644 --- a/service/sagemaker/validators.go +++ b/service/sagemaker/validators.go @@ -8942,21 +8942,6 @@ func validateProductionVariantServerlessConfig(v *types.ProductionVariantServerl } } -func validateProfilerConfig(v *types.ProfilerConfig) error { - if v == nil { - return nil - } - invalidParams := smithy.InvalidParamsError{Context: "ProfilerConfig"} - if v.S3OutputPath == nil { - invalidParams.Add(smithy.NewErrParamRequired("S3OutputPath")) - } - if invalidParams.Len() > 0 { - return invalidParams - } else { - return nil - } -} - func validateProfilerRuleConfiguration(v *types.ProfilerRuleConfiguration) error { if v == nil { return nil @@ -11409,11 +11394,6 @@ func validateOpCreateTrainingJobInput(v *CreateTrainingJobInput) error { invalidParams.AddNested("TensorBoardOutputConfig", err.(smithy.InvalidParamsError)) } } - if v.ProfilerConfig != nil { - if err := validateProfilerConfig(v.ProfilerConfig); err != nil { - invalidParams.AddNested("ProfilerConfig", err.(smithy.InvalidParamsError)) - } - } if v.ProfilerRuleConfigurations != nil { if err := validateProfilerRuleConfigurations(v.ProfilerRuleConfigurations); err != nil { invalidParams.AddNested("ProfilerRuleConfigurations", err.(smithy.InvalidParamsError)) diff --git a/service/servicecatalog/api_op_AssociatePrincipalWithPortfolio.go b/service/servicecatalog/api_op_AssociatePrincipalWithPortfolio.go index 9f9068042d3..a2e407cdb3b 100644 --- a/service/servicecatalog/api_op_AssociatePrincipalWithPortfolio.go +++ b/service/servicecatalog/api_op_AssociatePrincipalWithPortfolio.go @@ -11,7 +11,21 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Associates the specified principal ARN with the specified portfolio. +// Associates the specified principal ARN with the specified portfolio. If you +// share the portfolio with principal name sharing enabled, the PrincipalARN +// association is included in the share. The PortfolioID, PrincipalARN, and +// PrincipalType parameters are required. You can associate a maximum of 10 +// Principals with a portfolio using PrincipalType as IAM_PATTERN When you +// associate a principal with portfolio, a potential privilege escalation path may +// occur when that portfolio is then shared with other accounts. For a user in a +// recipient account who is not an Service Catalog Admin, but still has the ability +// to create Principals (Users/Groups/Roles), that user could create a role that +// matches a principal name association for the portfolio. Although this user may +// not know which principal names are associated through Service Catalog, they may +// be able to guess the user. If this potential escalation path is a concern, then +// Service Catalog recommends using PrincipalType as IAM. With this configuration, +// the PrincipalARN must already exist in the recipient account before it can be +// associated. func (c *Client) AssociatePrincipalWithPortfolio(ctx context.Context, params *AssociatePrincipalWithPortfolioInput, optFns ...func(*Options)) (*AssociatePrincipalWithPortfolioOutput, error) { if params == nil { params = &AssociatePrincipalWithPortfolioInput{} @@ -34,12 +48,17 @@ type AssociatePrincipalWithPortfolioInput struct { // This member is required. PortfolioId *string - // The ARN of the principal (IAM user, role, or group). + // The ARN of the principal (IAM user, role, or group). This field allows an ARN + // with no accountID if PrincipalType is IAM_PATTERN. You can associate multiple + // IAM patterns even if the account has no principal with that name. This is useful + // in Principal Name Sharing if you want to share a principal without creating it + // in the account that owns the portfolio. // // This member is required. PrincipalARN *string - // The principal type. The supported value is IAM. + // The principal type. The supported value is IAM if you use a fully defined ARN, + // or IAM_PATTERN if you use an ARN with no accountID. // // This member is required. PrincipalType types.PrincipalType diff --git a/service/servicecatalog/api_op_CreatePortfolioShare.go b/service/servicecatalog/api_op_CreatePortfolioShare.go index 8f917da0346..792682ba07a 100644 --- a/service/servicecatalog/api_op_CreatePortfolioShare.go +++ b/service/servicecatalog/api_op_CreatePortfolioShare.go @@ -21,7 +21,17 @@ import ( // that contain a shared product. If the portfolio share with the specified account // or organization node already exists, this action will have no effect and will // not return an error. To update an existing share, you must use the -// UpdatePortfolioShare API instead. +// UpdatePortfolioShare API instead. When you associate a principal with portfolio, +// a potential privilege escalation path may occur when that portfolio is then +// shared with other accounts. For a user in a recipient account who is not an +// Service Catalog Admin, but still has the ability to create Principals +// (Users/Groups/Roles), that user could create a role that matches a principal +// name association for the portfolio. Although this user may not know which +// principal names are associated through Service Catalog, they may be able to +// guess the user. If this potential escalation path is a concern, then Service +// Catalog recommends using PrincipalType as IAM. With this configuration, the +// PrincipalARN must already exist in the recipient account before it can be +// associated. func (c *Client) CreatePortfolioShare(ctx context.Context, params *CreatePortfolioShareInput, optFns ...func(*Options)) (*CreatePortfolioShareOutput, error) { if params == nil { params = &CreatePortfolioShareInput{} @@ -63,6 +73,15 @@ type CreatePortfolioShareInput struct { // the PortfolioShare creation process. OrganizationNode *types.OrganizationNode + // Enables or disables Principal sharing when creating the portfolio share. If this + // flag is not provided, principal sharing is disabled. When you enable Principal + // Name Sharing for a portfolio share, the share recipient account end users with a + // principal that matches any of the associated IAM patterns can provision products + // from the portfolio. Once shared, the share recipient can view associations of + // PrincipalType: IAM_PATTERN on their portfolio. You can create the principals in + // the recipient account before or after creating the share. + SharePrincipals bool + // Enables or disables TagOptions sharing when creating the portfolio share. If // this flag is not provided, TagOptions sharing is disabled. ShareTagOptions bool diff --git a/service/servicecatalog/api_op_CreateProduct.go b/service/servicecatalog/api_op_CreateProduct.go index 33e399074ed..cbcb3f188ab 100644 --- a/service/servicecatalog/api_op_CreateProduct.go +++ b/service/servicecatalog/api_op_CreateProduct.go @@ -56,11 +56,6 @@ type CreateProductInput struct { // This member is required. ProductType types.ProductType - // The configuration of the provisioning artifact. - // - // This member is required. - ProvisioningArtifactParameters *types.ProvisioningArtifactProperties - // The language code. // // * en - English (default) @@ -76,6 +71,19 @@ type CreateProductInput struct { // The distributor of the product. Distributor *string + // The configuration of the provisioning artifact. + ProvisioningArtifactParameters *types.ProvisioningArtifactProperties + + // Specifies connection details for the created product and syncs the product to + // the connection source artifact. This automatically manages the product's + // artifacts based on changes to the source. The SourceConnection parameter + // consists of the following sub-fields. + // + // * Type + // + // * ConnectionParamters + SourceConnection *types.SourceConnection + // The support information about the product. SupportDescription *string diff --git a/service/servicecatalog/api_op_CreateProvisioningArtifact.go b/service/servicecatalog/api_op_CreateProvisioningArtifact.go index 5fab503841a..6748deec4be 100644 --- a/service/servicecatalog/api_op_CreateProvisioningArtifact.go +++ b/service/servicecatalog/api_op_CreateProvisioningArtifact.go @@ -67,12 +67,11 @@ type CreateProvisioningArtifactInput struct { type CreateProvisioningArtifactOutput struct { // Specify the template source with one of the following options, but not both. - // Keys accepted: [ LoadTemplateFromURL, ImportFromPhysicalId ]. The URL of the - // CloudFormation template in Amazon S3, Amazon Web Services CodeCommit, or GitHub - // in JSON format. LoadTemplateFromURL Use the URL of the CloudFormation template - // in Amazon S3, Amazon Web Services CodeCommit, or GitHub in JSON format. - // ImportFromPhysicalId Use the physical id of the resource that contains the - // template; currently supports CloudFormation stack ARN. + // Keys accepted: [ LoadTemplateFromURL, ImportFromPhysicalId ]. Use the URL of the + // CloudFormation template in Amazon S3 or GitHub in JSON format. + // LoadTemplateFromURL Use the URL of the CloudFormation template in Amazon S3 or + // GitHub in JSON format. ImportFromPhysicalId Use the physical id of the resource + // that contains the template; currently supports CloudFormation stack ARN. Info map[string]string // Information about the provisioning artifact. diff --git a/service/servicecatalog/api_op_DescribeProvisioningArtifact.go b/service/servicecatalog/api_op_DescribeProvisioningArtifact.go index 843d8b8ca45..99bfc33d8c9 100644 --- a/service/servicecatalog/api_op_DescribeProvisioningArtifact.go +++ b/service/servicecatalog/api_op_DescribeProvisioningArtifact.go @@ -59,8 +59,7 @@ type DescribeProvisioningArtifactInput struct { type DescribeProvisioningArtifactOutput struct { - // The URL of the CloudFormation template in Amazon S3, Amazon Web Services - // CodeCommit, or GitHub in JSON format. + // The URL of the CloudFormation template in Amazon S3 or GitHub in JSON format. Info map[string]string // Information about the provisioning artifact. diff --git a/service/servicecatalog/api_op_DisassociatePrincipalFromPortfolio.go b/service/servicecatalog/api_op_DisassociatePrincipalFromPortfolio.go index a0a0659c355..6be6f23f029 100644 --- a/service/servicecatalog/api_op_DisassociatePrincipalFromPortfolio.go +++ b/service/servicecatalog/api_op_DisassociatePrincipalFromPortfolio.go @@ -6,11 +6,20 @@ import ( "context" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + "github.com/aws/aws-sdk-go-v2/service/servicecatalog/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" ) // Disassociates a previously associated principal ARN from a specified portfolio. +// The PrincipalType and PrincipalARN must match the +// AssociatePrincipalWithPortfolio call request details. For example, to +// disassociate an association created with a PrincipalARN of PrincipalType IAM you +// must use the PrincipalType IAM when calling DisassociatePrincipalFromPortfolio. +// For portfolios that have been shared with principal name sharing enabled: after +// disassociating a principal, share recipient accounts will no longer be able to +// provision products in this portfolio using a role matching the name of the +// associated principal. func (c *Client) DisassociatePrincipalFromPortfolio(ctx context.Context, params *DisassociatePrincipalFromPortfolioInput, optFns ...func(*Options)) (*DisassociatePrincipalFromPortfolioOutput, error) { if params == nil { params = &DisassociatePrincipalFromPortfolioInput{} @@ -33,7 +42,8 @@ type DisassociatePrincipalFromPortfolioInput struct { // This member is required. PortfolioId *string - // The ARN of the principal (IAM user, role, or group). + // The ARN of the principal (IAM user, role, or group). This field allows an ARN + // with no accountID if PrincipalType is IAM_PATTERN. // // This member is required. PrincipalARN *string @@ -47,6 +57,10 @@ type DisassociatePrincipalFromPortfolioInput struct { // * zh - Chinese AcceptLanguage *string + // The supported value is IAM if you use a fully defined ARN, or IAM_PATTERN if you + // use no accountID. + PrincipalType types.PrincipalType + noSmithyDocumentSerde } diff --git a/service/servicecatalog/api_op_ImportAsProvisionedProduct.go b/service/servicecatalog/api_op_ImportAsProvisionedProduct.go index 43daf239d64..ca1466e2db4 100644 --- a/service/servicecatalog/api_op_ImportAsProvisionedProduct.go +++ b/service/servicecatalog/api_op_ImportAsProvisionedProduct.go @@ -12,19 +12,18 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Requests the import of a resource as a Amazon Web Services Service Catalog -// provisioned product that is associated to a Amazon Web Services Service Catalog -// product and provisioning artifact. Once imported, all supported Amazon Web -// Services Service Catalog governance actions are supported on the provisioned -// product. Resource import only supports CloudFormation stack ARNs. CloudFormation -// StackSets and non-root nested stacks are not supported. The CloudFormation stack -// must have one of the following statuses to be imported: CREATE_COMPLETE, -// UPDATE_COMPLETE, UPDATE_ROLLBACK_COMPLETE, IMPORT_COMPLETE, +// Requests the import of a resource as an Service Catalog provisioned product that +// is associated to an Service Catalog product and provisioning artifact. Once +// imported, all supported Service Catalog governance actions are supported on the +// provisioned product. Resource import only supports CloudFormation stack ARNs. +// CloudFormation StackSets and non-root nested stacks are not supported. The +// CloudFormation stack must have one of the following statuses to be imported: +// CREATE_COMPLETE, UPDATE_COMPLETE, UPDATE_ROLLBACK_COMPLETE, IMPORT_COMPLETE, // IMPORT_ROLLBACK_COMPLETE. Import of the resource requires that the -// CloudFormation stack template matches the associated Amazon Web Services Service -// Catalog product provisioning artifact. The user or role that performs this -// operation must have the cloudformation:GetTemplate and -// cloudformation:DescribeStacks IAM policy permissions. +// CloudFormation stack template matches the associated Service Catalog product +// provisioning artifact. The user or role that performs this operation must have +// the cloudformation:GetTemplate and cloudformation:DescribeStacks IAM policy +// permissions. func (c *Client) ImportAsProvisionedProduct(ctx context.Context, params *ImportAsProvisionedProductInput, optFns ...func(*Options)) (*ImportAsProvisionedProductOutput, error) { if params == nil { params = &ImportAsProvisionedProductInput{} diff --git a/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go b/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go index c3b34a5457d..61bbc6b3029 100644 --- a/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go +++ b/service/servicecatalog/api_op_ListPrincipalsForPortfolio.go @@ -12,7 +12,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists all principal ARNs associated with the specified portfolio. +// Lists all PrincipalARNs and corresponding PrincipalTypes associated with the +// specified portfolio. func (c *Client) ListPrincipalsForPortfolio(ctx context.Context, params *ListPrincipalsForPortfolioInput, optFns ...func(*Options)) (*ListPrincipalsForPortfolioOutput, error) { if params == nil { params = &ListPrincipalsForPortfolioInput{} @@ -60,7 +61,8 @@ type ListPrincipalsForPortfolioOutput struct { // additional results, this value is null. NextPageToken *string - // The IAM principals (users or roles) associated with the portfolio. + // The PrincipalARNs and corresponding PrincipalTypes associated with the + // portfolio. Principals []types.Principal // Metadata pertaining to the operation's result. diff --git a/service/servicecatalog/api_op_UpdatePortfolioShare.go b/service/servicecatalog/api_op_UpdatePortfolioShare.go index 29da61b7aad..0d672dfbd9b 100644 --- a/service/servicecatalog/api_op_UpdatePortfolioShare.go +++ b/service/servicecatalog/api_op_UpdatePortfolioShare.go @@ -12,15 +12,25 @@ import ( ) // Updates the specified portfolio share. You can use this API to enable or disable -// TagOptions sharing for an existing portfolio share. The portfolio share cannot -// be updated if the CreatePortfolioShare operation is IN_PROGRESS, as the share -// is not available to recipient entities. In this case, you must wait for the -// portfolio share to be COMPLETED. You must provide the accountId or organization -// node in the input, but not both. If the portfolio is shared to both an external -// account and an organization node, and both shares need to be updated, you must -// invoke UpdatePortfolioShare separately for each share type. This API cannot be -// used for removing the portfolio share. You must use DeletePortfolioShare API for -// that action. +// TagOptions sharing or Principal sharing for an existing portfolio share. The +// portfolio share cannot be updated if the CreatePortfolioShare operation is +// IN_PROGRESS, as the share is not available to recipient entities. In this case, +// you must wait for the portfolio share to be COMPLETED. You must provide the +// accountId or organization node in the input, but not both. If the portfolio is +// shared to both an external account and an organization node, and both shares +// need to be updated, you must invoke UpdatePortfolioShare separately for each +// share type. This API cannot be used for removing the portfolio share. You must +// use DeletePortfolioShare API for that action. When you associate a principal +// with portfolio, a potential privilege escalation path may occur when that +// portfolio is then shared with other accounts. For a user in a recipient account +// who is not an Service Catalog Admin, but still has the ability to create +// Principals (Users/Groups/Roles), that user could create a role that matches a +// principal name association for the portfolio. Although this user may not know +// which principal names are associated through Service Catalog, they may be able +// to guess the user. If this potential escalation path is a concern, then Service +// Catalog recommends using PrincipalType as IAM. With this configuration, the +// PrincipalARN must already exist in the recipient account before it can be +// associated. func (c *Client) UpdatePortfolioShare(ctx context.Context, params *UpdatePortfolioShareInput, optFns ...func(*Options)) (*UpdatePortfolioShareOutput, error) { if params == nil { params = &UpdatePortfolioShareInput{} @@ -59,9 +69,14 @@ type UpdatePortfolioShareInput struct { // Information about the organization node. OrganizationNode *types.OrganizationNode - // A flag to enable or disable TagOptions sharing for the portfolio share. If this - // field is not provided, the current state of TagOptions sharing on the portfolio + // A flag to enables or disables Principals sharing in the portfolio. If this field + // is not provided, the current state of the Principals sharing on the portfolio // share will not be modified. + SharePrincipals *bool + + // Enables or disables TagOptions sharing for the portfolio share. If this field is + // not provided, the current state of TagOptions sharing on the portfolio share + // will not be modified. ShareTagOptions *bool noSmithyDocumentSerde diff --git a/service/servicecatalog/api_op_UpdateProduct.go b/service/servicecatalog/api_op_UpdateProduct.go index a43e541abde..eb1fe3e79c0 100644 --- a/service/servicecatalog/api_op_UpdateProduct.go +++ b/service/servicecatalog/api_op_UpdateProduct.go @@ -61,6 +61,16 @@ type UpdateProductInput struct { // The tags to remove from the product. RemoveTags []string + // Specifies connection details for the updated product and syncs the product to + // the connection source artifact. This automatically manages the product's + // artifacts based on changes to the source. The SourceConnection parameter + // consists of the following sub-fields. + // + // * Type + // + // * ConnectionParamters + SourceConnection *types.SourceConnection + // The updated support description for the product. SupportDescription *string diff --git a/service/servicecatalog/api_op_UpdateProvisioningArtifact.go b/service/servicecatalog/api_op_UpdateProvisioningArtifact.go index d7e474a721e..caa6a5d827d 100644 --- a/service/servicecatalog/api_op_UpdateProvisioningArtifact.go +++ b/service/servicecatalog/api_op_UpdateProvisioningArtifact.go @@ -74,8 +74,7 @@ type UpdateProvisioningArtifactInput struct { type UpdateProvisioningArtifactOutput struct { - // The URL of the CloudFormation template in Amazon S3, Amazon Web Services - // CodeCommit, or GitHub in JSON format. + // The URL of the CloudFormation template in Amazon S3 or GitHub in JSON format. Info map[string]string // Information about the provisioning artifact. diff --git a/service/servicecatalog/deserializers.go b/service/servicecatalog/deserializers.go index 777df29e895..36b8ee155cf 100644 --- a/service/servicecatalog/deserializers.go +++ b/service/servicecatalog/deserializers.go @@ -10527,6 +10527,73 @@ func awsAwsjson11_deserializeDocumentCloudWatchDashboards(v *[]types.CloudWatchD return nil } +func awsAwsjson11_deserializeDocumentCodeStarParameters(v **types.CodeStarParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.CodeStarParameters + if *v == nil { + sv = &types.CodeStarParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ArtifactPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryArtifactPath to be of type string, got %T instead", value) + } + sv.ArtifactPath = ptr.String(jtv) + } + + case "Branch": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RepositoryBranch to be of type string, got %T instead", value) + } + sv.Branch = ptr.String(jtv) + } + + case "ConnectionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CodeStarConnectionArn to be of type string, got %T instead", value) + } + sv.ConnectionArn = ptr.String(jtv) + } + + case "Repository": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Repository to be of type string, got %T instead", value) + } + sv.Repository = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentConstraintDetail(v **types.ConstraintDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11083,6 +11150,96 @@ func awsAwsjson11_deserializeDocumentInvalidStateException(v **types.InvalidStat return nil } +func awsAwsjson11_deserializeDocumentLastSync(v **types.LastSync, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.LastSync + if *v == nil { + sv = &types.LastSync{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "LastSuccessfulSyncProvisioningArtifactId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.LastSuccessfulSyncProvisioningArtifactId = ptr.String(jtv) + } + + case "LastSuccessfulSyncTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastSuccessfulSyncTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastSuccessfulSyncTime to be a JSON Number, got %T instead", value) + + } + } + + case "LastSyncStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LastSyncStatus to be of type string, got %T instead", value) + } + sv.LastSyncStatus = types.LastSyncStatus(jtv) + } + + case "LastSyncStatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LastSyncStatusMessage to be of type string, got %T instead", value) + } + sv.LastSyncStatusMessage = ptr.String(jtv) + } + + case "LastSyncTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastSyncTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected LastSyncTime to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentLaunchPath(v **types.LaunchPath, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11750,6 +11907,15 @@ func awsAwsjson11_deserializeDocumentPortfolioShareDetail(v **types.PortfolioSha sv.PrincipalId = ptr.String(jtv) } + case "SharePrincipals": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.SharePrincipals = jtv + } + case "ShareTagOptions": if value != nil { jtv, ok := value.(bool) @@ -12067,6 +12233,11 @@ func awsAwsjson11_deserializeDocumentProductViewDetail(v **types.ProductViewDeta return err } + case "SourceConnection": + if err := awsAwsjson11_deserializeDocumentSourceConnectionDetail(&sv.SourceConnection, value); err != nil { + return err + } + case "Status": if value != nil { jtv, ok := value.(string) @@ -13209,6 +13380,15 @@ func awsAwsjson11_deserializeDocumentProvisioningArtifactDetail(v **types.Provis sv.Name = ptr.String(jtv) } + case "SourceRevision": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceRevision to be of type string, got %T instead", value) + } + sv.SourceRevision = ptr.String(jtv) + } + case "Type": if value != nil { jtv, ok := value.(string) @@ -15019,6 +15199,92 @@ func awsAwsjson11_deserializeDocumentShareErrors(v *[]types.ShareError, value in return nil } +func awsAwsjson11_deserializeDocumentSourceConnectionDetail(v **types.SourceConnectionDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SourceConnectionDetail + if *v == nil { + sv = &types.SourceConnectionDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ConnectionParameters": + if err := awsAwsjson11_deserializeDocumentSourceConnectionParameters(&sv.ConnectionParameters, value); err != nil { + return err + } + + case "LastSync": + if err := awsAwsjson11_deserializeDocumentLastSync(&sv.LastSync, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SourceType to be of type string, got %T instead", value) + } + sv.Type = types.SourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSourceConnectionParameters(v **types.SourceConnectionParameters, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SourceConnectionParameters + if *v == nil { + sv = &types.SourceConnectionParameters{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CodeStar": + if err := awsAwsjson11_deserializeDocumentCodeStarParameters(&sv.CodeStar, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentStackInstance(v **types.StackInstance, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/servicecatalog/doc.go b/service/servicecatalog/doc.go index f707d5e06f2..cf6d375dac1 100644 --- a/service/servicecatalog/doc.go +++ b/service/servicecatalog/doc.go @@ -3,9 +3,9 @@ // Package servicecatalog provides the API client, operations, and parameter types // for AWS Service Catalog. // -// AWS Service Catalog Service Catalog (https://aws.amazon.com/servicecatalog/) -// enables organizations to create and manage catalogs of IT services that are -// approved for Amazon Web Services. To get the most out of this documentation, you -// should be familiar with the terminology discussed in Service Catalog Concepts +// Service Catalog Service Catalog (http://aws.amazon.com/servicecatalog) enables +// organizations to create and manage catalogs of IT services that are approved for +// Amazon Web Services. To get the most out of this documentation, you should be +// familiar with the terminology discussed in Service Catalog Concepts // (http://docs.aws.amazon.com/servicecatalog/latest/adminguide/what-is_concepts.html). package servicecatalog diff --git a/service/servicecatalog/serializers.go b/service/servicecatalog/serializers.go index ac1f8cb6a94..d9e67cfe275 100644 --- a/service/servicecatalog/serializers.go +++ b/service/servicecatalog/serializers.go @@ -4829,6 +4829,33 @@ func awsAwsjson11_serializeDocumentAddTags(v []types.Tag, value smithyjson.Value return nil } +func awsAwsjson11_serializeDocumentCodeStarParameters(v *types.CodeStarParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ArtifactPath != nil { + ok := object.Key("ArtifactPath") + ok.String(*v.ArtifactPath) + } + + if v.Branch != nil { + ok := object.Key("Branch") + ok.String(*v.Branch) + } + + if v.ConnectionArn != nil { + ok := object.Key("ConnectionArn") + ok.String(*v.ConnectionArn) + } + + if v.Repository != nil { + ok := object.Key("Repository") + ok.String(*v.Repository) + } + + return nil +} + func awsAwsjson11_serializeDocumentCopyOptions(v []types.CopyOption, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -5172,6 +5199,39 @@ func awsAwsjson11_serializeDocumentServiceActionDefinitionMap(v map[string]strin return nil } +func awsAwsjson11_serializeDocumentSourceConnection(v *types.SourceConnection, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConnectionParameters != nil { + ok := object.Key("ConnectionParameters") + if err := awsAwsjson11_serializeDocumentSourceConnectionParameters(v.ConnectionParameters, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsAwsjson11_serializeDocumentSourceConnectionParameters(v *types.SourceConnectionParameters, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CodeStar != nil { + ok := object.Key("CodeStar") + if err := awsAwsjson11_serializeDocumentCodeStarParameters(v.CodeStar, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentSourceProvisioningArtifactProperties(v []map[string]string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -5671,6 +5731,11 @@ func awsAwsjson11_serializeOpDocumentCreatePortfolioShareInput(v *CreatePortfoli ok.String(*v.PortfolioId) } + if v.SharePrincipals { + ok := object.Key("SharePrincipals") + ok.Boolean(v.SharePrincipals) + } + if v.ShareTagOptions { ok := object.Key("ShareTagOptions") ok.Boolean(v.ShareTagOptions) @@ -5725,6 +5790,13 @@ func awsAwsjson11_serializeOpDocumentCreateProductInput(v *CreateProductInput, v } } + if v.SourceConnection != nil { + ok := object.Key("SourceConnection") + if err := awsAwsjson11_serializeDocumentSourceConnection(v.SourceConnection, ok); err != nil { + return err + } + } + if v.SupportDescription != nil { ok := object.Key("SupportDescription") ok.String(*v.SupportDescription) @@ -6461,6 +6533,11 @@ func awsAwsjson11_serializeOpDocumentDisassociatePrincipalFromPortfolioInput(v * ok.String(*v.PrincipalARN) } + if len(v.PrincipalType) > 0 { + ok := object.Key("PrincipalType") + ok.String(string(v.PrincipalType)) + } + return nil } @@ -7576,6 +7653,11 @@ func awsAwsjson11_serializeOpDocumentUpdatePortfolioShareInput(v *UpdatePortfoli ok.String(*v.PortfolioId) } + if v.SharePrincipals != nil { + ok := object.Key("SharePrincipals") + ok.Boolean(*v.SharePrincipals) + } + if v.ShareTagOptions != nil { ok := object.Key("ShareTagOptions") ok.Boolean(*v.ShareTagOptions) @@ -7632,6 +7714,13 @@ func awsAwsjson11_serializeOpDocumentUpdateProductInput(v *UpdateProductInput, v } } + if v.SourceConnection != nil { + ok := object.Key("SourceConnection") + if err := awsAwsjson11_serializeDocumentSourceConnection(v.SourceConnection, ok); err != nil { + return err + } + } + if v.SupportDescription != nil { ok := object.Key("SupportDescription") ok.String(*v.SupportDescription) diff --git a/service/servicecatalog/types/enums.go b/service/servicecatalog/types/enums.go index f415b2e4456..70915f70efc 100644 --- a/service/servicecatalog/types/enums.go +++ b/service/servicecatalog/types/enums.go @@ -138,6 +138,24 @@ func (EvaluationType) Values() []EvaluationType { } } +type LastSyncStatus string + +// Enum values for LastSyncStatus +const ( + LastSyncStatusSucceeded LastSyncStatus = "SUCCEEDED" + LastSyncStatusFailed LastSyncStatus = "FAILED" +) + +// Values returns all known values for LastSyncStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. The +// ordering of this slice is not guaranteed to be stable across updates. +func (LastSyncStatus) Values() []LastSyncStatus { + return []LastSyncStatus{ + "SUCCEEDED", + "FAILED", + } +} + type OrganizationNodeType string // Enum values for OrganizationNodeType @@ -182,7 +200,8 @@ type PrincipalType string // Enum values for PrincipalType const ( - PrincipalTypeIam PrincipalType = "IAM" + PrincipalTypeIam PrincipalType = "IAM" + PrincipalTypeIamPattern PrincipalType = "IAM_PATTERN" ) // Values returns all known values for PrincipalType. Note that this can be @@ -191,6 +210,7 @@ const ( func (PrincipalType) Values() []PrincipalType { return []PrincipalType{ "IAM", + "IAM_PATTERN", } } @@ -621,6 +641,22 @@ func (SortOrder) Values() []SortOrder { } } +type SourceType string + +// Enum values for SourceType +const ( + SourceTypeCodestar SourceType = "CODESTAR" +) + +// Values returns all known values for SourceType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. The ordering of +// this slice is not guaranteed to be stable across updates. +func (SourceType) Values() []SourceType { + return []SourceType{ + "CODESTAR", + } +} + type StackInstanceStatus string // Enum values for StackInstanceStatus diff --git a/service/servicecatalog/types/types.go b/service/servicecatalog/types/types.go index b66261954a7..1f42a5c0e93 100644 --- a/service/servicecatalog/types/types.go +++ b/service/servicecatalog/types/types.go @@ -45,6 +45,35 @@ type CloudWatchDashboard struct { noSmithyDocumentSerde } +// The subtype containing details about the Codestar connection Type. +type CodeStarParameters struct { + + // The absolute path wehre the artifact resides within the repo and branch, + // formatted as "folder/file.json." + // + // This member is required. + ArtifactPath *string + + // The specific branch where the artifact resides. + // + // This member is required. + Branch *string + + // The CodeStar ARN, which is the connection between Service Catalog and the + // external repository. + // + // This member is required. + ConnectionArn *string + + // The specific repository where the product’s artifact-to-be-synced resides, + // formatted as "Account/Repo." + // + // This member is required. + Repository *string + + noSmithyDocumentSerde +} + // Information about a constraint. type ConstraintDetail struct { @@ -137,6 +166,42 @@ type FailedServiceActionAssociation struct { noSmithyDocumentSerde } +// Provides details about the product's connection sync and contains the following +// sub-fields. +// +// * LastSyncTime +// +// * LastSyncStatus +// +// * LastSyncStatusMessage +// +// * +// LastSuccessfulSyncTime +// +// * LastSuccessfulSyncProvisioningArtifactID +type LastSync struct { + + // The ProvisioningArtifactID of the ProvisioningArtifact created from the latest + // successful sync. + LastSuccessfulSyncProvisioningArtifactId *string + + // The time of the latest successful sync from the source repo artifact to the + // Service Catalog product. + LastSuccessfulSyncTime *time.Time + + // The current status of the sync. Responses include SUCCEEDED or FAILED. + LastSyncStatus LastSyncStatus + + // The sync's status message. + LastSyncStatusMessage *string + + // The time of the last attempted sync from the repository to the Service Catalog + // product. + LastSyncTime *time.Time + + noSmithyDocumentSerde +} + // A launch path object. type LaunchPath struct { @@ -284,11 +349,14 @@ type PortfolioShareDetail struct { Accepted bool // The identifier of the recipient entity that received the portfolio share. The - // recipient entities can be one of the following: 1. An external account. 2. An + // recipient entity can be one of the following: 1. An external account. 2. An // organziation member account. 3. An organzational unit (OU). 4. The organization // itself. (This shares with every account in the organization). PrincipalId *string + // Indicates if Principal sharing is enabled or disabled for the portfolio share. + SharePrincipals bool + // Indicates whether TagOptions sharing is enabled or disabled for the portfolio // share. ShareTagOptions bool @@ -302,10 +370,12 @@ type PortfolioShareDetail struct { // Information about a principal. type Principal struct { - // The ARN of the principal (IAM user, role, or group). + // The ARN of the principal (IAM user, role, or group). This field allows for an + // ARN with no accountID if the PrincipalType is an IAM_PATTERN. PrincipalARN *string - // The principal type. The supported value is IAM. + // The principal type. The supported value is IAM if you use a fully defined ARN, + // or IAM_PATTERN if you use an ARN with no accountID. PrincipalType PrincipalType noSmithyDocumentSerde @@ -336,6 +406,13 @@ type ProductViewDetail struct { // Summary information about the product view. ProductViewSummary *ProductViewSummary + // A top level ProductViewDetail response containing details about the product’s + // connection. Service Catalog returns this field for the CreateProduct, + // UpdateProduct, DescribeProductAsAdmin, and SearchProductAsAdmin APIs. This + // response contains the same fields as the ConnectionParameters request, with the + // addition of the LastSync response. + SourceConnection *SourceConnectionDetail + // The status of the product. // // * AVAILABLE - The product is ready for use. @@ -651,7 +728,7 @@ type ProvisionedProductPlanDetails struct { // One or more tags. Tags []Tag - // The time when the plan was last updated. + // The UTC time stamp when the plan was last updated. UpdatedTime *time.Time noSmithyDocumentSerde @@ -727,6 +804,15 @@ type ProvisioningArtifactDetail struct { // The name of the provisioning artifact. Name *string + // Specifies the revision of the external artifact that was used to automatically + // sync the Service Catalog product and create the provisioning artifact. Service + // Catalog includes this response parameter as a high level field to the existing + // ProvisioningArtifactDetail type, which is returned as part of the response for + // CreateProduct, UpdateProduct, DescribeProductAsAdmin, + // DescribeProvisioningArtifact, ListProvisioningArtifact, and + // UpdateProvisioningArticat APIs. This field only exists for Repo-Synced products. + SourceRevision *string + // The type of provisioning artifact. // // * CLOUD_FORMATION_TEMPLATE - CloudFormation @@ -809,28 +895,25 @@ type ProvisioningArtifactPreferences struct { // product. type ProvisioningArtifactProperties struct { + // The description of the provisioning artifact, including how it differs from the + // previous provisioning artifact. + Description *string + + // If set to true, Service Catalog stops validating the specified provisioning + // artifact even if it is invalid. + DisableTemplateValidation bool + // Specify the template source with one of the following options, but not both. // Keys accepted: [ LoadTemplateFromURL, ImportFromPhysicalId ] The URL of the - // CloudFormation template in Amazon S3, Amazon Web Services CodeCommit, or GitHub - // in JSON format. Specify the URL in JSON format as follows: - // "LoadTemplateFromURL": + // CloudFormation template in Amazon S3 or GitHub in JSON format. Specify the URL + // in JSON format as follows: "LoadTemplateFromURL": // "https://s3.amazonaws.com/cf-templates-ozkq9d3hgiq2-us-east-1/..."ImportFromPhysicalId: // The physical id of the resource that contains the template. Currently only // supports CloudFormation stack arn. Specify the physical id in JSON format as // follows: ImportFromPhysicalId: // “arn:aws:cloudformation:[us-east-1]:[accountId]:stack/[StackName]/[resourceId] - // - // This member is required. Info map[string]string - // The description of the provisioning artifact, including how it differs from the - // previous provisioning artifact. - Description *string - - // If set to true, Amazon Web Services Service Catalog stops validating the - // specified provisioning artifact even if it is invalid. - DisableTemplateValidation bool - // The name of the provisioning artifact (for example, v1 v2beta). No spaces are // allowed. Name *string @@ -1245,6 +1328,60 @@ type ShareError struct { noSmithyDocumentSerde } +// A top level ProductViewDetail response containing details about the product’s +// connection. Service Catalog returns this field for the CreateProduct, +// UpdateProduct, DescribeProductAsAdmin, and SearchProductAsAdmin APIs. This +// response contains the same fields as the ConnectionParameters request, with the +// addition of the LastSync response. +type SourceConnection struct { + + // The connection details based on the connection Type. + // + // This member is required. + ConnectionParameters *SourceConnectionParameters + + // The only supported SourceConnection type is Codestar. + Type SourceType + + noSmithyDocumentSerde +} + +// Provides details about the configured SourceConnection. +type SourceConnectionDetail struct { + + // The connection details based on the connection Type. + ConnectionParameters *SourceConnectionParameters + + // Provides details about the product's connection sync and contains the following + // sub-fields. + // + // * LastSyncTime + // + // * LastSyncStatus + // + // * LastSyncStatusMessage + // + // * + // LastSuccessfulSyncTime + // + // * LastSuccessfulSyncProvisioningArtifactID + LastSync *LastSync + + // The only supported SourceConnection type is Codestar. + Type SourceType + + noSmithyDocumentSerde +} + +// Provides connection details. +type SourceConnectionParameters struct { + + // Provides ConnectionType details. + CodeStar *CodeStarParameters + + noSmithyDocumentSerde +} + // An CloudFormation stack, in a specific account and Region, that's part of a // stack set operation. A stack instance is a reference to an attempted or actual // stack in a given account within a given Region. A stack instance can exist diff --git a/service/servicecatalog/validators.go b/service/servicecatalog/validators.go index 167dde2fe3e..f71435c3b11 100644 --- a/service/servicecatalog/validators.go +++ b/service/servicecatalog/validators.go @@ -1659,13 +1659,22 @@ func validateAddTags(v []types.Tag) error { } } -func validateProvisioningArtifactProperties(v *types.ProvisioningArtifactProperties) error { +func validateCodeStarParameters(v *types.CodeStarParameters) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "ProvisioningArtifactProperties"} - if v.Info == nil { - invalidParams.Add(smithy.NewErrParamRequired("Info")) + invalidParams := smithy.InvalidParamsError{Context: "CodeStarParameters"} + if v.ConnectionArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionArn")) + } + if v.Repository == nil { + invalidParams.Add(smithy.NewErrParamRequired("Repository")) + } + if v.Branch == nil { + invalidParams.Add(smithy.NewErrParamRequired("Branch")) + } + if v.ArtifactPath == nil { + invalidParams.Add(smithy.NewErrParamRequired("ArtifactPath")) } if invalidParams.Len() > 0 { return invalidParams @@ -1712,6 +1721,42 @@ func validateServiceActionAssociations(v []types.ServiceActionAssociation) error } } +func validateSourceConnection(v *types.SourceConnection) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SourceConnection"} + if v.ConnectionParameters == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConnectionParameters")) + } else if v.ConnectionParameters != nil { + if err := validateSourceConnectionParameters(v.ConnectionParameters); err != nil { + invalidParams.AddNested("ConnectionParameters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSourceConnectionParameters(v *types.SourceConnectionParameters) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SourceConnectionParameters"} + if v.CodeStar != nil { + if err := validateCodeStarParameters(v.CodeStar); err != nil { + invalidParams.AddNested("CodeStar", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTag(v *types.Tag) error { if v == nil { return nil @@ -2001,16 +2046,14 @@ func validateOpCreateProductInput(v *CreateProductInput) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } - if v.ProvisioningArtifactParameters == nil { - invalidParams.Add(smithy.NewErrParamRequired("ProvisioningArtifactParameters")) - } else if v.ProvisioningArtifactParameters != nil { - if err := validateProvisioningArtifactProperties(v.ProvisioningArtifactParameters); err != nil { - invalidParams.AddNested("ProvisioningArtifactParameters", err.(smithy.InvalidParamsError)) - } - } if v.IdempotencyToken == nil { invalidParams.Add(smithy.NewErrParamRequired("IdempotencyToken")) } + if v.SourceConnection != nil { + if err := validateSourceConnection(v.SourceConnection); err != nil { + invalidParams.AddNested("SourceConnection", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2063,10 +2106,6 @@ func validateOpCreateProvisioningArtifactInput(v *CreateProvisioningArtifactInpu } if v.Parameters == nil { invalidParams.Add(smithy.NewErrParamRequired("Parameters")) - } else if v.Parameters != nil { - if err := validateProvisioningArtifactProperties(v.Parameters); err != nil { - invalidParams.AddNested("Parameters", err.(smithy.InvalidParamsError)) - } } if v.IdempotencyToken == nil { invalidParams.Add(smithy.NewErrParamRequired("IdempotencyToken")) @@ -2875,6 +2914,11 @@ func validateOpUpdateProductInput(v *UpdateProductInput) error { invalidParams.AddNested("AddTags", err.(smithy.InvalidParamsError)) } } + if v.SourceConnection != nil { + if err := validateSourceConnection(v.SourceConnection); err != nil { + invalidParams.AddNested("SourceConnection", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/sfn/api_op_CreateActivity.go b/service/sfn/api_op_CreateActivity.go index 27059af920b..6e540df3b1d 100644 --- a/service/sfn/api_op_CreateActivity.go +++ b/service/sfn/api_op_CreateActivity.go @@ -13,12 +13,12 @@ import ( ) // Creates an activity. An activity is a task that you write in any programming -// language and host on any machine that has access to AWS Step Functions. -// Activities must poll Step Functions using the GetActivityTask API action and -// respond using SendTask* API actions. This function lets Step Functions know the -// existence of your activity and returns an identifier for use in a state machine -// and when polling from the activity. This operation is eventually consistent. The -// results are best effort and may not reflect very recent updates and changes. +// language and host on any machine that has access to Step Functions. Activities +// must poll Step Functions using the GetActivityTask API action and respond using +// SendTask* API actions. This function lets Step Functions know the existence of +// your activity and returns an identifier for use in a state machine and when +// polling from the activity. This operation is eventually consistent. The results +// are best effort and may not reflect very recent updates and changes. // CreateActivity is an idempotent API. Subsequent requests won’t create a // duplicate resource if it was already created. CreateActivity's idempotency check // is based on the activity name. If a following request has different tags values, @@ -42,11 +42,11 @@ func (c *Client) CreateActivity(ctx context.Context, params *CreateActivityInput type CreateActivityInput struct { - // The name of the activity to create. This name must be unique for your AWS - // account and region for 90 days. For more information, see Limits Related to - // State Machine Executions + // The name of the activity to create. This name must be unique for your Amazon Web + // Services account and region for 90 days. For more information, see Limits + // Related to State Machine Executions // (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions) - // in the AWS Step Functions Developer Guide. A name must not contain: + // in the Step Functions Developer Guide. A name must not contain: // // * white // space @@ -70,8 +70,8 @@ type CreateActivityInput struct { // The list of tags to add to a resource. An array of key-value pairs. For more // information, see Using Cost Allocation Tags // (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) - // in the AWS Billing and Cost Management User Guide, and Controlling Access Using - // IAM Tags + // in the Amazon Web Services Billing and Cost Management User Guide, and + // Controlling Access Using IAM Tags // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html). Tags // may only contain Unicode letters, digits, white space, or these symbols: _ . : / // = + - @. diff --git a/service/sfn/api_op_CreateStateMachine.go b/service/sfn/api_op_CreateStateMachine.go index 7270ee6602c..3669dbc50d2 100644 --- a/service/sfn/api_op_CreateStateMachine.go +++ b/service/sfn/api_op_CreateStateMachine.go @@ -18,8 +18,8 @@ import ( // machines are specified using a JSON-based, structured language. For more // information, see Amazon States Language // (https://docs.aws.amazon.com/step-functions/latest/dg/concepts-amazon-states-language.html) -// in the AWS Step Functions User Guide. This operation is eventually consistent. -// The results are best effort and may not reflect very recent updates and changes. +// in the Step Functions User Guide. This operation is eventually consistent. The +// results are best effort and may not reflect very recent updates and changes. // CreateStateMachine is an idempotent API. Subsequent requests won’t create a // duplicate resource if it was already created. CreateStateMachine's idempotency // check is based on the state machine name, definition, type, LoggingConfiguration @@ -80,20 +80,20 @@ type CreateStateMachineInput struct { // Defines what execution history events are logged and where they are logged. By // default, the level is set to OFF. For more information see Log Levels // (https://docs.aws.amazon.com/step-functions/latest/dg/cloudwatch-log-level.html) - // in the AWS Step Functions User Guide. + // in the Step Functions User Guide. LoggingConfiguration *types.LoggingConfiguration // Tags to be added when creating a state machine. An array of key-value pairs. For // more information, see Using Cost Allocation Tags // (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) - // in the AWS Billing and Cost Management User Guide, and Controlling Access Using - // IAM Tags + // in the Amazon Web Services Billing and Cost Management User Guide, and + // Controlling Access Using IAM Tags // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html). Tags // may only contain Unicode letters, digits, white space, or these symbols: _ . : / // = + - @. Tags []types.Tag - // Selects whether AWS X-Ray tracing is enabled. + // Selects whether X-Ray tracing is enabled. TracingConfiguration *types.TracingConfiguration // Determines whether a Standard or Express state machine is created. The default diff --git a/service/sfn/api_op_DeleteStateMachine.go b/service/sfn/api_op_DeleteStateMachine.go index 8f78e12b471..395643b912c 100644 --- a/service/sfn/api_op_DeleteStateMachine.go +++ b/service/sfn/api_op_DeleteStateMachine.go @@ -11,7 +11,7 @@ import ( ) // Deletes a state machine. This is an asynchronous operation: It sets the state -// machine's status to DELETING and begins the deletion process. For EXPRESSstate +// machine's status to DELETING and begins the deletion process. For EXPRESS state // machines, the deletion will happen eventually (usually less than a minute). // Running executions may emit logs after DeleteStateMachine API is called. func (c *Client) DeleteStateMachine(ctx context.Context, params *DeleteStateMachineInput, optFns ...func(*Options)) (*DeleteStateMachineOutput, error) { diff --git a/service/sfn/api_op_DescribeExecution.go b/service/sfn/api_op_DescribeExecution.go index 85393d8a7dc..ae20cd321cd 100644 --- a/service/sfn/api_op_DescribeExecution.go +++ b/service/sfn/api_op_DescribeExecution.go @@ -99,7 +99,7 @@ type DescribeExecutionOutput struct { // If the execution has already ended, the date the execution stopped. StopDate *time.Time - // The AWS X-Ray trace header that was passed to the execution. + // The X-Ray trace header that was passed to the execution. TraceHeader *string // Metadata pertaining to the operation's result. diff --git a/service/sfn/api_op_DescribeStateMachine.go b/service/sfn/api_op_DescribeStateMachine.go index e7b3fa64f49..f51d1dc8f2b 100644 --- a/service/sfn/api_op_DescribeStateMachine.go +++ b/service/sfn/api_op_DescribeStateMachine.go @@ -76,7 +76,7 @@ type DescribeStateMachineOutput struct { // The Amazon Resource Name (ARN) of the IAM role used when creating this state // machine. (The IAM role maintains security by granting Step Functions access to - // AWS resources.) + // Amazon Web Services resources.) // // This member is required. RoleArn *string @@ -97,7 +97,7 @@ type DescribeStateMachineOutput struct { // The current status of the state machine. Status types.StateMachineStatus - // Selects whether AWS X-Ray tracing is enabled. + // Selects whether X-Ray tracing is enabled. TracingConfiguration *types.TracingConfiguration // Metadata pertaining to the operation's result. diff --git a/service/sfn/api_op_DescribeStateMachineForExecution.go b/service/sfn/api_op_DescribeStateMachineForExecution.go index 6853f0f52ff..346e05c2f55 100644 --- a/service/sfn/api_op_DescribeStateMachineForExecution.go +++ b/service/sfn/api_op_DescribeStateMachineForExecution.go @@ -77,7 +77,7 @@ type DescribeStateMachineForExecutionOutput struct { // The LoggingConfiguration data type is used to set CloudWatch Logs options. LoggingConfiguration *types.LoggingConfiguration - // Selects whether AWS X-Ray tracing is enabled. + // Selects whether X-Ray tracing is enabled. TracingConfiguration *types.TracingConfiguration // Metadata pertaining to the operation's result. diff --git a/service/sfn/api_op_GetActivityTask.go b/service/sfn/api_op_GetActivityTask.go index 595cba1453f..bc5dffed1e1 100644 --- a/service/sfn/api_op_GetActivityTask.go +++ b/service/sfn/api_op_GetActivityTask.go @@ -16,10 +16,11 @@ import ( // task becomes available (i.e. an execution of a task of this type is needed.) The // maximum time the service holds on to the request before responding is 60 // seconds. If no task is available within 60 seconds, the poll returns a taskToken -// with a null string. Workers should set their client side socket timeout to at -// least 65 seconds (5 seconds higher than the maximum time the service may hold -// the poll request). Polling with GetActivityTask can cause latency in some -// implementations. See Avoid Latency When Polling for Activity Tasks +// with a null string. This API action isn't logged in CloudTrail. Workers should +// set their client side socket timeout to at least 65 seconds (5 seconds higher +// than the maximum time the service may hold the poll request). Polling with +// GetActivityTask can cause latency in some implementations. See Avoid Latency +// When Polling for Activity Tasks // (https://docs.aws.amazon.com/step-functions/latest/dg/bp-activity-pollers.html) // in the Step Functions Developer Guide. func (c *Client) GetActivityTask(ctx context.Context, params *GetActivityTaskInput, optFns ...func(*Options)) (*GetActivityTaskOutput, error) { diff --git a/service/sfn/api_op_StartExecution.go b/service/sfn/api_op_StartExecution.go index 313cb2fb86d..4b96b3fa0d0 100644 --- a/service/sfn/api_op_StartExecution.go +++ b/service/sfn/api_op_StartExecution.go @@ -11,11 +11,12 @@ import ( "time" ) -// Starts a state machine execution. StartExecution is idempotent. If -// StartExecution is called with the same name and input as a running execution, -// the call will succeed and return the same response as the original request. If -// the execution is closed or if the input is different, it will return a 400 -// ExecutionAlreadyExists error. Names can be reused after 90 days. +// Starts a state machine execution. StartExecution is idempotent for STANDARD +// workflows. For a STANDARD workflow, if StartExecution is called with the same +// name and input as a running execution, the call will succeed and return the same +// response as the original request. If the execution is closed or if the input is +// different, it will return a 400 ExecutionAlreadyExists error. Names can be +// reused after 90 days. StartExecution is not idempotent for EXPRESS workflows. func (c *Client) StartExecution(ctx context.Context, params *StartExecutionInput, optFns ...func(*Options)) (*StartExecutionOutput, error) { if params == nil { params = &StartExecutionInput{} @@ -45,11 +46,11 @@ type StartExecutionInput struct { // encoding. Input *string - // The name of the execution. This name must be unique for your AWS account, - // region, and state machine for 90 days. For more information, see Limits Related - // to State Machine Executions + // The name of the execution. This name must be unique for your Amazon Web Services + // account, region, and state machine for 90 days. For more information, see + // Limits Related to State Machine Executions // (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html#service-limits-state-machine-executions) - // in the AWS Step Functions Developer Guide. A name must not contain: + // in the Step Functions Developer Guide. A name must not contain: // // * white // space @@ -68,7 +69,7 @@ type StartExecutionInput struct { // - and _. Name *string - // Passes the AWS X-Ray trace header. The trace header can also be passed in the + // Passes the X-Ray trace header. The trace header can also be passed in the // request payload. TraceHeader *string diff --git a/service/sfn/api_op_StartSyncExecution.go b/service/sfn/api_op_StartSyncExecution.go index a3eeeac75c9..79cba52cb56 100644 --- a/service/sfn/api_op_StartSyncExecution.go +++ b/service/sfn/api_op_StartSyncExecution.go @@ -13,7 +13,13 @@ import ( "time" ) -// Starts a Synchronous Express state machine execution. +// Starts a Synchronous Express state machine execution. StartSyncExecution is not +// available for STANDARD workflows. StartSyncExecution will return a 200 OK +// response, even if your execution fails, because the status code in the API +// response doesn't reflect function errors. Error codes are reserved for errors +// that prevent your execution from running, such as permissions errors, limit +// errors, or issues with your state machine code and configuration. This API +// action isn't logged in CloudTrail. func (c *Client) StartSyncExecution(ctx context.Context, params *StartSyncExecutionInput, optFns ...func(*Options)) (*StartSyncExecutionOutput, error) { if params == nil { params = &StartSyncExecutionInput{} @@ -46,7 +52,7 @@ type StartSyncExecutionInput struct { // The name of the execution. Name *string - // Passes the AWS X-Ray trace header. The trace header can also be passed in the + // Passes the X-Ray trace header. The trace header can also be passed in the // request payload. TraceHeader *string @@ -107,7 +113,7 @@ type StartSyncExecutionOutput struct { // The Amazon Resource Name (ARN) that identifies the state machine. StateMachineArn *string - // The AWS X-Ray trace header that was passed to the execution. + // The X-Ray trace header that was passed to the execution. TraceHeader *string // Metadata pertaining to the operation's result. diff --git a/service/sfn/api_op_TagResource.go b/service/sfn/api_op_TagResource.go index ffd0d7ec8dc..eaee15fea84 100644 --- a/service/sfn/api_op_TagResource.go +++ b/service/sfn/api_op_TagResource.go @@ -14,8 +14,8 @@ import ( // Add a tag to a Step Functions resource. An array of key-value pairs. For more // information, see Using Cost Allocation Tags // (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// in the AWS Billing and Cost Management User Guide, and Controlling Access Using -// IAM Tags +// in the Amazon Web Services Billing and Cost Management User Guide, and +// Controlling Access Using IAM Tags // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html). Tags // may only contain Unicode letters, digits, white space, or these symbols: _ . : / // = + - @. diff --git a/service/sfn/api_op_UpdateStateMachine.go b/service/sfn/api_op_UpdateStateMachine.go index 2f9ffb4f8b0..9922be1537e 100644 --- a/service/sfn/api_op_UpdateStateMachine.go +++ b/service/sfn/api_op_UpdateStateMachine.go @@ -52,7 +52,7 @@ type UpdateStateMachineInput struct { // The Amazon Resource Name (ARN) of the IAM role of the state machine. RoleArn *string - // Selects whether AWS X-Ray tracing is enabled. + // Selects whether X-Ray tracing is enabled. TracingConfiguration *types.TracingConfiguration noSmithyDocumentSerde diff --git a/service/sfn/deserializers.go b/service/sfn/deserializers.go index 7f80da0ee11..70205bf5918 100644 --- a/service/sfn/deserializers.go +++ b/service/sfn/deserializers.go @@ -5462,6 +5462,11 @@ func awsAwsjson10_deserializeDocumentLambdaFunctionScheduledEventDetails(v **typ sv.Resource = ptr.String(jtv) } + case "taskCredentials": + if err := awsAwsjson10_deserializeDocumentTaskCredentials(&sv.TaskCredentials, value); err != nil { + return err + } + case "timeoutInSeconds": if value != nil { jtv, ok := value.(json.Number) @@ -6485,6 +6490,46 @@ func awsAwsjson10_deserializeDocumentTagList(v *[]types.Tag, value interface{}) return nil } +func awsAwsjson10_deserializeDocumentTaskCredentials(v **types.TaskCredentials, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.TaskCredentials + if *v == nil { + sv = &types.TaskCredentials{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LongArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentTaskDoesNotExist(v **types.TaskDoesNotExist, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6663,6 +6708,11 @@ func awsAwsjson10_deserializeDocumentTaskScheduledEventDetails(v **types.TaskSch sv.ResourceType = ptr.String(jtv) } + case "taskCredentials": + if err := awsAwsjson10_deserializeDocumentTaskCredentials(&sv.TaskCredentials, value); err != nil { + return err + } + case "timeoutInSeconds": if value != nil { jtv, ok := value.(json.Number) diff --git a/service/sfn/doc.go b/service/sfn/doc.go index 6c934b126f5..3f7d10077da 100644 --- a/service/sfn/doc.go +++ b/service/sfn/doc.go @@ -3,7 +3,7 @@ // Package sfn provides the API client, operations, and parameter types for AWS // Step Functions. // -// AWS Step Functions AWS Step Functions is a service that lets you coordinate the +// Step Functions Step Functions is a service that lets you coordinate the // components of distributed applications and microservices using visual workflows. // You can use Step Functions to build applications from individual components, // each of which performs a discrete function, or task, allowing you to scale and @@ -14,8 +14,9 @@ // order every time. Step Functions logs the state of each step, so you can quickly // diagnose and debug any issues. Step Functions manages operations and underlying // infrastructure to ensure your application is available at any scale. You can run -// tasks on AWS, your own servers, or any system that has access to AWS. You can -// access and use Step Functions using the console, the AWS SDKs, or an HTTP API. -// For more information about Step Functions, see the AWS Step Functions Developer -// Guide (https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html) . +// tasks on Amazon Web Services, your own servers, or any system that has access to +// Amazon Web Services. You can access and use Step Functions using the console, +// the Amazon Web Services SDKs, or an HTTP API. For more information about Step +// Functions, see the Step Functions Developer Guide +// (https://docs.aws.amazon.com/step-functions/latest/dg/welcome.html) . package sfn diff --git a/service/sfn/types/errors.go b/service/sfn/types/errors.go index d0229df6748..12138743fb7 100644 --- a/service/sfn/types/errors.go +++ b/service/sfn/types/errors.go @@ -452,8 +452,8 @@ func (e *TaskTimedOut) ErrorCode() string { return "TaskTimedOut" } func (e *TaskTimedOut) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } // You've exceeded the number of tags allowed for a resource. See the Limits Topic -// (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html) in the AWS -// Step Functions Developer Guide. +// (https://docs.aws.amazon.com/step-functions/latest/dg/limits.html) in the Step +// Functions Developer Guide. type TooManyTags struct { Message *string diff --git a/service/sfn/types/types.go b/service/sfn/types/types.go index 6ecc3e85d80..5d48e9a4a4a 100644 --- a/service/sfn/types/types.go +++ b/service/sfn/types/types.go @@ -242,8 +242,7 @@ type ExecutionStartedEventDetails struct { // Contains details about the input for an execution history event. InputDetails *HistoryEventExecutionDataDetails - // The Amazon Resource Name (ARN) of the IAM role used for executing AWS Lambda - // tasks. + // The Amazon Resource Name (ARN) of the IAM role used for executing Lambda tasks. RoleArn *string noSmithyDocumentSerde @@ -327,25 +326,25 @@ type HistoryEvent struct { // Contains details about the execution timeout that occurred during the execution. ExecutionTimedOutEventDetails *ExecutionTimedOutEventDetails - // Contains details about a lambda function that failed during an execution. + // Contains details about a Lambda function that failed during an execution. LambdaFunctionFailedEventDetails *LambdaFunctionFailedEventDetails - // Contains details about a failed lambda function schedule event that occurred + // Contains details about a failed Lambda function schedule event that occurred // during an execution. LambdaFunctionScheduleFailedEventDetails *LambdaFunctionScheduleFailedEventDetails - // Contains details about a lambda function scheduled during an execution. + // Contains details about a Lambda function scheduled during an execution. LambdaFunctionScheduledEventDetails *LambdaFunctionScheduledEventDetails // Contains details about a lambda function that failed to start during an // execution. LambdaFunctionStartFailedEventDetails *LambdaFunctionStartFailedEventDetails - // Contains details about a lambda function that terminated successfully during an + // Contains details about a Lambda function that terminated successfully during an // execution. LambdaFunctionSucceededEventDetails *LambdaFunctionSucceededEventDetails - // Contains details about a lambda function timeout that occurred during an + // Contains details about a Lambda function timeout that occurred during an // execution. LambdaFunctionTimedOutEventDetails *LambdaFunctionTimedOutEventDetails @@ -410,7 +409,7 @@ type HistoryEventExecutionDataDetails struct { noSmithyDocumentSerde } -// Contains details about a lambda function that failed during an execution. +// Contains details about a Lambda function that failed during an execution. type LambdaFunctionFailedEventDetails struct { // A more detailed explanation of the cause of the failure. @@ -422,28 +421,31 @@ type LambdaFunctionFailedEventDetails struct { noSmithyDocumentSerde } -// Contains details about a lambda function scheduled during an execution. +// Contains details about a Lambda function scheduled during an execution. type LambdaFunctionScheduledEventDetails struct { - // The Amazon Resource Name (ARN) of the scheduled lambda function. + // The Amazon Resource Name (ARN) of the scheduled Lambda function. // // This member is required. Resource *string - // The JSON data input to the lambda function. Length constraints apply to the + // The JSON data input to the Lambda function. Length constraints apply to the // payload size, and are expressed as bytes in UTF-8 encoding. Input *string // Contains details about input for an execution history event. InputDetails *HistoryEventExecutionDataDetails - // The maximum allowed duration of the lambda function. + // The credentials that Step Functions uses for the task. + TaskCredentials *TaskCredentials + + // The maximum allowed duration of the Lambda function. TimeoutInSeconds *int64 noSmithyDocumentSerde } -// Contains details about a failed lambda function schedule event that occurred +// Contains details about a failed Lambda function schedule event that occurred // during an execution. type LambdaFunctionScheduleFailedEventDetails struct { @@ -469,11 +471,11 @@ type LambdaFunctionStartFailedEventDetails struct { noSmithyDocumentSerde } -// Contains details about a lambda function that successfully terminated during an +// Contains details about a Lambda function that successfully terminated during an // execution. type LambdaFunctionSucceededEventDetails struct { - // The JSON data output by the lambda function. Length constraints apply to the + // The JSON data output by the Lambda function. Length constraints apply to the // payload size, and are expressed as bytes in UTF-8 encoding. Output *string @@ -483,7 +485,7 @@ type LambdaFunctionSucceededEventDetails struct { noSmithyDocumentSerde } -// Contains details about a lambda function timeout that occurred during an +// Contains details about a Lambda function timeout that occurred during an // execution. type LambdaFunctionTimedOutEventDetails struct { @@ -501,7 +503,7 @@ type LogDestination struct { // An object describing a CloudWatch log group. For more information, see // AWS::Logs::LogGroup // (https://docs.aws.amazon.com/AWSCloudFormation/latest/UserGuide/aws-resource-logs-loggroup.html) - // in the AWS CloudFormation User Guide. + // in the CloudFormation User Guide. CloudWatchLogsLogGroup *CloudWatchLogsLogGroup noSmithyDocumentSerde @@ -642,8 +644,8 @@ type StateMachineListItem struct { // machines and activities. An array of key-value pairs. For more information, see // Using Cost Allocation Tags // (https://docs.aws.amazon.com/awsaccountbilling/latest/aboutv2/cost-alloc-tags.html) -// in the AWS Billing and Cost Management User Guide, and Controlling Access Using -// IAM Tags +// in the Amazon Web Services Billing and Cost Management User Guide, and +// Controlling Access Using IAM Tags // (https://docs.aws.amazon.com/IAM/latest/UserGuide/access_iam-tags.html). Tags // may only contain Unicode letters, digits, white space, or these symbols: _ . : / // = + - @. @@ -658,15 +660,25 @@ type Tag struct { noSmithyDocumentSerde } +// Contains details about the credentials that Step Functions uses for a task. +type TaskCredentials struct { + + // The ARN of an IAM role that Step Functions assumes for the task. The role can + // allow cross-account access to resources. + RoleArn *string + + noSmithyDocumentSerde +} + // Contains details about a task failure event. type TaskFailedEventDetails struct { - // The service name of the resource in a task state. + // The action of the resource called by a task state. // // This member is required. Resource *string - // The action of the resource called by a task state. + // The service name of the resource in a task state. // // This member is required. ResourceType *string @@ -695,12 +707,12 @@ type TaskScheduledEventDetails struct { // This member is required. Region *string - // The service name of the resource in a task state. + // The action of the resource called by a task state. // // This member is required. Resource *string - // The action of the resource called by a task state. + // The service name of the resource in a task state. // // This member is required. ResourceType *string @@ -708,6 +720,9 @@ type TaskScheduledEventDetails struct { // The maximum allowed duration between two heartbeats for the task. HeartbeatInSeconds *int64 + // The credentials that Step Functions uses for the task. + TaskCredentials *TaskCredentials + // The maximum allowed duration of the task. TimeoutInSeconds *int64 @@ -717,12 +732,12 @@ type TaskScheduledEventDetails struct { // Contains details about the start of a task during an execution. type TaskStartedEventDetails struct { - // The service name of the resource in a task state. + // The action of the resource called by a task state. // // This member is required. Resource *string - // The action of the resource called by a task state. + // The service name of the resource in a task state. // // This member is required. ResourceType *string @@ -733,12 +748,12 @@ type TaskStartedEventDetails struct { // Contains details about a task that failed to start during an execution. type TaskStartFailedEventDetails struct { - // The service name of the resource in a task state. + // The action of the resource called by a task state. // // This member is required. Resource *string - // The action of the resource called by a task state. + // The service name of the resource in a task state. // // This member is required. ResourceType *string @@ -755,12 +770,12 @@ type TaskStartFailedEventDetails struct { // Contains details about a task that failed to submit during an execution. type TaskSubmitFailedEventDetails struct { - // The service name of the resource in a task state. + // The action of the resource called by a task state. // // This member is required. Resource *string - // The action of the resource called by a task state. + // The service name of the resource in a task state. // // This member is required. ResourceType *string @@ -777,12 +792,12 @@ type TaskSubmitFailedEventDetails struct { // Contains details about a task submitted to a resource . type TaskSubmittedEventDetails struct { - // The service name of the resource in a task state. + // The action of the resource called by a task state. // // This member is required. Resource *string - // The action of the resource called by a task state. + // The service name of the resource in a task state. // // This member is required. ResourceType *string @@ -800,12 +815,12 @@ type TaskSubmittedEventDetails struct { // Contains details about the successful completion of a task state. type TaskSucceededEventDetails struct { - // The service name of the resource in a task state. + // The action of the resource called by a task state. // // This member is required. Resource *string - // The action of the resource called by a task state. + // The service name of the resource in a task state. // // This member is required. ResourceType *string @@ -824,12 +839,12 @@ type TaskSucceededEventDetails struct { // Contains details about a resource timeout that occurred during an execution. type TaskTimedOutEventDetails struct { - // The service name of the resource in a task state. + // The action of the resource called by a task state. // // This member is required. Resource *string - // The action of the resource called by a task state. + // The service name of the resource in a task state. // // This member is required. ResourceType *string @@ -843,11 +858,11 @@ type TaskTimedOutEventDetails struct { noSmithyDocumentSerde } -// Selects whether or not the state machine's AWS X-Ray tracing is enabled. Default -// is false +// Selects whether or not the state machine's X-Ray tracing is enabled. Default is +// false type TracingConfiguration struct { - // When set to true, AWS X-Ray tracing is enabled. + // When set to true, X-Ray tracing is enabled. Enabled bool noSmithyDocumentSerde diff --git a/service/transfer/api_op_CreateServer.go b/service/transfer/api_op_CreateServer.go index db5500f5807..8046f7f18c0 100644 --- a/service/transfer/api_op_CreateServer.go +++ b/service/transfer/api_op_CreateServer.go @@ -219,9 +219,9 @@ type CreateServerInput struct { Tags []types.Tag // Specifies the workflow ID for the workflow to assign and the execution role - // that's used for executing the workflow. In additon to a workflow to execute when - // a file is uploaded completely, WorkflowDeatails can also contain a workflow ID - // (and execution role) for a workflow to execute on partial upload. A partial + // that's used for executing the workflow. In addition to a workflow to execute + // when a file is uploaded completely, WorkflowDetails can also contain a workflow + // ID (and execution role) for a workflow to execute on partial upload. A partial // upload occurs when a file is open when the session disconnects. WorkflowDetails *types.WorkflowDetails diff --git a/service/transfer/api_op_CreateUser.go b/service/transfer/api_op_CreateUser.go index 971973ac46d..703c4f54d9b 100644 --- a/service/transfer/api_op_CreateUser.go +++ b/service/transfer/api_op_CreateUser.go @@ -111,7 +111,18 @@ type CreateUserInput struct { PosixProfile *types.PosixProfile // The public portion of the Secure Shell (SSH) key used to authenticate the user - // to the server. Transfer Family accepts RSA, ECDSA, and ED25519 keys. + // to the server. The three standard SSH public key format elements are , , and an + // optional , with spaces between each element. Transfer Family accepts RSA, ECDSA, + // and ED25519 keys. + // + // * For RSA keys, the key type is ssh-rsa. + // + // * For ED25519 keys, + // the key type is ssh-ed25519. + // + // * For ECDSA keys, the key type is either + // ecdsa-sha2-nistp256, ecdsa-sha2-nistp384, or ecdsa-sha2-nistp521, depending on + // the size of the key you generated. SshPublicKeyBody *string // Key-value pairs that can be used to group and search for users. Tags are diff --git a/service/transfer/api_op_UpdateServer.go b/service/transfer/api_op_UpdateServer.go index ca5516c43ad..a496cf6bb7b 100644 --- a/service/transfer/api_op_UpdateServer.go +++ b/service/transfer/api_op_UpdateServer.go @@ -198,9 +198,9 @@ type UpdateServerInput struct { SecurityPolicyName *string // Specifies the workflow ID for the workflow to assign and the execution role - // that's used for executing the workflow. In additon to a workflow to execute when - // a file is uploaded completely, WorkflowDeatails can also contain a workflow ID - // (and execution role) for a workflow to execute on partial upload. A partial + // that's used for executing the workflow. In addition to a workflow to execute + // when a file is uploaded completely, WorkflowDetails can also contain a workflow + // ID (and execution role) for a workflow to execute on partial upload. A partial // upload occurs when a file is open when the session disconnects. To remove an // associated workflow from a server, you can provide an empty OnUpload object, as // in the following example. aws transfer update-server --server-id diff --git a/service/transfer/types/enums.go b/service/transfer/types/enums.go index 3fae71cc326..8312af97713 100644 --- a/service/transfer/types/enums.go +++ b/service/transfer/types/enums.go @@ -153,6 +153,7 @@ const ( EncryptionAlgAes128Cbc EncryptionAlg = "AES128_CBC" EncryptionAlgAes192Cbc EncryptionAlg = "AES192_CBC" EncryptionAlgAes256Cbc EncryptionAlg = "AES256_CBC" + EncryptionAlgNone EncryptionAlg = "NONE" ) // Values returns all known values for EncryptionAlg. Note that this can be @@ -163,6 +164,7 @@ func (EncryptionAlg) Values() []EncryptionAlg { "AES128_CBC", "AES192_CBC", "AES256_CBC", + "NONE", } } diff --git a/service/transfer/types/types.go b/service/transfer/types/types.go index be146cb06a3..a436f2bc147 100644 --- a/service/transfer/types/types.go +++ b/service/transfer/types/types.go @@ -15,7 +15,9 @@ type As2ConnectorConfig struct { // Specifies whether the AS2 file is compressed. Compression CompressionEnum - // The algorithm that is used to encrypt the file. + // The algorithm that is used to encrypt the file. You can only specify NONE if the + // URL for your connector uses HTTPS. This ensures that no traffic is sent in clear + // text. EncryptionAlgorithm EncryptionAlg // A unique identifier for the AS2 local profile. @@ -33,7 +35,7 @@ type As2ConnectorConfig struct { MdnResponse MdnResponse // The signing algorithm for the MDN response. If set to DEFAULT (or not set at - // all), the value for SigningAlogorithm is used. + // all), the value for SigningAlgorithm is used. MdnSigningAlgorithm MdnSigningAlg // Used as the Subject HTTP header attribute in AS2 messages that are being sent @@ -638,9 +640,9 @@ type DescribedServer struct { UserCount *int32 // Specifies the workflow ID for the workflow to assign and the execution role - // that's used for executing the workflow. In additon to a workflow to execute when - // a file is uploaded completely, WorkflowDeatails can also contain a workflow ID - // (and execution role) for a workflow to execute on partial upload. A partial + // that's used for executing the workflow. In addition to a workflow to execute + // when a file is uploaded completely, WorkflowDetails can also contain a workflow + // ID (and execution role) for a workflow to execute on partial upload. A partial // upload occurs when a file is open when the session disconnects. WorkflowDetails *WorkflowDetails @@ -1557,9 +1559,9 @@ type UserDetails struct { } // Specifies the workflow ID for the workflow to assign and the execution role -// that's used for executing the workflow. In additon to a workflow to execute when -// a file is uploaded completely, WorkflowDeatails can also contain a workflow ID -// (and execution role) for a workflow to execute on partial upload. A partial +// that's used for executing the workflow. In addition to a workflow to execute +// when a file is uploaded completely, WorkflowDetails can also contain a workflow +// ID (and execution role) for a workflow to execute on partial upload. A partial // upload occurs when a file is open when the session disconnects. type WorkflowDetail struct {