diff --git a/.changelog/0be2e18d09a64785a3beb02a5acba61b.json b/.changelog/0be2e18d09a64785a3beb02a5acba61b.json new file mode 100644 index 00000000000..05657cae8e5 --- /dev/null +++ b/.changelog/0be2e18d09a64785a3beb02a5acba61b.json @@ -0,0 +1,8 @@ +{ + "id": "0be2e18d-09a6-4785-a3be-b02a5acba61b", + "type": "feature", + "description": "Add support for conditional deletes for the S3 DeleteObject and DeleteObjects APIs. Add support for write offset bytes option used to append to objects with the S3 PutObject API.", + "modules": [ + "service/s3" + ] +} \ No newline at end of file diff --git a/.changelog/1f87085fc572456f812a9ba102b8a75d.json b/.changelog/1f87085fc572456f812a9ba102b8a75d.json new file mode 100644 index 00000000000..8eee69b38f6 --- /dev/null +++ b/.changelog/1f87085fc572456f812a9ba102b8a75d.json @@ -0,0 +1,8 @@ +{ + "id": "1f87085f-c572-456f-812a-9ba102b8a75d", + "type": "documentation", + "description": "This feature adds support for enabling zonal shift on cross-zone enabled Application Load Balancer, as well as modifying HTTP request and response headers.", + "modules": [ + "service/elasticloadbalancingv2" + ] +} \ No newline at end of file diff --git a/.changelog/1f955481d9a04a7083dc729fca5f901b.json b/.changelog/1f955481d9a04a7083dc729fca5f901b.json new file mode 100644 index 00000000000..0365cec4945 --- /dev/null +++ b/.changelog/1f955481d9a04a7083dc729fca5f901b.json @@ -0,0 +1,8 @@ +{ + "id": "1f955481-d9a0-4a70-83dc-729fca5f901b", + "type": "feature", + "description": "Adds \"Create field indexes to improve query performance and reduce scan volume\" and \"Transform logs during ingestion\". Updates documentation for \"PutLogEvents with Entity\".", + "modules": [ + "service/cloudwatchlogs" + ] +} \ No newline at end of file diff --git a/.changelog/2171d94173cb4d6cbdff145fe259f6b6.json b/.changelog/2171d94173cb4d6cbdff145fe259f6b6.json new file mode 100644 index 00000000000..c0274f8a55e --- /dev/null +++ b/.changelog/2171d94173cb4d6cbdff145fe259f6b6.json @@ -0,0 +1,8 @@ +{ + "id": "2171d941-73cb-4d6c-bdff-145fe259f6b6", + "type": "feature", + "description": "Add methods that retrieve details about deployed configurations: ListConfigurations, GetConfiguration", + "modules": [ + "service/ssmquicksetup" + ] +} \ No newline at end of file diff --git a/.changelog/30948245ad1941409b58ee9b0aad7f8c.json b/.changelog/30948245ad1941409b58ee9b0aad7f8c.json new file mode 100644 index 00000000000..f86ceb8bf7e --- /dev/null +++ b/.changelog/30948245ad1941409b58ee9b0aad7f8c.json @@ -0,0 +1,8 @@ +{ + "id": "30948245-ad19-4140-9b58-ee9b0aad7f8c", + "type": "feature", + "description": "This release adds support for AWS User Notifications. You can now configure and view notifications from AWS services in a central location using the AWS SDK.", + "modules": [ + "service/notifications" + ] +} \ No newline at end of file diff --git a/.changelog/309b4b89023e4bc18a13729b2a33a1e7.json b/.changelog/309b4b89023e4bc18a13729b2a33a1e7.json new file mode 100644 index 00000000000..7806ab25d29 --- /dev/null +++ b/.changelog/309b4b89023e4bc18a13729b2a33a1e7.json @@ -0,0 +1,8 @@ +{ + "id": "309b4b89-023e-4bc1-8a13-729b2a33a1e7", + "type": "feature", + "description": "Added support to modify the engine type for existing ElastiCache Users and User Groups. Customers can now modify the engine type from redis to valkey.", + "modules": [ + "service/elasticache" + ] +} \ No newline at end of file diff --git a/.changelog/32014052c37248fdb2fb811bbe2895d2.json b/.changelog/32014052c37248fdb2fb811bbe2895d2.json new file mode 100644 index 00000000000..41ce052433d --- /dev/null +++ b/.changelog/32014052c37248fdb2fb811bbe2895d2.json @@ -0,0 +1,8 @@ +{ + "id": "32014052-c372-48fd-b2fb-811bbe2895d2", + "type": "feature", + "description": "This release introduces new APIs for creating and managing CloudTrail Lake dashboards. It also adds support for resource-based policies on CloudTrail EventDataStore and Dashboard resource.", + "modules": [ + "service/cloudtrail" + ] +} \ No newline at end of file diff --git a/.changelog/3d6570fcb1e6459cb32c3337dec51cb6.json b/.changelog/3d6570fcb1e6459cb32c3337dec51cb6.json new file mode 100644 index 00000000000..9b339096fd4 --- /dev/null +++ b/.changelog/3d6570fcb1e6459cb32c3337dec51cb6.json @@ -0,0 +1,8 @@ +{ + "id": "3d6570fc-b1e6-459c-b32c-3337dec51cb6", + "type": "feature", + "description": "Added support for providing high-level overviews of managed nodes and previewing the potential impact of a runbook execution.", + "modules": [ + "service/ssm" + ] +} \ No newline at end of file diff --git a/.changelog/41575353444b40ffbf474f4155544f00.json b/.changelog/41575353444b40ffbf474f4155544f00.json new file mode 100644 index 00000000000..1eba517fac9 --- /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/notifications", + "service/notificationscontacts" + ] +} \ No newline at end of file diff --git a/.changelog/420a7aa7eb0347b08005614f7c261650.json b/.changelog/420a7aa7eb0347b08005614f7c261650.json new file mode 100644 index 00000000000..0243ea699f0 --- /dev/null +++ b/.changelog/420a7aa7eb0347b08005614f7c261650.json @@ -0,0 +1,8 @@ +{ + "id": "420a7aa7-eb03-47b0-8005-614f7c261650", + "type": "feature", + "description": "Application Auto Scaling now supports Predictive Scaling to proactively increase the desired capacity ahead of predicted demand, ensuring improved availability and responsiveness for customers' applications. This feature is currently only made available for Amazon ECS Service scalable targets.", + "modules": [ + "service/applicationautoscaling" + ] +} \ No newline at end of file diff --git a/.changelog/434bb5ba66324d078ec29c1e8a3c5835.json b/.changelog/434bb5ba66324d078ec29c1e8a3c5835.json new file mode 100644 index 00000000000..1e5ad5929ab --- /dev/null +++ b/.changelog/434bb5ba66324d078ec29c1e8a3c5835.json @@ -0,0 +1,8 @@ +{ + "id": "434bb5ba-6632-4d07-8ec2-9c1e8a3c5835", + "type": "feature", + "description": "This release introduces three new APIs that enable you to estimate the cost, coverage, and utilization impact of Savings Plans you plan to purchase. The three APIs are StartCommitmentPurchaseAnalysis, GetCommitmentPurchaseAnalysis, and ListCommitmentPurchaseAnalyses.", + "modules": [ + "service/costexplorer" + ] +} \ No newline at end of file diff --git a/.changelog/45c2adedd18b4c0ca93dd3dadb1586f0.json b/.changelog/45c2adedd18b4c0ca93dd3dadb1586f0.json new file mode 100644 index 00000000000..d862ad93bc5 --- /dev/null +++ b/.changelog/45c2adedd18b4c0ca93dd3dadb1586f0.json @@ -0,0 +1,8 @@ +{ + "id": "45c2aded-d18b-4c0c-a93d-d3dadb1586f0", + "type": "feature", + "description": "General Availability (GA) release of AWS IoT Device Management - Commands, to trigger light-weight remote actions on targeted devices", + "modules": [ + "service/iotjobsdataplane" + ] +} \ No newline at end of file diff --git a/.changelog/5179a79305414693bd438d0107bb626d.json b/.changelog/5179a79305414693bd438d0107bb626d.json new file mode 100644 index 00000000000..293a85aa114 --- /dev/null +++ b/.changelog/5179a79305414693bd438d0107bb626d.json @@ -0,0 +1,8 @@ +{ + "id": "5179a793-0541-4693-bd43-8d0107bb626d", + "type": "feature", + "description": "Added support for custom domain names for private APIs.", + "modules": [ + "service/apigateway" + ] +} \ No newline at end of file diff --git a/.changelog/6d349979e895438fa02678e1c32f7c80.json b/.changelog/6d349979e895438fa02678e1c32f7c80.json new file mode 100644 index 00000000000..a54bd28e6be --- /dev/null +++ b/.changelog/6d349979e895438fa02678e1c32f7c80.json @@ -0,0 +1,8 @@ +{ + "id": "6d349979-e895-438f-a026-78e1c32f7c80", + "type": "feature", + "description": "General Availability (GA) release of AWS IoT Device Management - Commands, to trigger light-weight remote actions on targeted devices", + "modules": [ + "service/iot" + ] +} \ No newline at end of file diff --git a/.changelog/71dccf143d714b66853880862200028b.json b/.changelog/71dccf143d714b66853880862200028b.json new file mode 100644 index 00000000000..abf8223f7b3 --- /dev/null +++ b/.changelog/71dccf143d714b66853880862200028b.json @@ -0,0 +1,8 @@ +{ + "id": "71dccf14-3d71-4b66-8538-80862200028b", + "type": "feature", + "description": "Adds support for metrics for event source mappings for AWS Lambda", + "modules": [ + "service/lambda" + ] +} \ No newline at end of file diff --git a/.changelog/962fc92a79e243da90fc63207b4010d2.json b/.changelog/962fc92a79e243da90fc63207b4010d2.json new file mode 100644 index 00000000000..419828f2ddb --- /dev/null +++ b/.changelog/962fc92a79e243da90fc63207b4010d2.json @@ -0,0 +1,8 @@ +{ + "id": "962fc92a-79e2-43da-90fc-63207b4010d2", + "type": "feature", + "description": "AWS Resilience Hub's new summary view visually represents applications' resilience through charts, enabling efficient resilience management. It provides a consolidated view of the app portfolio's resilience state and allows data export for custom stakeholder reporting.", + "modules": [ + "service/resiliencehub" + ] +} \ No newline at end of file diff --git a/.changelog/a8a21ca92b4c451eadd3591cd4cac009.json b/.changelog/a8a21ca92b4c451eadd3591cd4cac009.json new file mode 100644 index 00000000000..6d40dc8168b --- /dev/null +++ b/.changelog/a8a21ca92b4c451eadd3591cd4cac009.json @@ -0,0 +1,8 @@ +{ + "id": "a8a21ca9-2b4c-451e-add3-591cd4cac009", + "type": "feature", + "description": "Add support for the Amazon Bedrock Runtime.", + "modules": [ + "service/appsync" + ] +} \ No newline at end of file diff --git a/.changelog/b0faa1e9ce5c431da50999321d2d4e55.json b/.changelog/b0faa1e9ce5c431da50999321d2d4e55.json new file mode 100644 index 00000000000..9d4d6ce14ed --- /dev/null +++ b/.changelog/b0faa1e9ce5c431da50999321d2d4e55.json @@ -0,0 +1,8 @@ +{ + "id": "b0faa1e9-ce5c-431d-a509-99321d2d4e55", + "type": "feature", + "description": "This release adds support for AWS User Notifications Contacts. You can now configure and view email contacts for AWS User Notifications using the AWS SDK.", + "modules": [ + "service/notificationscontacts" + ] +} \ No newline at end of file diff --git a/.changelog/b3273f47e54f4616a3331853330ee2cb.json b/.changelog/b3273f47e54f4616a3331853330ee2cb.json new file mode 100644 index 00000000000..56e408f8370 --- /dev/null +++ b/.changelog/b3273f47e54f4616a3331853330ee2cb.json @@ -0,0 +1,8 @@ +{ + "id": "b3273f47-e54f-4616-a333-1853330ee2cb", + "type": "feature", + "description": "AWS IoT FleetWise now includes campaign parameters to store and forward data, configure MQTT topic as a data destination, and collect diagnostic trouble code data. It includes APIs for network agnostic data collection using custom decoding interfaces, and monitoring the last known state of vehicles.", + "modules": [ + "service/iotfleetwise" + ] +} \ No newline at end of file diff --git a/.changelog/bb3caa3ac53e49c0946ab580caed3930.json b/.changelog/bb3caa3ac53e49c0946ab580caed3930.json new file mode 100644 index 00000000000..409ab701547 --- /dev/null +++ b/.changelog/bb3caa3ac53e49c0946ab580caed3930.json @@ -0,0 +1,8 @@ +{ + "id": "bb3caa3a-c53e-49c0-946a-b580caed3930", + "type": "feature", + "description": "Adds support for requesting future-dated Capacity Reservations with a minimum commitment duration, enabling IPAM for organizational units within AWS Organizations, reserving EC2 Capacity Blocks that start in 30 minutes, and extending the end date of existing Capacity Blocks.", + "modules": [ + "service/ec2" + ] +} \ No newline at end of file diff --git a/.changelog/d16eba28a077445888540a834d938871.json b/.changelog/d16eba28a077445888540a834d938871.json new file mode 100644 index 00000000000..1bef0148f2a --- /dev/null +++ b/.changelog/d16eba28a077445888540a834d938871.json @@ -0,0 +1,8 @@ +{ + "id": "d16eba28-a077-4458-8854-0a834d938871", + "type": "feature", + "description": "Adds support for Origin Selection between EMPv2 origins based on media quality score.", + "modules": [ + "service/cloudfront" + ] +} \ No newline at end of file diff --git a/.changelog/d1c63ae2c3834bc49e2f8d3ab3b3c58c.json b/.changelog/d1c63ae2c3834bc49e2f8d3ab3b3c58c.json new file mode 100644 index 00000000000..e6541c32ebc --- /dev/null +++ b/.changelog/d1c63ae2c3834bc49e2f8d3ab3b3c58c.json @@ -0,0 +1,8 @@ +{ + "id": "d1c63ae2-c383-4bc4-9e2f-8d3ab3b3c58c", + "type": "feature", + "description": "AWS X-Ray introduces Transaction Search APIs, enabling span ingestion into CloudWatch Logs for high-scale trace data indexing. These APIs support span-level queries, trace graph generation, and metric correlation for deeper application insights.", + "modules": [ + "service/xray" + ] +} \ No newline at end of file diff --git a/.changelog/f1c93f6a441a4bc3823a2fb24f9f0506.json b/.changelog/f1c93f6a441a4bc3823a2fb24f9f0506.json new file mode 100644 index 00000000000..7a3f7c11960 --- /dev/null +++ b/.changelog/f1c93f6a441a4bc3823a2fb24f9f0506.json @@ -0,0 +1,8 @@ +{ + "id": "f1c93f6a-441a-4bc3-823a-2fb24f9f0506", + "type": "feature", + "description": "Adds metadata property to an AffectedEntity.", + "modules": [ + "service/health" + ] +} \ No newline at end of file diff --git a/service/apigateway/api_op_CreateBasePathMapping.go b/service/apigateway/api_op_CreateBasePathMapping.go index c3493d08d96..4aadb9fd7d0 100644 --- a/service/apigateway/api_op_CreateBasePathMapping.go +++ b/service/apigateway/api_op_CreateBasePathMapping.go @@ -45,6 +45,10 @@ type CreateBasePathMappingInput struct { // name after the domain name. BasePath *string + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + // The name of the API's stage that you want to use for this mapping. Specify // '(none)' if you want callers to explicitly specify the stage name after any base // path name. diff --git a/service/apigateway/api_op_CreateDomainName.go b/service/apigateway/api_op_CreateDomainName.go index fde9e92b08c..ac0e606f81a 100644 --- a/service/apigateway/api_op_CreateDomainName.go +++ b/service/apigateway/api_op_CreateDomainName.go @@ -37,13 +37,13 @@ type CreateDomainNameInput struct { DomainName *string // The reference to an Amazon Web Services-managed certificate that will be used - // by edge-optimized endpoint for this domain name. Certificate Manager is the only - // supported source. + // by edge-optimized endpoint or private endpoint for this domain name. Certificate + // Manager is the only supported source. CertificateArn *string // [Deprecated] The body of the server certificate that will be used by - // edge-optimized endpoint for this domain name provided by your certificate - // authority. + // edge-optimized endpoint or private endpoint for this domain name provided by + // your certificate authority. CertificateBody *string // [Deprecated] The intermediate certificates and optionally the root certificate, @@ -56,7 +56,7 @@ type CreateDomainNameInput struct { CertificateChain *string // The user-friendly name of the certificate that will be used by edge-optimized - // endpoint for this domain name. + // endpoint or private endpoint for this domain name. CertificateName *string // [Deprecated] Your edge-optimized endpoint's domain name certificate's private @@ -77,6 +77,11 @@ type CreateDomainNameInput struct { // imported or private CA certificate ARN as the regionalCertificateArn. OwnershipVerificationCertificateArn *string + // A stringified JSON policy document that applies to the execute-api service for + // this DomainName regardless of the caller and Method configuration. Supported + // only for private custom domain names. + Policy *string + // The reference to an Amazon Web Services-managed certificate that will be used // by regional endpoint for this domain name. Certificate Manager is the only // supported source. @@ -103,17 +108,16 @@ type CreateDomainNameInput struct { type CreateDomainNameOutput struct { // The reference to an Amazon Web Services-managed certificate that will be used - // by edge-optimized endpoint for this domain name. Certificate Manager is the only - // supported source. + // by edge-optimized endpoint or private endpoint for this domain name. Certificate + // Manager is the only supported source. CertificateArn *string - // The name of the certificate that will be used by edge-optimized endpoint for - // this domain name. + // The name of the certificate that will be used by edge-optimized endpoint or + // private endpoint for this domain name. CertificateName *string - // The timestamp when the certificate that was used by edge-optimized endpoint for - // this domain name was uploaded. API Gateway doesn't change this value if you - // update the certificate. + // The timestamp when the certificate that was used by edge-optimized endpoint or + // private endpoint for this domain name was uploaded. CertificateUploadDate *time.Time // The domain name of the Amazon CloudFront distribution associated with this @@ -132,6 +136,13 @@ type CreateDomainNameOutput struct { // The custom domain name as an API host name, for example, my-api.example.com . DomainName *string + // The ARN of the domain name. Supported only for private custom domain names. + DomainNameArn *string + + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + // The status of the DomainName migration. The valid values are AVAILABLE and // UPDATING . If the status is UPDATING , the domain cannot be modified further // until the existing operation is complete. If it is AVAILABLE , the domain can be @@ -146,6 +157,12 @@ type CreateDomainNameOutput struct { // domain name. EndpointConfiguration *types.EndpointConfiguration + // A stringified JSON policy document that applies to the API Gateway Management + // service for this DomainName. This policy document controls access for access + // association sources to create domain name access associations with this + // DomainName. Supported only for private custom domain names. + ManagementPolicy *string + // The mutual TLS authentication configuration for a custom domain name. If // specified, API Gateway performs two-way authentication between the client and // the server. Clients must present a trusted certificate to access your API. @@ -156,6 +173,11 @@ type CreateDomainNameOutput struct { // imported or private CA certificate ARN as the regionalCertificateArn. OwnershipVerificationCertificateArn *string + // A stringified JSON policy document that applies to the execute-api service for + // this DomainName regardless of the caller and Method configuration. Supported + // only for private custom domain names. + Policy *string + // The reference to an Amazon Web Services-managed certificate that will be used // for validating the regional domain name. Certificate Manager is the only // supported source. diff --git a/service/apigateway/api_op_CreateDomainNameAccessAssociation.go b/service/apigateway/api_op_CreateDomainNameAccessAssociation.go new file mode 100644 index 00000000000..338b62e799d --- /dev/null +++ b/service/apigateway/api_op_CreateDomainNameAccessAssociation.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apigateway + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/apigateway/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a domain name access association resource between an access +// +// association source and a private custom domain name. +func (c *Client) CreateDomainNameAccessAssociation(ctx context.Context, params *CreateDomainNameAccessAssociationInput, optFns ...func(*Options)) (*CreateDomainNameAccessAssociationOutput, error) { + if params == nil { + params = &CreateDomainNameAccessAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDomainNameAccessAssociation", params, optFns, c.addOperationCreateDomainNameAccessAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDomainNameAccessAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDomainNameAccessAssociationInput struct { + + // The identifier of the domain name access association source. For a VPCE, the + // value is the VPC endpoint ID. + // + // This member is required. + AccessAssociationSource *string + + // The type of the domain name access association source. + // + // This member is required. + AccessAssociationSourceType types.AccessAssociationSourceType + + // The ARN of the domain name. + // + // This member is required. + DomainNameArn *string + + // The key-value map of strings. The valid character set is [a-zA-Z+-=._:/]. The + // tag key can be up to 128 characters and must not start with aws: . The tag value + // can be up to 256 characters. + Tags map[string]string + + noSmithyDocumentSerde +} + +// Represents a domain name access association between an access association +// source and a private custom domain name. With a domain name access association, +// an access association source can invoke a private custom domain name while +// isolated from the public internet. +type CreateDomainNameAccessAssociationOutput struct { + + // The ARN of the domain name access association source. For a VPCE, the ARN must + // be a VPC endpoint. + AccessAssociationSource *string + + // The type of the domain name access association source. + AccessAssociationSourceType types.AccessAssociationSourceType + + // The ARN of the domain name access association resource. + DomainNameAccessAssociationArn *string + + // The ARN of the domain name. + DomainNameArn *string + + // The collection of tags. Each tag element is associated with a given resource. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDomainNameAccessAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateDomainNameAccessAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateDomainNameAccessAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDomainNameAccessAssociation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDomainNameAccessAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDomainNameAccessAssociation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addAcceptHeader(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDomainNameAccessAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDomainNameAccessAssociation", + } +} diff --git a/service/apigateway/api_op_DeleteBasePathMapping.go b/service/apigateway/api_op_DeleteBasePathMapping.go index 3f215a90f5c..52ae80bac51 100644 --- a/service/apigateway/api_op_DeleteBasePathMapping.go +++ b/service/apigateway/api_op_DeleteBasePathMapping.go @@ -41,6 +41,10 @@ type DeleteBasePathMappingInput struct { // This member is required. DomainName *string + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + noSmithyDocumentSerde } diff --git a/service/apigateway/api_op_DeleteDomainName.go b/service/apigateway/api_op_DeleteDomainName.go index 2a046b16c91..e0267b70ae7 100644 --- a/service/apigateway/api_op_DeleteDomainName.go +++ b/service/apigateway/api_op_DeleteDomainName.go @@ -34,6 +34,10 @@ type DeleteDomainNameInput struct { // This member is required. DomainName *string + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + noSmithyDocumentSerde } diff --git a/service/apigateway/api_op_DeleteDomainNameAccessAssociation.go b/service/apigateway/api_op_DeleteDomainNameAccessAssociation.go new file mode 100644 index 00000000000..a37f219697c --- /dev/null +++ b/service/apigateway/api_op_DeleteDomainNameAccessAssociation.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apigateway + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the DomainNameAccessAssociation resource. +// +// Only the AWS account that created the DomainNameAccessAssociation resource can +// delete it. To stop an access association source in another AWS account from +// accessing your private custom domain name, use the +// RejectDomainNameAccessAssociation operation. +func (c *Client) DeleteDomainNameAccessAssociation(ctx context.Context, params *DeleteDomainNameAccessAssociationInput, optFns ...func(*Options)) (*DeleteDomainNameAccessAssociationOutput, error) { + if params == nil { + params = &DeleteDomainNameAccessAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDomainNameAccessAssociation", params, optFns, c.addOperationDeleteDomainNameAccessAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDomainNameAccessAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDomainNameAccessAssociationInput struct { + + // The ARN of the domain name access association resource. + // + // This member is required. + DomainNameAccessAssociationArn *string + + noSmithyDocumentSerde +} + +type DeleteDomainNameAccessAssociationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDomainNameAccessAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteDomainNameAccessAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteDomainNameAccessAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDomainNameAccessAssociation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDomainNameAccessAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDomainNameAccessAssociation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addAcceptHeader(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDomainNameAccessAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDomainNameAccessAssociation", + } +} diff --git a/service/apigateway/api_op_GetBasePathMapping.go b/service/apigateway/api_op_GetBasePathMapping.go index 8e2633a707f..b085bb99dca 100644 --- a/service/apigateway/api_op_GetBasePathMapping.go +++ b/service/apigateway/api_op_GetBasePathMapping.go @@ -42,6 +42,10 @@ type GetBasePathMappingInput struct { // This member is required. DomainName *string + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + noSmithyDocumentSerde } diff --git a/service/apigateway/api_op_GetBasePathMappings.go b/service/apigateway/api_op_GetBasePathMappings.go index 5bb68dd71c4..bf58096c005 100644 --- a/service/apigateway/api_op_GetBasePathMappings.go +++ b/service/apigateway/api_op_GetBasePathMappings.go @@ -35,6 +35,10 @@ type GetBasePathMappingsInput struct { // This member is required. DomainName *string + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + // The maximum number of returned results per page. The default value is 25 and // the maximum value is 500. Limit *int32 diff --git a/service/apigateway/api_op_GetDomainName.go b/service/apigateway/api_op_GetDomainName.go index d171abe1cde..a695bf0d961 100644 --- a/service/apigateway/api_op_GetDomainName.go +++ b/service/apigateway/api_op_GetDomainName.go @@ -37,6 +37,10 @@ type GetDomainNameInput struct { // This member is required. DomainName *string + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + noSmithyDocumentSerde } @@ -45,17 +49,16 @@ type GetDomainNameInput struct { type GetDomainNameOutput struct { // The reference to an Amazon Web Services-managed certificate that will be used - // by edge-optimized endpoint for this domain name. Certificate Manager is the only - // supported source. + // by edge-optimized endpoint or private endpoint for this domain name. Certificate + // Manager is the only supported source. CertificateArn *string - // The name of the certificate that will be used by edge-optimized endpoint for - // this domain name. + // The name of the certificate that will be used by edge-optimized endpoint or + // private endpoint for this domain name. CertificateName *string - // The timestamp when the certificate that was used by edge-optimized endpoint for - // this domain name was uploaded. API Gateway doesn't change this value if you - // update the certificate. + // The timestamp when the certificate that was used by edge-optimized endpoint or + // private endpoint for this domain name was uploaded. CertificateUploadDate *time.Time // The domain name of the Amazon CloudFront distribution associated with this @@ -74,6 +77,13 @@ type GetDomainNameOutput struct { // The custom domain name as an API host name, for example, my-api.example.com . DomainName *string + // The ARN of the domain name. Supported only for private custom domain names. + DomainNameArn *string + + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + // The status of the DomainName migration. The valid values are AVAILABLE and // UPDATING . If the status is UPDATING , the domain cannot be modified further // until the existing operation is complete. If it is AVAILABLE , the domain can be @@ -88,6 +98,12 @@ type GetDomainNameOutput struct { // domain name. EndpointConfiguration *types.EndpointConfiguration + // A stringified JSON policy document that applies to the API Gateway Management + // service for this DomainName. This policy document controls access for access + // association sources to create domain name access associations with this + // DomainName. Supported only for private custom domain names. + ManagementPolicy *string + // The mutual TLS authentication configuration for a custom domain name. If // specified, API Gateway performs two-way authentication between the client and // the server. Clients must present a trusted certificate to access your API. @@ -98,6 +114,11 @@ type GetDomainNameOutput struct { // imported or private CA certificate ARN as the regionalCertificateArn. OwnershipVerificationCertificateArn *string + // A stringified JSON policy document that applies to the execute-api service for + // this DomainName regardless of the caller and Method configuration. Supported + // only for private custom domain names. + Policy *string + // The reference to an Amazon Web Services-managed certificate that will be used // for validating the regional domain name. Certificate Manager is the only // supported source. diff --git a/service/apigateway/api_op_GetDomainNameAccessAssociations.go b/service/apigateway/api_op_GetDomainNameAccessAssociations.go new file mode 100644 index 00000000000..ff822497d2e --- /dev/null +++ b/service/apigateway/api_op_GetDomainNameAccessAssociations.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apigateway + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/apigateway/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Represents a collection on DomainNameAccessAssociations resources. +func (c *Client) GetDomainNameAccessAssociations(ctx context.Context, params *GetDomainNameAccessAssociationsInput, optFns ...func(*Options)) (*GetDomainNameAccessAssociationsOutput, error) { + if params == nil { + params = &GetDomainNameAccessAssociationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDomainNameAccessAssociations", params, optFns, c.addOperationGetDomainNameAccessAssociationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDomainNameAccessAssociationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDomainNameAccessAssociationsInput struct { + + // The maximum number of returned results per page. The default value is 25 and + // the maximum value is 500. + Limit *int32 + + // The current pagination position in the paged result set. + Position *string + + // The owner of the domain name access association. Use SELF to only list the + // domain name access associations owned by your own account. Use OTHER_ACCOUNTS + // to list the domain name access associations with your private custom domain + // names that are owned by other AWS accounts. + ResourceOwner types.ResourceOwner + + noSmithyDocumentSerde +} + +type GetDomainNameAccessAssociationsOutput struct { + + // The current page of elements from this collection. + Items []types.DomainNameAccessAssociation + + // The current pagination position in the paged result set. + Position *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDomainNameAccessAssociationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetDomainNameAccessAssociations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetDomainNameAccessAssociations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDomainNameAccessAssociations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDomainNameAccessAssociations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addAcceptHeader(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDomainNameAccessAssociations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetDomainNameAccessAssociations", + } +} diff --git a/service/apigateway/api_op_GetDomainNames.go b/service/apigateway/api_op_GetDomainNames.go index 1ad56999c05..9543bb115fa 100644 --- a/service/apigateway/api_op_GetDomainNames.go +++ b/service/apigateway/api_op_GetDomainNames.go @@ -37,6 +37,9 @@ type GetDomainNamesInput struct { // The current pagination position in the paged result set. Position *string + // The owner of the domain name access association. + ResourceOwner types.ResourceOwner + noSmithyDocumentSerde } diff --git a/service/apigateway/api_op_RejectDomainNameAccessAssociation.go b/service/apigateway/api_op_RejectDomainNameAccessAssociation.go new file mode 100644 index 00000000000..4b2b593c192 --- /dev/null +++ b/service/apigateway/api_op_RejectDomainNameAccessAssociation.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package apigateway + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Rejects a domain name access association with a private custom domain name. +// +// To reject a domain name access association with an access association source in +// another AWS account, use this operation. To remove a domain name access +// association with an access association source in your own account, use the +// DeleteDomainNameAccessAssociation operation. +func (c *Client) RejectDomainNameAccessAssociation(ctx context.Context, params *RejectDomainNameAccessAssociationInput, optFns ...func(*Options)) (*RejectDomainNameAccessAssociationOutput, error) { + if params == nil { + params = &RejectDomainNameAccessAssociationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RejectDomainNameAccessAssociation", params, optFns, c.addOperationRejectDomainNameAccessAssociationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RejectDomainNameAccessAssociationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RejectDomainNameAccessAssociationInput struct { + + // The ARN of the domain name access association resource. + // + // This member is required. + DomainNameAccessAssociationArn *string + + // The ARN of the domain name. + // + // This member is required. + DomainNameArn *string + + noSmithyDocumentSerde +} + +type RejectDomainNameAccessAssociationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRejectDomainNameAccessAssociationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpRejectDomainNameAccessAssociation{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRejectDomainNameAccessAssociation{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RejectDomainNameAccessAssociation"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRejectDomainNameAccessAssociationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRejectDomainNameAccessAssociation(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addAcceptHeader(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRejectDomainNameAccessAssociation(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RejectDomainNameAccessAssociation", + } +} diff --git a/service/apigateway/api_op_UpdateBasePathMapping.go b/service/apigateway/api_op_UpdateBasePathMapping.go index d5ebf43f407..dc3871a02b0 100644 --- a/service/apigateway/api_op_UpdateBasePathMapping.go +++ b/service/apigateway/api_op_UpdateBasePathMapping.go @@ -42,6 +42,10 @@ type UpdateBasePathMappingInput struct { // This member is required. DomainName *string + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + // For more information about supported patch operations, see [Patch Operations]. // // [Patch Operations]: https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html diff --git a/service/apigateway/api_op_UpdateDomainName.go b/service/apigateway/api_op_UpdateDomainName.go index a014daa7135..25b1b453f9f 100644 --- a/service/apigateway/api_op_UpdateDomainName.go +++ b/service/apigateway/api_op_UpdateDomainName.go @@ -36,6 +36,10 @@ type UpdateDomainNameInput struct { // This member is required. DomainName *string + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + // For more information about supported patch operations, see [Patch Operations]. // // [Patch Operations]: https://docs.aws.amazon.com/apigateway/latest/api/patch-operations.html @@ -49,17 +53,16 @@ type UpdateDomainNameInput struct { type UpdateDomainNameOutput struct { // The reference to an Amazon Web Services-managed certificate that will be used - // by edge-optimized endpoint for this domain name. Certificate Manager is the only - // supported source. + // by edge-optimized endpoint or private endpoint for this domain name. Certificate + // Manager is the only supported source. CertificateArn *string - // The name of the certificate that will be used by edge-optimized endpoint for - // this domain name. + // The name of the certificate that will be used by edge-optimized endpoint or + // private endpoint for this domain name. CertificateName *string - // The timestamp when the certificate that was used by edge-optimized endpoint for - // this domain name was uploaded. API Gateway doesn't change this value if you - // update the certificate. + // The timestamp when the certificate that was used by edge-optimized endpoint or + // private endpoint for this domain name was uploaded. CertificateUploadDate *time.Time // The domain name of the Amazon CloudFront distribution associated with this @@ -78,6 +81,13 @@ type UpdateDomainNameOutput struct { // The custom domain name as an API host name, for example, my-api.example.com . DomainName *string + // The ARN of the domain name. Supported only for private custom domain names. + DomainNameArn *string + + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + // The status of the DomainName migration. The valid values are AVAILABLE and // UPDATING . If the status is UPDATING , the domain cannot be modified further // until the existing operation is complete. If it is AVAILABLE , the domain can be @@ -92,6 +102,12 @@ type UpdateDomainNameOutput struct { // domain name. EndpointConfiguration *types.EndpointConfiguration + // A stringified JSON policy document that applies to the API Gateway Management + // service for this DomainName. This policy document controls access for access + // association sources to create domain name access associations with this + // DomainName. Supported only for private custom domain names. + ManagementPolicy *string + // The mutual TLS authentication configuration for a custom domain name. If // specified, API Gateway performs two-way authentication between the client and // the server. Clients must present a trusted certificate to access your API. @@ -102,6 +118,11 @@ type UpdateDomainNameOutput struct { // imported or private CA certificate ARN as the regionalCertificateArn. OwnershipVerificationCertificateArn *string + // A stringified JSON policy document that applies to the execute-api service for + // this DomainName regardless of the caller and Method configuration. Supported + // only for private custom domain names. + Policy *string + // The reference to an Amazon Web Services-managed certificate that will be used // for validating the regional domain name. Certificate Manager is the only // supported source. diff --git a/service/apigateway/deserializers.go b/service/apigateway/deserializers.go index 5bdb50df963..308a997f04d 100644 --- a/service/apigateway/deserializers.go +++ b/service/apigateway/deserializers.go @@ -1526,6 +1526,24 @@ func awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(v **CreateDomainNa sv.DomainName = ptr.String(jtv) } + case "domainNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameArn = ptr.String(jtv) + } + + case "domainNameId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameId = ptr.String(jtv) + } + case "domainNameStatus": if value != nil { jtv, ok := value.(string) @@ -1549,6 +1567,15 @@ func awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(v **CreateDomainNa return err } + case "managementPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagementPolicy = ptr.String(jtv) + } + case "mutualTlsAuthentication": if err := awsRestjson1_deserializeDocumentMutualTlsAuthentication(&sv.MutualTlsAuthentication, value); err != nil { return err @@ -1563,6 +1590,15 @@ func awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(v **CreateDomainNa sv.OwnershipVerificationCertificateArn = ptr.String(jtv) } + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + case "regionalCertificateArn": if value != nil { jtv, ok := value.(string) @@ -1622,6 +1658,206 @@ func awsRestjson1_deserializeOpDocumentCreateDomainNameOutput(v **CreateDomainNa return nil } +type awsRestjson1_deserializeOpCreateDomainNameAccessAssociation struct { +} + +func (*awsRestjson1_deserializeOpCreateDomainNameAccessAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateDomainNameAccessAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateDomainNameAccessAssociation(response, &metadata) + } + output := &CreateDomainNameAccessAssociationOutput{} + 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_deserializeOpDocumentCreateDomainNameAccessAssociationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateDomainNameAccessAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentCreateDomainNameAccessAssociationOutput(v **CreateDomainNameAccessAssociationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateDomainNameAccessAssociationOutput + if *v == nil { + sv = &CreateDomainNameAccessAssociationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessAssociationSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccessAssociationSource = ptr.String(jtv) + } + + case "accessAssociationSourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessAssociationSourceType to be of type string, got %T instead", value) + } + sv.AccessAssociationSourceType = types.AccessAssociationSourceType(jtv) + } + + case "domainNameAccessAssociationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameAccessAssociationArn = ptr.String(jtv) + } + + case "domainNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameArn = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentMapOfStringToString(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateModel struct { } @@ -4300,6 +4536,112 @@ func awsRestjson1_deserializeOpErrorDeleteDomainName(response *smithyhttp.Respon } } +type awsRestjson1_deserializeOpDeleteDomainNameAccessAssociation struct { +} + +func (*awsRestjson1_deserializeOpDeleteDomainNameAccessAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDomainNameAccessAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteDomainNameAccessAssociation(response, &metadata) + } + output := &DeleteDomainNameAccessAssociationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteDomainNameAccessAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpDeleteGatewayResponse struct { } @@ -9174,6 +9516,24 @@ func awsRestjson1_deserializeOpDocumentGetDomainNameOutput(v **GetDomainNameOutp sv.DomainName = ptr.String(jtv) } + case "domainNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameArn = ptr.String(jtv) + } + + case "domainNameId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameId = ptr.String(jtv) + } + case "domainNameStatus": if value != nil { jtv, ok := value.(string) @@ -9197,6 +9557,15 @@ func awsRestjson1_deserializeOpDocumentGetDomainNameOutput(v **GetDomainNameOutp return err } + case "managementPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagementPolicy = ptr.String(jtv) + } + case "mutualTlsAuthentication": if err := awsRestjson1_deserializeDocumentMutualTlsAuthentication(&sv.MutualTlsAuthentication, value); err != nil { return err @@ -9211,6 +9580,15 @@ func awsRestjson1_deserializeOpDocumentGetDomainNameOutput(v **GetDomainNameOutp sv.OwnershipVerificationCertificateArn = ptr.String(jtv) } + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + case "regionalCertificateArn": if value != nil { jtv, ok := value.(string) @@ -9253,12 +9631,182 @@ func awsRestjson1_deserializeOpDocumentGetDomainNameOutput(v **GetDomainNameOutp if !ok { return fmt.Errorf("expected SecurityPolicy to be of type string, got %T instead", value) } - sv.SecurityPolicy = types.SecurityPolicy(jtv) - } - - case "tags": - if err := awsRestjson1_deserializeDocumentMapOfStringToString(&sv.Tags, value); err != nil { - return err + sv.SecurityPolicy = types.SecurityPolicy(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentMapOfStringToString(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetDomainNameAccessAssociations struct { +} + +func (*awsRestjson1_deserializeOpGetDomainNameAccessAssociations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetDomainNameAccessAssociations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetDomainNameAccessAssociations(response, &metadata) + } + output := &GetDomainNameAccessAssociationsOutput{} + 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_deserializeOpDocumentGetDomainNameAccessAssociationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetDomainNameAccessAssociations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetDomainNameAccessAssociationsOutput(v **GetDomainNameAccessAssociationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDomainNameAccessAssociationsOutput + if *v == nil { + sv = &GetDomainNameAccessAssociationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "item": + if err := awsRestjson1_deserializeDocumentListOfDomainNameAccessAssociation(&sv.Items, value); err != nil { + return err + } + + case "position": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Position = ptr.String(jtv) } default: @@ -17007,6 +17555,112 @@ func awsRestjson1_deserializeOpDocumentPutRestApiOutput(v **PutRestApiOutput, va return nil } +type awsRestjson1_deserializeOpRejectDomainNameAccessAssociation struct { +} + +func (*awsRestjson1_deserializeOpRejectDomainNameAccessAssociation) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRejectDomainNameAccessAssociation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorRejectDomainNameAccessAssociation(response, &metadata) + } + output := &RejectDomainNameAccessAssociationOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRejectDomainNameAccessAssociation(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("BadRequestException", errorCode): + return awsRestjson1_deserializeErrorBadRequestException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("NotFoundException", errorCode): + return awsRestjson1_deserializeErrorNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyRequestsException", errorCode): + return awsRestjson1_deserializeErrorTooManyRequestsException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpTagResource struct { } @@ -19568,6 +20222,24 @@ func awsRestjson1_deserializeOpDocumentUpdateDomainNameOutput(v **UpdateDomainNa sv.DomainName = ptr.String(jtv) } + case "domainNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameArn = ptr.String(jtv) + } + + case "domainNameId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameId = ptr.String(jtv) + } + case "domainNameStatus": if value != nil { jtv, ok := value.(string) @@ -19591,6 +20263,15 @@ func awsRestjson1_deserializeOpDocumentUpdateDomainNameOutput(v **UpdateDomainNa return err } + case "managementPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagementPolicy = ptr.String(jtv) + } + case "mutualTlsAuthentication": if err := awsRestjson1_deserializeDocumentMutualTlsAuthentication(&sv.MutualTlsAuthentication, value); err != nil { return err @@ -19605,6 +20286,15 @@ func awsRestjson1_deserializeOpDocumentUpdateDomainNameOutput(v **UpdateDomainNa sv.OwnershipVerificationCertificateArn = ptr.String(jtv) } + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + case "regionalCertificateArn": if value != nil { jtv, ok := value.(string) @@ -23917,6 +24607,24 @@ func awsRestjson1_deserializeDocumentDomainName(v **types.DomainName, value inte sv.DomainName = ptr.String(jtv) } + case "domainNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameArn = ptr.String(jtv) + } + + case "domainNameId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameId = ptr.String(jtv) + } + case "domainNameStatus": if value != nil { jtv, ok := value.(string) @@ -23940,6 +24648,15 @@ func awsRestjson1_deserializeDocumentDomainName(v **types.DomainName, value inte return err } + case "managementPolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagementPolicy = ptr.String(jtv) + } + case "mutualTlsAuthentication": if err := awsRestjson1_deserializeDocumentMutualTlsAuthentication(&sv.MutualTlsAuthentication, value); err != nil { return err @@ -23954,6 +24671,15 @@ func awsRestjson1_deserializeDocumentDomainName(v **types.DomainName, value inte sv.OwnershipVerificationCertificateArn = ptr.String(jtv) } + case "policy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Policy = ptr.String(jtv) + } + case "regionalCertificateArn": if value != nil { jtv, ok := value.(string) @@ -24013,6 +24739,78 @@ func awsRestjson1_deserializeDocumentDomainName(v **types.DomainName, value inte return nil } +func awsRestjson1_deserializeDocumentDomainNameAccessAssociation(v **types.DomainNameAccessAssociation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DomainNameAccessAssociation + if *v == nil { + sv = &types.DomainNameAccessAssociation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "accessAssociationSource": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccessAssociationSource = ptr.String(jtv) + } + + case "accessAssociationSourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccessAssociationSourceType to be of type string, got %T instead", value) + } + sv.AccessAssociationSourceType = types.AccessAssociationSourceType(jtv) + } + + case "domainNameAccessAssociationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameAccessAssociationArn = ptr.String(jtv) + } + + case "domainNameArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DomainNameArn = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentMapOfStringToString(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentEndpointConfiguration(v **types.EndpointConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -24731,6 +25529,40 @@ func awsRestjson1_deserializeDocumentListOfDomainName(v *[]types.DomainName, val return nil } +func awsRestjson1_deserializeDocumentListOfDomainNameAccessAssociation(v *[]types.DomainNameAccessAssociation, 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.DomainNameAccessAssociation + if *v == nil { + cv = []types.DomainNameAccessAssociation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DomainNameAccessAssociation + destAddr := &col + if err := awsRestjson1_deserializeDocumentDomainNameAccessAssociation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentListOfEndpointType(v *[]types.EndpointType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/apigateway/generated.json b/service/apigateway/generated.json index 44589cfac69..c34060f481c 100644 --- a/service/apigateway/generated.json +++ b/service/apigateway/generated.json @@ -15,6 +15,7 @@ "api_op_CreateDocumentationPart.go", "api_op_CreateDocumentationVersion.go", "api_op_CreateDomainName.go", + "api_op_CreateDomainNameAccessAssociation.go", "api_op_CreateModel.go", "api_op_CreateRequestValidator.go", "api_op_CreateResource.go", @@ -31,6 +32,7 @@ "api_op_DeleteDocumentationPart.go", "api_op_DeleteDocumentationVersion.go", "api_op_DeleteDomainName.go", + "api_op_DeleteDomainNameAccessAssociation.go", "api_op_DeleteGatewayResponse.go", "api_op_DeleteIntegration.go", "api_op_DeleteIntegrationResponse.go", @@ -63,6 +65,7 @@ "api_op_GetDocumentationVersion.go", "api_op_GetDocumentationVersions.go", "api_op_GetDomainName.go", + "api_op_GetDomainNameAccessAssociations.go", "api_op_GetDomainNames.go", "api_op_GetExport.go", "api_op_GetGatewayResponse.go", @@ -102,6 +105,7 @@ "api_op_PutMethod.go", "api_op_PutMethodResponse.go", "api_op_PutRestApi.go", + "api_op_RejectDomainNameAccessAssociation.go", "api_op_TagResource.go", "api_op_TestInvokeAuthorizer.go", "api_op_TestInvokeMethod.go", diff --git a/service/apigateway/serializers.go b/service/apigateway/serializers.go index ecdcf4252af..d2c12513aa3 100644 --- a/service/apigateway/serializers.go +++ b/service/apigateway/serializers.go @@ -351,6 +351,10 @@ func awsRestjson1_serializeOpHttpBindingsCreateBasePathMappingInput(v *CreateBas } } + if v.DomainNameId != nil { + encoder.SetQuery("domainNameId").String(*v.DomainNameId) + } + return nil } @@ -836,6 +840,11 @@ func awsRestjson1_serializeOpDocumentCreateDomainNameInput(v *CreateDomainNameIn ok.String(*v.OwnershipVerificationCertificateArn) } + if v.Policy != nil { + ok := object.Key("policy") + ok.String(*v.Policy) + } + if v.RegionalCertificateArn != nil { ok := object.Key("regionalCertificateArn") ok.String(*v.RegionalCertificateArn) @@ -861,6 +870,104 @@ func awsRestjson1_serializeOpDocumentCreateDomainNameInput(v *CreateDomainNameIn return nil } +type awsRestjson1_serializeOpCreateDomainNameAccessAssociation struct { +} + +func (*awsRestjson1_serializeOpCreateDomainNameAccessAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateDomainNameAccessAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDomainNameAccessAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domainnameaccessassociations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateDomainNameAccessAssociationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateDomainNameAccessAssociationInput(v *CreateDomainNameAccessAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateDomainNameAccessAssociationInput(v *CreateDomainNameAccessAssociationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccessAssociationSource != nil { + ok := object.Key("accessAssociationSource") + ok.String(*v.AccessAssociationSource) + } + + if len(v.AccessAssociationSourceType) > 0 { + ok := object.Key("accessAssociationSourceType") + ok.String(string(v.AccessAssociationSourceType)) + } + + if v.DomainNameArn != nil { + ok := object.Key("domainNameArn") + ok.String(*v.DomainNameArn) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentMapOfStringToString(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateModel struct { } @@ -2000,6 +2107,10 @@ func awsRestjson1_serializeOpHttpBindingsDeleteBasePathMappingInput(v *DeleteBas } } + if v.DomainNameId != nil { + encoder.SetQuery("domainNameId").String(*v.DomainNameId) + } + return nil } @@ -2382,6 +2493,81 @@ func awsRestjson1_serializeOpHttpBindingsDeleteDomainNameInput(v *DeleteDomainNa } } + if v.DomainNameId != nil { + encoder.SetQuery("domainNameId").String(*v.DomainNameId) + } + + return nil +} + +type awsRestjson1_serializeOpDeleteDomainNameAccessAssociation struct { +} + +func (*awsRestjson1_serializeOpDeleteDomainNameAccessAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteDomainNameAccessAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDomainNameAccessAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domainnameaccessassociations/{domainNameAccessAssociationArn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteDomainNameAccessAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteDomainNameAccessAssociationInput(v *DeleteDomainNameAccessAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainNameAccessAssociationArn == nil || len(*v.DomainNameAccessAssociationArn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member domainNameAccessAssociationArn must not be empty")} + } + if v.DomainNameAccessAssociationArn != nil { + if err := encoder.SetURI("domainNameAccessAssociationArn").String(*v.DomainNameAccessAssociationArn); err != nil { + return err + } + } + return nil } @@ -4151,6 +4337,10 @@ func awsRestjson1_serializeOpHttpBindingsGetBasePathMappingInput(v *GetBasePathM } } + if v.DomainNameId != nil { + encoder.SetQuery("domainNameId").String(*v.DomainNameId) + } + return nil } @@ -4222,6 +4412,10 @@ func awsRestjson1_serializeOpHttpBindingsGetBasePathMappingsInput(v *GetBasePath } } + if v.DomainNameId != nil { + encoder.SetQuery("domainNameId").String(*v.DomainNameId) + } + if v.Limit != nil { encoder.SetQuery("limit").Integer(*v.Limit) } @@ -4941,6 +5135,84 @@ func awsRestjson1_serializeOpHttpBindingsGetDomainNameInput(v *GetDomainNameInpu } } + if v.DomainNameId != nil { + encoder.SetQuery("domainNameId").String(*v.DomainNameId) + } + + return nil +} + +type awsRestjson1_serializeOpGetDomainNameAccessAssociations struct { +} + +func (*awsRestjson1_serializeOpGetDomainNameAccessAssociations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetDomainNameAccessAssociations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDomainNameAccessAssociationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/domainnameaccessassociations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetDomainNameAccessAssociationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetDomainNameAccessAssociationsInput(v *GetDomainNameAccessAssociationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Limit != nil { + encoder.SetQuery("limit").Integer(*v.Limit) + } + + if v.Position != nil { + encoder.SetQuery("position").String(*v.Position) + } + + if len(v.ResourceOwner) > 0 { + encoder.SetQuery("resourceOwner").String(string(v.ResourceOwner)) + } + return nil } @@ -5011,6 +5283,10 @@ func awsRestjson1_serializeOpHttpBindingsGetDomainNamesInput(v *GetDomainNamesIn encoder.SetQuery("position").String(*v.Position) } + if len(v.ResourceOwner) > 0 { + encoder.SetQuery("resourceOwner").String(string(v.ResourceOwner)) + } + return nil } @@ -8462,6 +8738,76 @@ func awsRestjson1_serializeOpHttpBindingsPutRestApiInput(v *PutRestApiInput, enc return nil } +type awsRestjson1_serializeOpRejectDomainNameAccessAssociation struct { +} + +func (*awsRestjson1_serializeOpRejectDomainNameAccessAssociation) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRejectDomainNameAccessAssociation) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RejectDomainNameAccessAssociationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/rejectdomainnameaccessassociations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsRejectDomainNameAccessAssociationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsRejectDomainNameAccessAssociationInput(v *RejectDomainNameAccessAssociationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.DomainNameAccessAssociationArn != nil { + encoder.SetQuery("domainNameAccessAssociationArn").String(*v.DomainNameAccessAssociationArn) + } + + if v.DomainNameArn != nil { + encoder.SetQuery("domainNameArn").String(*v.DomainNameArn) + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } @@ -9286,6 +9632,10 @@ func awsRestjson1_serializeOpHttpBindingsUpdateBasePathMappingInput(v *UpdateBas } } + if v.DomainNameId != nil { + encoder.SetQuery("domainNameId").String(*v.DomainNameId) + } + return nil } @@ -9793,6 +10143,10 @@ func awsRestjson1_serializeOpHttpBindingsUpdateDomainNameInput(v *UpdateDomainNa } } + if v.DomainNameId != nil { + encoder.SetQuery("domainNameId").String(*v.DomainNameId) + } + return nil } diff --git a/service/apigateway/snapshot/api_op_CreateDomainNameAccessAssociation.go.snap b/service/apigateway/snapshot/api_op_CreateDomainNameAccessAssociation.go.snap new file mode 100644 index 00000000000..78d5d274326 --- /dev/null +++ b/service/apigateway/snapshot/api_op_CreateDomainNameAccessAssociation.go.snap @@ -0,0 +1,42 @@ +CreateDomainNameAccessAssociation + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + APIGATEWAY:AcceptHeader + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/apigateway/snapshot/api_op_DeleteDomainNameAccessAssociation.go.snap b/service/apigateway/snapshot/api_op_DeleteDomainNameAccessAssociation.go.snap new file mode 100644 index 00000000000..ad9dfae2ea4 --- /dev/null +++ b/service/apigateway/snapshot/api_op_DeleteDomainNameAccessAssociation.go.snap @@ -0,0 +1,42 @@ +DeleteDomainNameAccessAssociation + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + APIGATEWAY:AcceptHeader + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/apigateway/snapshot/api_op_GetDomainNameAccessAssociations.go.snap b/service/apigateway/snapshot/api_op_GetDomainNameAccessAssociations.go.snap new file mode 100644 index 00000000000..a3d54b2db07 --- /dev/null +++ b/service/apigateway/snapshot/api_op_GetDomainNameAccessAssociations.go.snap @@ -0,0 +1,41 @@ +GetDomainNameAccessAssociations + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + APIGATEWAY:AcceptHeader + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/apigateway/snapshot/api_op_RejectDomainNameAccessAssociation.go.snap b/service/apigateway/snapshot/api_op_RejectDomainNameAccessAssociation.go.snap new file mode 100644 index 00000000000..a8f79a971c7 --- /dev/null +++ b/service/apigateway/snapshot/api_op_RejectDomainNameAccessAssociation.go.snap @@ -0,0 +1,42 @@ +RejectDomainNameAccessAssociation + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + APIGATEWAY:AcceptHeader + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/apigateway/snapshot_test.go b/service/apigateway/snapshot_test.go index b556f2aff65..e78d6df3309 100644 --- a/service/apigateway/snapshot_test.go +++ b/service/apigateway/snapshot_test.go @@ -146,6 +146,18 @@ func TestCheckSnapshot_CreateDomainName(t *testing.T) { } } +func TestCheckSnapshot_CreateDomainNameAccessAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateDomainNameAccessAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateDomainNameAccessAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateModel(t *testing.T) { svc := New(Options{}) _, err := svc.CreateModel(context.Background(), nil, func(o *Options) { @@ -338,6 +350,18 @@ func TestCheckSnapshot_DeleteDomainName(t *testing.T) { } } +func TestCheckSnapshot_DeleteDomainNameAccessAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteDomainNameAccessAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteDomainNameAccessAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteGatewayResponse(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteGatewayResponse(context.Background(), nil, func(o *Options) { @@ -722,6 +746,18 @@ func TestCheckSnapshot_GetDomainName(t *testing.T) { } } +func TestCheckSnapshot_GetDomainNameAccessAssociations(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetDomainNameAccessAssociations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetDomainNameAccessAssociations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetDomainNames(t *testing.T) { svc := New(Options{}) _, err := svc.GetDomainNames(context.Background(), nil, func(o *Options) { @@ -1190,6 +1226,18 @@ func TestCheckSnapshot_PutRestApi(t *testing.T) { } } +func TestCheckSnapshot_RejectDomainNameAccessAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.RejectDomainNameAccessAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "RejectDomainNameAccessAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_TagResource(t *testing.T) { svc := New(Options{}) _, err := svc.TagResource(context.Background(), nil, func(o *Options) { @@ -1585,6 +1633,18 @@ func TestUpdateSnapshot_CreateDomainName(t *testing.T) { } } +func TestUpdateSnapshot_CreateDomainNameAccessAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateDomainNameAccessAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateDomainNameAccessAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateModel(t *testing.T) { svc := New(Options{}) _, err := svc.CreateModel(context.Background(), nil, func(o *Options) { @@ -1777,6 +1837,18 @@ func TestUpdateSnapshot_DeleteDomainName(t *testing.T) { } } +func TestUpdateSnapshot_DeleteDomainNameAccessAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteDomainNameAccessAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteDomainNameAccessAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteGatewayResponse(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteGatewayResponse(context.Background(), nil, func(o *Options) { @@ -2161,6 +2233,18 @@ func TestUpdateSnapshot_GetDomainName(t *testing.T) { } } +func TestUpdateSnapshot_GetDomainNameAccessAssociations(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetDomainNameAccessAssociations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetDomainNameAccessAssociations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetDomainNames(t *testing.T) { svc := New(Options{}) _, err := svc.GetDomainNames(context.Background(), nil, func(o *Options) { @@ -2629,6 +2713,18 @@ func TestUpdateSnapshot_PutRestApi(t *testing.T) { } } +func TestUpdateSnapshot_RejectDomainNameAccessAssociation(t *testing.T) { + svc := New(Options{}) + _, err := svc.RejectDomainNameAccessAssociation(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "RejectDomainNameAccessAssociation") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_TagResource(t *testing.T) { svc := New(Options{}) _, err := svc.TagResource(context.Background(), nil, func(o *Options) { diff --git a/service/apigateway/types/enums.go b/service/apigateway/types/enums.go index d52981ab810..63c0215392f 100644 --- a/service/apigateway/types/enums.go +++ b/service/apigateway/types/enums.go @@ -2,6 +2,23 @@ package types +type AccessAssociationSourceType string + +// Enum values for AccessAssociationSourceType +const ( + AccessAssociationSourceTypeVpce AccessAssociationSourceType = "VPCE" +) + +// Values returns all known values for AccessAssociationSourceType. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AccessAssociationSourceType) Values() []AccessAssociationSourceType { + return []AccessAssociationSourceType{ + "VPCE", + } +} + type ApiKeysFormat string // Enum values for ApiKeysFormat @@ -406,6 +423,25 @@ func (QuotaPeriodType) Values() []QuotaPeriodType { } } +type ResourceOwner string + +// Enum values for ResourceOwner +const ( + ResourceOwnerSelf ResourceOwner = "SELF" + ResourceOwnerOtherAccounts ResourceOwner = "OTHER_ACCOUNTS" +) + +// Values returns all known values for ResourceOwner. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ResourceOwner) Values() []ResourceOwner { + return []ResourceOwner{ + "SELF", + "OTHER_ACCOUNTS", + } +} + type SecurityPolicy string // Enum values for SecurityPolicy diff --git a/service/apigateway/types/types.go b/service/apigateway/types/types.go index 03db187d01a..3faf4a79a13 100644 --- a/service/apigateway/types/types.go +++ b/service/apigateway/types/types.go @@ -357,17 +357,16 @@ type DocumentationVersion struct { type DomainName struct { // The reference to an Amazon Web Services-managed certificate that will be used - // by edge-optimized endpoint for this domain name. Certificate Manager is the only - // supported source. + // by edge-optimized endpoint or private endpoint for this domain name. Certificate + // Manager is the only supported source. CertificateArn *string - // The name of the certificate that will be used by edge-optimized endpoint for - // this domain name. + // The name of the certificate that will be used by edge-optimized endpoint or + // private endpoint for this domain name. CertificateName *string - // The timestamp when the certificate that was used by edge-optimized endpoint for - // this domain name was uploaded. API Gateway doesn't change this value if you - // update the certificate. + // The timestamp when the certificate that was used by edge-optimized endpoint or + // private endpoint for this domain name was uploaded. CertificateUploadDate *time.Time // The domain name of the Amazon CloudFront distribution associated with this @@ -386,6 +385,13 @@ type DomainName struct { // The custom domain name as an API host name, for example, my-api.example.com . DomainName *string + // The ARN of the domain name. Supported only for private custom domain names. + DomainNameArn *string + + // The identifier for the domain name resource. Supported only for private custom + // domain names. + DomainNameId *string + // The status of the DomainName migration. The valid values are AVAILABLE and // UPDATING . If the status is UPDATING , the domain cannot be modified further // until the existing operation is complete. If it is AVAILABLE , the domain can be @@ -400,6 +406,12 @@ type DomainName struct { // domain name. EndpointConfiguration *EndpointConfiguration + // A stringified JSON policy document that applies to the API Gateway Management + // service for this DomainName. This policy document controls access for access + // association sources to create domain name access associations with this + // DomainName. Supported only for private custom domain names. + ManagementPolicy *string + // The mutual TLS authentication configuration for a custom domain name. If // specified, API Gateway performs two-way authentication between the client and // the server. Clients must present a trusted certificate to access your API. @@ -410,6 +422,11 @@ type DomainName struct { // imported or private CA certificate ARN as the regionalCertificateArn. OwnershipVerificationCertificateArn *string + // A stringified JSON policy document that applies to the execute-api service for + // this DomainName regardless of the caller and Method configuration. Supported + // only for private custom domain names. + Policy *string + // The reference to an Amazon Web Services-managed certificate that will be used // for validating the regional domain name. Certificate Manager is the only // supported source. @@ -440,6 +457,31 @@ type DomainName struct { noSmithyDocumentSerde } +// Represents a domain name access association between an access association +// source and a private custom domain name. With a domain name access association, +// an access association source can invoke a private custom domain name while +// isolated from the public internet. +type DomainNameAccessAssociation struct { + + // The ARN of the domain name access association source. For a VPCE, the ARN must + // be a VPC endpoint. + AccessAssociationSource *string + + // The type of the domain name access association source. + AccessAssociationSourceType AccessAssociationSourceType + + // The ARN of the domain name access association resource. + DomainNameAccessAssociationArn *string + + // The ARN of the domain name. + DomainNameArn *string + + // The collection of tags. Each tag element is associated with a given resource. + Tags map[string]string + + noSmithyDocumentSerde +} + // The endpoint configuration to indicate the types of endpoints an API (RestApi) // or its custom domain name (DomainName) has. type EndpointConfiguration struct { diff --git a/service/apigateway/validators.go b/service/apigateway/validators.go index 3b1f3e1c143..8f1d4243cd7 100644 --- a/service/apigateway/validators.go +++ b/service/apigateway/validators.go @@ -110,6 +110,26 @@ func (m *validateOpCreateDocumentationVersion) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpCreateDomainNameAccessAssociation struct { +} + +func (*validateOpCreateDomainNameAccessAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDomainNameAccessAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDomainNameAccessAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDomainNameAccessAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateDomainName struct { } @@ -430,6 +450,26 @@ func (m *validateOpDeleteDocumentationVersion) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpDeleteDomainNameAccessAssociation struct { +} + +func (*validateOpDeleteDomainNameAccessAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDomainNameAccessAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDomainNameAccessAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDomainNameAccessAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteDomainName struct { } @@ -1690,6 +1730,26 @@ func (m *validateOpPutRestApi) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpRejectDomainNameAccessAssociation struct { +} + +func (*validateOpRejectDomainNameAccessAssociation) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRejectDomainNameAccessAssociation) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RejectDomainNameAccessAssociationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRejectDomainNameAccessAssociationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -2210,6 +2270,10 @@ func addOpCreateDocumentationVersionValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpCreateDocumentationVersion{}, middleware.After) } +func addOpCreateDomainNameAccessAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDomainNameAccessAssociation{}, middleware.After) +} + func addOpCreateDomainNameValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateDomainName{}, middleware.After) } @@ -2274,6 +2338,10 @@ func addOpDeleteDocumentationVersionValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDeleteDocumentationVersion{}, middleware.After) } +func addOpDeleteDomainNameAccessAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDomainNameAccessAssociation{}, middleware.After) +} + func addOpDeleteDomainNameValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDomainName{}, middleware.After) } @@ -2526,6 +2594,10 @@ func addOpPutRestApiValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutRestApi{}, middleware.After) } +func addOpRejectDomainNameAccessAssociationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRejectDomainNameAccessAssociation{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -2738,6 +2810,27 @@ func validateOpCreateDocumentationVersionInput(v *CreateDocumentationVersionInpu } } +func validateOpCreateDomainNameAccessAssociationInput(v *CreateDomainNameAccessAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDomainNameAccessAssociationInput"} + if v.DomainNameArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainNameArn")) + } + if len(v.AccessAssociationSourceType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AccessAssociationSourceType")) + } + if v.AccessAssociationSource == nil { + invalidParams.Add(smithy.NewErrParamRequired("AccessAssociationSource")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateDomainNameInput(v *CreateDomainNameInput) error { if v == nil { return nil @@ -3020,6 +3113,21 @@ func validateOpDeleteDocumentationVersionInput(v *DeleteDocumentationVersionInpu } } +func validateOpDeleteDomainNameAccessAssociationInput(v *DeleteDomainNameAccessAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDomainNameAccessAssociationInput"} + if v.DomainNameAccessAssociationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainNameAccessAssociationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteDomainNameInput(v *DeleteDomainNameInput) error { if v == nil { return nil @@ -4151,6 +4259,24 @@ func validateOpPutRestApiInput(v *PutRestApiInput) error { } } +func validateOpRejectDomainNameAccessAssociationInput(v *RejectDomainNameAccessAssociationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RejectDomainNameAccessAssociationInput"} + if v.DomainNameAccessAssociationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainNameAccessAssociationArn")) + } + if v.DomainNameArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DomainNameArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil diff --git a/service/applicationautoscaling/api_op_GetPredictiveScalingForecast.go b/service/applicationautoscaling/api_op_GetPredictiveScalingForecast.go new file mode 100644 index 00000000000..099ed548723 --- /dev/null +++ b/service/applicationautoscaling/api_op_GetPredictiveScalingForecast.go @@ -0,0 +1,202 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package applicationautoscaling + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/applicationautoscaling/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves the forecast data for a predictive scaling policy. +// +// Load forecasts are predictions of the hourly load values using historical load +// data from CloudWatch and an analysis of historical trends. Capacity forecasts +// are represented as predicted values for the minimum capacity that is needed on +// an hourly basis, based on the hourly load forecast. +// +// A minimum of 24 hours of data is required to create the initial forecasts. +// However, having a full 14 days of historical data results in more accurate +// forecasts. +func (c *Client) GetPredictiveScalingForecast(ctx context.Context, params *GetPredictiveScalingForecastInput, optFns ...func(*Options)) (*GetPredictiveScalingForecastOutput, error) { + if params == nil { + params = &GetPredictiveScalingForecastInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetPredictiveScalingForecast", params, optFns, c.addOperationGetPredictiveScalingForecastMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetPredictiveScalingForecastOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetPredictiveScalingForecastInput struct { + + // The exclusive end time of the time range for the forecast data to get. The + // maximum time duration between the start and end time is 30 days. + // + // This member is required. + EndTime *time.Time + + // The name of the policy. + // + // This member is required. + PolicyName *string + + // The identifier of the resource. + // + // This member is required. + ResourceId *string + + // The scalable dimension. + // + // This member is required. + ScalableDimension types.ScalableDimension + + // The namespace of the Amazon Web Services service that provides the resource. + // For a resource provided by your own application or service, use custom-resource + // instead. + // + // This member is required. + ServiceNamespace types.ServiceNamespace + + // The inclusive start time of the time range for the forecast data to get. At + // most, the date and time can be one year before the current date and time + // + // This member is required. + StartTime *time.Time + + noSmithyDocumentSerde +} + +type GetPredictiveScalingForecastOutput struct { + + // The capacity forecast. + CapacityForecast *types.CapacityForecast + + // The load forecast. + LoadForecast []types.LoadForecast + + // The time the forecast was made. + UpdateTime *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetPredictiveScalingForecastMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetPredictiveScalingForecast{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetPredictiveScalingForecast{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetPredictiveScalingForecast"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetPredictiveScalingForecastValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetPredictiveScalingForecast(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetPredictiveScalingForecast(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetPredictiveScalingForecast", + } +} diff --git a/service/applicationautoscaling/api_op_PutScalingPolicy.go b/service/applicationautoscaling/api_op_PutScalingPolicy.go index 119a140ebf4..6bb2f235e01 100644 --- a/service/applicationautoscaling/api_op_PutScalingPolicy.go +++ b/service/applicationautoscaling/api_op_PutScalingPolicy.go @@ -248,6 +248,9 @@ type PutScalingPolicyInput struct { // [Target tracking scaling policies]: https://docs.aws.amazon.com/autoscaling/application/userguide/application-auto-scaling-target-tracking.html PolicyType types.PolicyType + // The configuration of the predictive scaling policy. + PredictiveScalingPolicyConfiguration *types.PredictiveScalingPolicyConfiguration + // A step scaling policy. // // This parameter is required if you are creating a policy and the policy type is diff --git a/service/applicationautoscaling/deserializers.go b/service/applicationautoscaling/deserializers.go index 433781efb15..c036d81ca5f 100644 --- a/service/applicationautoscaling/deserializers.go +++ b/service/applicationautoscaling/deserializers.go @@ -873,6 +873,120 @@ func awsAwsjson11_deserializeOpErrorDescribeScheduledActions(response *smithyhtt } } +type awsAwsjson11_deserializeOpGetPredictiveScalingForecast struct { +} + +func (*awsAwsjson11_deserializeOpGetPredictiveScalingForecast) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetPredictiveScalingForecast) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetPredictiveScalingForecast(response, &metadata) + } + output := &GetPredictiveScalingForecastOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetPredictiveScalingForecastOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetPredictiveScalingForecast(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServiceException", errorCode): + return awsAwsjson11_deserializeErrorInternalServiceException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListTagsForResource struct { } @@ -1982,6 +2096,47 @@ func awsAwsjson11_deserializeDocumentAlarms(v *[]types.Alarm, value interface{}) return nil } +func awsAwsjson11_deserializeDocumentCapacityForecast(v **types.CapacityForecast, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CapacityForecast + if *v == nil { + sv = &types.CapacityForecast{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Timestamps": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingForecastTimestamps(&sv.Timestamps, value); err != nil { + return err + } + + case "Values": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingForecastValues(&sv.Values, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentConcurrentUpdateException(v **types.ConcurrentUpdateException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -2187,27 +2342,910 @@ func awsAwsjson11_deserializeDocumentInvalidNextTokenException(v **types.Invalid return nil } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InvalidNextTokenException + if *v == nil { + sv = &types.InvalidNextTokenException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.LimitExceededException + if *v == nil { + sv = &types.LimitExceededException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentLoadForecast(v **types.LoadForecast, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.LoadForecast + if *v == nil { + sv = &types.LoadForecast{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MetricSpecification": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetricSpecification(&sv.MetricSpecification, value); err != nil { + return err + } + + case "Timestamps": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingForecastTimestamps(&sv.Timestamps, value); err != nil { + return err + } + + case "Values": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingForecastValues(&sv.Values, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentLoadForecasts(v *[]types.LoadForecast, 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.LoadForecast + if *v == nil { + cv = []types.LoadForecast{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.LoadForecast + destAddr := &col + if err := awsAwsjson11_deserializeDocumentLoadForecast(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentMetricDimension(v **types.MetricDimension, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.MetricDimension + if *v == nil { + sv = &types.MetricDimension{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricDimensionName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricDimensionValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentMetricDimensions(v *[]types.MetricDimension, 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.MetricDimension + if *v == nil { + cv = []types.MetricDimension{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MetricDimension + destAddr := &col + if err := awsAwsjson11_deserializeDocumentMetricDimension(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentNotScaledReason(v **types.NotScaledReason, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NotScaledReason + if *v == nil { + sv = &types.NotScaledReason{} + } 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 XmlString to be of type string, got %T instead", value) + } + sv.Code = ptr.String(jtv) + } + + case "CurrentCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ResourceCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CurrentCapacity = ptr.Int32(int32(i64)) + } + + case "MaxCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ResourceCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxCapacity = ptr.Int32(int32(i64)) + } + + case "MinCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ResourceCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MinCapacity = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentNotScaledReasons(v *[]types.NotScaledReason, 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.NotScaledReason + if *v == nil { + cv = []types.NotScaledReason{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotScaledReason + destAddr := &col + if err := awsAwsjson11_deserializeDocumentNotScaledReason(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentObjectNotFoundException(v **types.ObjectNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ObjectNotFoundException + if *v == nil { + sv = &types.ObjectNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPredefinedMetricSpecification(v **types.PredefinedMetricSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PredefinedMetricSpecification + if *v == nil { + sv = &types.PredefinedMetricSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "PredefinedMetricType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricType to be of type string, got %T instead", value) + } + sv.PredefinedMetricType = types.MetricType(jtv) + } + + case "ResourceLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceLabel to be of type string, got %T instead", value) + } + sv.ResourceLabel = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingCustomizedMetricSpecification(v **types.PredictiveScalingCustomizedMetricSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PredictiveScalingCustomizedMetricSpecification + if *v == nil { + sv = &types.PredictiveScalingCustomizedMetricSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "MetricDataQueries": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetricDataQueries(&sv.MetricDataQueries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingForecastTimestamps(v *[]time.Time, 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 []time.Time + if *v == nil { + cv = []time.Time{} + } else { + cv = *v + } + + for _, value := range shape { + var col time.Time + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + col = smithytime.ParseEpochSeconds(f64) + + default: + return fmt.Errorf("expected TimestampType to be a JSON Number, got %T instead", value) + + } + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingForecastValues(v *[]float64, 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 []float64 + if *v == nil { + cv = []float64{} + } else { + cv = *v + } + + for _, value := range shape { + var col float64 + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + col = 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) + + } + col = f64 + + default: + return fmt.Errorf("expected MetricScale to be a JSON Number, got %T instead", value) + + } + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingMetric(v **types.PredictiveScalingMetric, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PredictiveScalingMetric + if *v == nil { + sv = &types.PredictiveScalingMetric{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Dimensions": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetricDimensions(&sv.Dimensions, value); err != nil { + return err + } + + case "MetricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PredictiveScalingMetricName to be of type string, got %T instead", value) + } + sv.MetricName = ptr.String(jtv) + } + + case "Namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PredictiveScalingMetricNamespace to be of type string, got %T instead", value) + } + sv.Namespace = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingMetricDataQueries(v *[]types.PredictiveScalingMetricDataQuery, 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.PredictiveScalingMetricDataQuery + if *v == nil { + cv = []types.PredictiveScalingMetricDataQuery{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PredictiveScalingMetricDataQuery + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetricDataQuery(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingMetricDataQuery(v **types.PredictiveScalingMetricDataQuery, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PredictiveScalingMetricDataQuery + if *v == nil { + sv = &types.PredictiveScalingMetricDataQuery{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Expression to be of type string, got %T instead", value) + } + sv.Expression = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Id to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "Label": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected XmlString to be of type string, got %T instead", value) + } + sv.Label = ptr.String(jtv) + } + + case "MetricStat": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetricStat(&sv.MetricStat, value); err != nil { + return err + } + + case "ReturnData": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected ReturnData to be of type *bool, got %T instead", value) + } + sv.ReturnData = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingMetricDimension(v **types.PredictiveScalingMetricDimension, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PredictiveScalingMetricDimension + if *v == nil { + sv = &types.PredictiveScalingMetricDimension{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PredictiveScalingMetricDimensionName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PredictiveScalingMetricDimensionValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingMetricDimensions(v *[]types.PredictiveScalingMetricDimension, 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.PredictiveScalingMetricDimension + if *v == nil { + cv = []types.PredictiveScalingMetricDimension{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PredictiveScalingMetricDimension + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetricDimension(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentPredictiveScalingMetricSpecification(v **types.PredictiveScalingMetricSpecification, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PredictiveScalingMetricSpecification + if *v == nil { + sv = &types.PredictiveScalingMetricSpecification{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CustomizedCapacityMetricSpecification": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingCustomizedMetricSpecification(&sv.CustomizedCapacityMetricSpecification, value); err != nil { + return err + } + + case "CustomizedLoadMetricSpecification": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingCustomizedMetricSpecification(&sv.CustomizedLoadMetricSpecification, value); err != nil { + return err + } + + case "CustomizedScalingMetricSpecification": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingCustomizedMetricSpecification(&sv.CustomizedScalingMetricSpecification, value); err != nil { + return err + } + + case "PredefinedLoadMetricSpecification": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingPredefinedLoadMetricSpecification(&sv.PredefinedLoadMetricSpecification, value); err != nil { + return err + } + + case "PredefinedMetricPairSpecification": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingPredefinedMetricPairSpecification(&sv.PredefinedMetricPairSpecification, value); err != nil { + return err + } + + case "PredefinedScalingMetricSpecification": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingPredefinedScalingMetricSpecification(&sv.PredefinedScalingMetricSpecification, value); err != nil { + return err + } + + case "TargetValue": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TargetValue = 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) - var sv *types.InvalidNextTokenException - if *v == nil { - sv = &types.InvalidNextTokenException{} - } else { - sv = *v - } + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) + + } + sv.TargetValue = ptr.Float64(f64) + + default: + return fmt.Errorf("expected MetricScale to be a JSON Number, got %T instead", value) - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) } default: @@ -2219,7 +3257,7 @@ func awsAwsjson11_deserializeDocumentInvalidNextTokenException(v **types.Invalid return nil } -func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExceededException, value interface{}) error { +func awsAwsjson11_deserializeDocumentPredictiveScalingMetricSpecifications(v *[]types.PredictiveScalingMetricSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2227,39 +3265,33 @@ func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExcee return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LimitExceededException + var cv []types.PredictiveScalingMetricSpecification if *v == nil { - sv = &types.LimitExceededException{} + cv = []types.PredictiveScalingMetricSpecification{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.PredictiveScalingMetricSpecification + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetricSpecification(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentMetricDimension(v **types.MetricDimension, value interface{}) error { +func awsAwsjson11_deserializeDocumentPredictiveScalingMetricStat(v **types.PredictiveScalingMetricStat, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2272,31 +3304,36 @@ func awsAwsjson11_deserializeDocumentMetricDimension(v **types.MetricDimension, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.MetricDimension + var sv *types.PredictiveScalingMetricStat if *v == nil { - sv = &types.MetricDimension{} + sv = &types.PredictiveScalingMetricStat{} } else { sv = *v } for key, value := range shape { switch key { - case "Name": + case "Metric": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetric(&sv.Metric, value); err != nil { + return err + } + + case "Stat": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MetricDimensionName to be of type string, got %T instead", value) + return fmt.Errorf("expected XmlString to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Stat = ptr.String(jtv) } - case "Value": + case "Unit": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MetricDimensionValue to be of type string, got %T instead", value) + return fmt.Errorf("expected PredictiveScalingMetricUnit to be of type string, got %T instead", value) } - sv.Value = ptr.String(jtv) + sv.Unit = ptr.String(jtv) } default: @@ -2308,41 +3345,7 @@ func awsAwsjson11_deserializeDocumentMetricDimension(v **types.MetricDimension, return nil } -func awsAwsjson11_deserializeDocumentMetricDimensions(v *[]types.MetricDimension, 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.MetricDimension - if *v == nil { - cv = []types.MetricDimension{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.MetricDimension - destAddr := &col - if err := awsAwsjson11_deserializeDocumentMetricDimension(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - -func awsAwsjson11_deserializeDocumentNotScaledReason(v **types.NotScaledReason, value interface{}) error { +func awsAwsjson11_deserializeDocumentPredictiveScalingPolicyConfiguration(v **types.PredictiveScalingPolicyConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2355,61 +3358,62 @@ func awsAwsjson11_deserializeDocumentNotScaledReason(v **types.NotScaledReason, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.NotScaledReason + var sv *types.PredictiveScalingPolicyConfiguration if *v == nil { - sv = &types.NotScaledReason{} + sv = &types.PredictiveScalingPolicyConfiguration{} } else { sv = *v } for key, value := range shape { switch key { - case "Code": + case "MaxCapacityBreachBehavior": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected XmlString to be of type string, got %T instead", value) + return fmt.Errorf("expected PredictiveScalingMaxCapacityBreachBehavior to be of type string, got %T instead", value) } - sv.Code = ptr.String(jtv) + sv.MaxCapacityBreachBehavior = types.PredictiveScalingMaxCapacityBreachBehavior(jtv) } - case "CurrentCapacity": + case "MaxCapacityBuffer": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected ResourceCapacity to be json.Number, got %T instead", value) + return fmt.Errorf("expected PredictiveScalingMaxCapacityBuffer to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.CurrentCapacity = ptr.Int32(int32(i64)) + sv.MaxCapacityBuffer = ptr.Int32(int32(i64)) } - case "MaxCapacity": + case "MetricSpecifications": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingMetricSpecifications(&sv.MetricSpecifications, value); err != nil { + return err + } + + case "Mode": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceCapacity to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected PredictiveScalingMode to be of type string, got %T instead", value) } - sv.MaxCapacity = ptr.Int32(int32(i64)) + sv.Mode = types.PredictiveScalingMode(jtv) } - case "MinCapacity": + case "SchedulingBufferTime": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected ResourceCapacity to be json.Number, got %T instead", value) + return fmt.Errorf("expected PredictiveScalingSchedulingBufferTime to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.MinCapacity = ptr.Int32(int32(i64)) + sv.SchedulingBufferTime = ptr.Int32(int32(i64)) } default: @@ -2421,7 +3425,7 @@ func awsAwsjson11_deserializeDocumentNotScaledReason(v **types.NotScaledReason, return nil } -func awsAwsjson11_deserializeDocumentNotScaledReasons(v *[]types.NotScaledReason, value interface{}) error { +func awsAwsjson11_deserializeDocumentPredictiveScalingPredefinedLoadMetricSpecification(v **types.PredictiveScalingPredefinedLoadMetricSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2429,33 +3433,48 @@ func awsAwsjson11_deserializeDocumentNotScaledReasons(v *[]types.NotScaledReason return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.NotScaledReason + var sv *types.PredictiveScalingPredefinedLoadMetricSpecification if *v == nil { - cv = []types.NotScaledReason{} + sv = &types.PredictiveScalingPredefinedLoadMetricSpecification{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.NotScaledReason - destAddr := &col - if err := awsAwsjson11_deserializeDocumentNotScaledReason(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "PredefinedMetricType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PredictiveScalingMetricType to be of type string, got %T instead", value) + } + sv.PredefinedMetricType = ptr.String(jtv) + } + + case "ResourceLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceLabel to be of type string, got %T instead", value) + } + sv.ResourceLabel = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentObjectNotFoundException(v **types.ObjectNotFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentPredictiveScalingPredefinedMetricPairSpecification(v **types.PredictiveScalingPredefinedMetricPairSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2468,22 +3487,31 @@ func awsAwsjson11_deserializeDocumentObjectNotFoundException(v **types.ObjectNot return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ObjectNotFoundException + var sv *types.PredictiveScalingPredefinedMetricPairSpecification if *v == nil { - sv = &types.ObjectNotFoundException{} + sv = &types.PredictiveScalingPredefinedMetricPairSpecification{} } else { sv = *v } for key, value := range shape { switch key { - case "message", "Message": + case "PredefinedMetricType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + return fmt.Errorf("expected PredictiveScalingMetricType to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.PredefinedMetricType = ptr.String(jtv) + } + + case "ResourceLabel": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceLabel to be of type string, got %T instead", value) + } + sv.ResourceLabel = ptr.String(jtv) } default: @@ -2495,7 +3523,7 @@ func awsAwsjson11_deserializeDocumentObjectNotFoundException(v **types.ObjectNot return nil } -func awsAwsjson11_deserializeDocumentPredefinedMetricSpecification(v **types.PredefinedMetricSpecification, value interface{}) error { +func awsAwsjson11_deserializeDocumentPredictiveScalingPredefinedScalingMetricSpecification(v **types.PredictiveScalingPredefinedScalingMetricSpecification, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2508,9 +3536,9 @@ func awsAwsjson11_deserializeDocumentPredefinedMetricSpecification(v **types.Pre return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PredefinedMetricSpecification + var sv *types.PredictiveScalingPredefinedScalingMetricSpecification if *v == nil { - sv = &types.PredefinedMetricSpecification{} + sv = &types.PredictiveScalingPredefinedScalingMetricSpecification{} } else { sv = *v } @@ -2521,9 +3549,9 @@ func awsAwsjson11_deserializeDocumentPredefinedMetricSpecification(v **types.Pre if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MetricType to be of type string, got %T instead", value) + return fmt.Errorf("expected PredictiveScalingMetricType to be of type string, got %T instead", value) } - sv.PredefinedMetricType = types.MetricType(jtv) + sv.PredefinedMetricType = ptr.String(jtv) } case "ResourceLabel": @@ -2657,6 +3685,19 @@ func awsAwsjson11_deserializeDocumentScalableTarget(v **types.ScalableTarget, va sv.MinCapacity = ptr.Int32(int32(i64)) } + case "PredictedCapacity": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ResourceCapacity to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.PredictedCapacity = ptr.Int32(int32(i64)) + } + case "ResourceId": if value != nil { jtv, ok := value.(string) @@ -3094,6 +4135,11 @@ func awsAwsjson11_deserializeDocumentScalingPolicy(v **types.ScalingPolicy, valu sv.PolicyType = types.PolicyType(jtv) } + case "PredictiveScalingPolicyConfiguration": + if err := awsAwsjson11_deserializeDocumentPredictiveScalingPolicyConfiguration(&sv.PredictiveScalingPolicyConfiguration, value); err != nil { + return err + } + case "ResourceId": if value != nil { jtv, ok := value.(string) @@ -4410,6 +5456,63 @@ func awsAwsjson11_deserializeOpDocumentDescribeScheduledActionsOutput(v **Descri return nil } +func awsAwsjson11_deserializeOpDocumentGetPredictiveScalingForecastOutput(v **GetPredictiveScalingForecastOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetPredictiveScalingForecastOutput + if *v == nil { + sv = &GetPredictiveScalingForecastOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CapacityForecast": + if err := awsAwsjson11_deserializeDocumentCapacityForecast(&sv.CapacityForecast, value); err != nil { + return err + } + + case "LoadForecast": + if err := awsAwsjson11_deserializeDocumentLoadForecasts(&sv.LoadForecast, value); err != nil { + return err + } + + case "UpdateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected TimestampType to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/applicationautoscaling/generated.json b/service/applicationautoscaling/generated.json index 881092eed39..73d6a0b02cd 100644 --- a/service/applicationautoscaling/generated.json +++ b/service/applicationautoscaling/generated.json @@ -15,6 +15,7 @@ "api_op_DescribeScalingActivities.go", "api_op_DescribeScalingPolicies.go", "api_op_DescribeScheduledActions.go", + "api_op_GetPredictiveScalingForecast.go", "api_op_ListTagsForResource.go", "api_op_PutScalingPolicy.go", "api_op_PutScheduledAction.go", diff --git a/service/applicationautoscaling/serializers.go b/service/applicationautoscaling/serializers.go index 5e8ecb1275a..7d862d1aa5a 100644 --- a/service/applicationautoscaling/serializers.go +++ b/service/applicationautoscaling/serializers.go @@ -445,6 +445,67 @@ func (m *awsAwsjson11_serializeOpDescribeScheduledActions) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetPredictiveScalingForecast struct { +} + +func (*awsAwsjson11_serializeOpGetPredictiveScalingForecast) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetPredictiveScalingForecast) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetPredictiveScalingForecastInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AnyScaleFrontendService.GetPredictiveScalingForecast") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetPredictiveScalingForecastInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListTagsForResource struct { } @@ -898,6 +959,310 @@ func awsAwsjson11_serializeDocumentPredefinedMetricSpecification(v *types.Predef return nil } +func awsAwsjson11_serializeDocumentPredictiveScalingCustomizedMetricSpecification(v *types.PredictiveScalingCustomizedMetricSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetricDataQueries != nil { + ok := object.Key("MetricDataQueries") + if err := awsAwsjson11_serializeDocumentPredictiveScalingMetricDataQueries(v.MetricDataQueries, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingMetric(v *types.PredictiveScalingMetric, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Dimensions != nil { + ok := object.Key("Dimensions") + if err := awsAwsjson11_serializeDocumentPredictiveScalingMetricDimensions(v.Dimensions, ok); err != nil { + return err + } + } + + if v.MetricName != nil { + ok := object.Key("MetricName") + ok.String(*v.MetricName) + } + + if v.Namespace != nil { + ok := object.Key("Namespace") + ok.String(*v.Namespace) + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingMetricDataQueries(v []types.PredictiveScalingMetricDataQuery, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentPredictiveScalingMetricDataQuery(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingMetricDataQuery(v *types.PredictiveScalingMetricDataQuery, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Expression != nil { + ok := object.Key("Expression") + ok.String(*v.Expression) + } + + if v.Id != nil { + ok := object.Key("Id") + ok.String(*v.Id) + } + + if v.Label != nil { + ok := object.Key("Label") + ok.String(*v.Label) + } + + if v.MetricStat != nil { + ok := object.Key("MetricStat") + if err := awsAwsjson11_serializeDocumentPredictiveScalingMetricStat(v.MetricStat, ok); err != nil { + return err + } + } + + if v.ReturnData != nil { + ok := object.Key("ReturnData") + ok.Boolean(*v.ReturnData) + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingMetricDimension(v *types.PredictiveScalingMetricDimension, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingMetricDimensions(v []types.PredictiveScalingMetricDimension, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentPredictiveScalingMetricDimension(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingMetricSpecification(v *types.PredictiveScalingMetricSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CustomizedCapacityMetricSpecification != nil { + ok := object.Key("CustomizedCapacityMetricSpecification") + if err := awsAwsjson11_serializeDocumentPredictiveScalingCustomizedMetricSpecification(v.CustomizedCapacityMetricSpecification, ok); err != nil { + return err + } + } + + if v.CustomizedLoadMetricSpecification != nil { + ok := object.Key("CustomizedLoadMetricSpecification") + if err := awsAwsjson11_serializeDocumentPredictiveScalingCustomizedMetricSpecification(v.CustomizedLoadMetricSpecification, ok); err != nil { + return err + } + } + + if v.CustomizedScalingMetricSpecification != nil { + ok := object.Key("CustomizedScalingMetricSpecification") + if err := awsAwsjson11_serializeDocumentPredictiveScalingCustomizedMetricSpecification(v.CustomizedScalingMetricSpecification, ok); err != nil { + return err + } + } + + if v.PredefinedLoadMetricSpecification != nil { + ok := object.Key("PredefinedLoadMetricSpecification") + if err := awsAwsjson11_serializeDocumentPredictiveScalingPredefinedLoadMetricSpecification(v.PredefinedLoadMetricSpecification, ok); err != nil { + return err + } + } + + if v.PredefinedMetricPairSpecification != nil { + ok := object.Key("PredefinedMetricPairSpecification") + if err := awsAwsjson11_serializeDocumentPredictiveScalingPredefinedMetricPairSpecification(v.PredefinedMetricPairSpecification, ok); err != nil { + return err + } + } + + if v.PredefinedScalingMetricSpecification != nil { + ok := object.Key("PredefinedScalingMetricSpecification") + if err := awsAwsjson11_serializeDocumentPredictiveScalingPredefinedScalingMetricSpecification(v.PredefinedScalingMetricSpecification, ok); err != nil { + return err + } + } + + if v.TargetValue != nil { + ok := object.Key("TargetValue") + switch { + case math.IsNaN(*v.TargetValue): + ok.String("NaN") + + case math.IsInf(*v.TargetValue, 1): + ok.String("Infinity") + + case math.IsInf(*v.TargetValue, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.TargetValue) + + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingMetricSpecifications(v []types.PredictiveScalingMetricSpecification, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentPredictiveScalingMetricSpecification(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingMetricStat(v *types.PredictiveScalingMetricStat, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Metric != nil { + ok := object.Key("Metric") + if err := awsAwsjson11_serializeDocumentPredictiveScalingMetric(v.Metric, ok); err != nil { + return err + } + } + + if v.Stat != nil { + ok := object.Key("Stat") + ok.String(*v.Stat) + } + + if v.Unit != nil { + ok := object.Key("Unit") + ok.String(*v.Unit) + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingPolicyConfiguration(v *types.PredictiveScalingPolicyConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.MaxCapacityBreachBehavior) > 0 { + ok := object.Key("MaxCapacityBreachBehavior") + ok.String(string(v.MaxCapacityBreachBehavior)) + } + + if v.MaxCapacityBuffer != nil { + ok := object.Key("MaxCapacityBuffer") + ok.Integer(*v.MaxCapacityBuffer) + } + + if v.MetricSpecifications != nil { + ok := object.Key("MetricSpecifications") + if err := awsAwsjson11_serializeDocumentPredictiveScalingMetricSpecifications(v.MetricSpecifications, ok); err != nil { + return err + } + } + + if len(v.Mode) > 0 { + ok := object.Key("Mode") + ok.String(string(v.Mode)) + } + + if v.SchedulingBufferTime != nil { + ok := object.Key("SchedulingBufferTime") + ok.Integer(*v.SchedulingBufferTime) + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingPredefinedLoadMetricSpecification(v *types.PredictiveScalingPredefinedLoadMetricSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PredefinedMetricType != nil { + ok := object.Key("PredefinedMetricType") + ok.String(*v.PredefinedMetricType) + } + + if v.ResourceLabel != nil { + ok := object.Key("ResourceLabel") + ok.String(*v.ResourceLabel) + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingPredefinedMetricPairSpecification(v *types.PredictiveScalingPredefinedMetricPairSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PredefinedMetricType != nil { + ok := object.Key("PredefinedMetricType") + ok.String(*v.PredefinedMetricType) + } + + if v.ResourceLabel != nil { + ok := object.Key("ResourceLabel") + ok.String(*v.ResourceLabel) + } + + return nil +} + +func awsAwsjson11_serializeDocumentPredictiveScalingPredefinedScalingMetricSpecification(v *types.PredictiveScalingPredefinedScalingMetricSpecification, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.PredefinedMetricType != nil { + ok := object.Key("PredefinedMetricType") + ok.String(*v.PredefinedMetricType) + } + + if v.ResourceLabel != nil { + ok := object.Key("ResourceLabel") + ok.String(*v.ResourceLabel) + } + + return nil +} + func awsAwsjson11_serializeDocumentResourceIdsMaxLen1600(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -1469,6 +1834,43 @@ func awsAwsjson11_serializeOpDocumentDescribeScheduledActionsInput(v *DescribeSc return nil } +func awsAwsjson11_serializeOpDocumentGetPredictiveScalingForecastInput(v *GetPredictiveScalingForecastInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("EndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) + } + + if v.PolicyName != nil { + ok := object.Key("PolicyName") + ok.String(*v.PolicyName) + } + + if v.ResourceId != nil { + ok := object.Key("ResourceId") + ok.String(*v.ResourceId) + } + + if len(v.ScalableDimension) > 0 { + ok := object.Key("ScalableDimension") + ok.String(string(v.ScalableDimension)) + } + + if len(v.ServiceNamespace) > 0 { + ok := object.Key("ServiceNamespace") + ok.String(string(v.ServiceNamespace)) + } + + if v.StartTime != nil { + ok := object.Key("StartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.StartTime)) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -1495,6 +1897,13 @@ func awsAwsjson11_serializeOpDocumentPutScalingPolicyInput(v *PutScalingPolicyIn ok.String(string(v.PolicyType)) } + if v.PredictiveScalingPolicyConfiguration != nil { + ok := object.Key("PredictiveScalingPolicyConfiguration") + if err := awsAwsjson11_serializeDocumentPredictiveScalingPolicyConfiguration(v.PredictiveScalingPolicyConfiguration, ok); err != nil { + return err + } + } + if v.ResourceId != nil { ok := object.Key("ResourceId") ok.String(*v.ResourceId) diff --git a/service/applicationautoscaling/snapshot/api_op_GetPredictiveScalingForecast.go.snap b/service/applicationautoscaling/snapshot/api_op_GetPredictiveScalingForecast.go.snap new file mode 100644 index 00000000000..c947dc36b70 --- /dev/null +++ b/service/applicationautoscaling/snapshot/api_op_GetPredictiveScalingForecast.go.snap @@ -0,0 +1,41 @@ +GetPredictiveScalingForecast + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/applicationautoscaling/snapshot_test.go b/service/applicationautoscaling/snapshot_test.go index 5c3d24a1ef4..7adaba74059 100644 --- a/service/applicationautoscaling/snapshot_test.go +++ b/service/applicationautoscaling/snapshot_test.go @@ -146,6 +146,18 @@ func TestCheckSnapshot_DescribeScheduledActions(t *testing.T) { } } +func TestCheckSnapshot_GetPredictiveScalingForecast(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPredictiveScalingForecast(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetPredictiveScalingForecast") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -301,6 +313,18 @@ func TestUpdateSnapshot_DescribeScheduledActions(t *testing.T) { } } +func TestUpdateSnapshot_GetPredictiveScalingForecast(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetPredictiveScalingForecast(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetPredictiveScalingForecast") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { diff --git a/service/applicationautoscaling/types/enums.go b/service/applicationautoscaling/types/enums.go index 2533a25bef0..da84fee8c2c 100644 --- a/service/applicationautoscaling/types/enums.go +++ b/service/applicationautoscaling/types/enums.go @@ -144,6 +144,7 @@ type PolicyType string const ( PolicyTypeStepScaling PolicyType = "StepScaling" PolicyTypeTargetTrackingScaling PolicyType = "TargetTrackingScaling" + PolicyTypePredictiveScaling PolicyType = "PredictiveScaling" ) // Values returns all known values for PolicyType. Note that this can be expanded @@ -154,6 +155,46 @@ func (PolicyType) Values() []PolicyType { return []PolicyType{ "StepScaling", "TargetTrackingScaling", + "PredictiveScaling", + } +} + +type PredictiveScalingMaxCapacityBreachBehavior string + +// Enum values for PredictiveScalingMaxCapacityBreachBehavior +const ( + PredictiveScalingMaxCapacityBreachBehaviorHonorMaxCapacity PredictiveScalingMaxCapacityBreachBehavior = "HonorMaxCapacity" + PredictiveScalingMaxCapacityBreachBehaviorIncreaseMaxCapacity PredictiveScalingMaxCapacityBreachBehavior = "IncreaseMaxCapacity" +) + +// Values returns all known values for PredictiveScalingMaxCapacityBreachBehavior. +// Note that this can be expanded in the future, and so it is only as up to date as +// the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (PredictiveScalingMaxCapacityBreachBehavior) Values() []PredictiveScalingMaxCapacityBreachBehavior { + return []PredictiveScalingMaxCapacityBreachBehavior{ + "HonorMaxCapacity", + "IncreaseMaxCapacity", + } +} + +type PredictiveScalingMode string + +// Enum values for PredictiveScalingMode +const ( + PredictiveScalingModeForecastOnly PredictiveScalingMode = "ForecastOnly" + PredictiveScalingModeForecastAndScale PredictiveScalingMode = "ForecastAndScale" +) + +// Values returns all known values for PredictiveScalingMode. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (PredictiveScalingMode) Values() []PredictiveScalingMode { + return []PredictiveScalingMode{ + "ForecastOnly", + "ForecastAndScale", } } diff --git a/service/applicationautoscaling/types/types.go b/service/applicationautoscaling/types/types.go index 964b2fb0a82..7a37ccdeb14 100644 --- a/service/applicationautoscaling/types/types.go +++ b/service/applicationautoscaling/types/types.go @@ -23,6 +23,25 @@ type Alarm struct { noSmithyDocumentSerde } +// A GetPredictiveScalingForecast call returns the capacity forecast for a +// +// predictive scaling policy. This structure includes the data points for that +// capacity forecast, along with the timestamps of those data points. +type CapacityForecast struct { + + // The timestamps for the data points, in UTC format. + // + // This member is required. + Timestamps []time.Time + + // The values of the data points. + // + // This member is required. + Values []float64 + + noSmithyDocumentSerde +} + // Represents a CloudWatch metric of your choosing for a target tracking scaling // policy to use with Application Auto Scaling. // @@ -81,6 +100,30 @@ type CustomizedMetricSpecification struct { noSmithyDocumentSerde } +// A GetPredictiveScalingForecast call returns the load forecast for a predictive +// +// scaling policy. This structure includes the data points for that load forecast, +// along with the timestamps of those data points and the metric specification. +type LoadForecast struct { + + // The metric specification for the load forecast. + // + // This member is required. + MetricSpecification *PredictiveScalingMetricSpecification + + // The timestamps for the data points, in UTC format. + // + // This member is required. + Timestamps []time.Time + + // The values of the data points. + // + // This member is required. + Values []float64 + + noSmithyDocumentSerde +} + // Describes the dimension names and values associated with a metric. type MetricDimension struct { @@ -138,7 +181,7 @@ type NotScaledReason struct { // // For more information, [Predefined metrics for target tracking scaling policies] in the Application Auto Scaling User Guide. // -// [Predefined metrics for target tracking scaling policies]: https://docs.aws.amazon.com/autoscaling/application/userguide/monitor-cloudwatch-metrics.html#predefined-metrics +// [Predefined metrics for target tracking scaling policies]: https://docs.aws.amazon.com/autoscaling/application/userguide/monitoring-cloudwatch.html#predefined-metrics type PredefinedMetricSpecification struct { // The metric type. The ALBRequestCountPerTarget metric type applies only to Spot @@ -173,6 +216,268 @@ type PredefinedMetricSpecification struct { noSmithyDocumentSerde } +// Represents a CloudWatch metric of your choosing for a predictive scaling +// +// policy. +type PredictiveScalingCustomizedMetricSpecification struct { + + // One or more metric data queries to provide data points for a metric + // specification. + // + // This member is required. + MetricDataQueries []PredictiveScalingMetricDataQuery + + noSmithyDocumentSerde +} + +// Describes the scaling metric. +type PredictiveScalingMetric struct { + + // Describes the dimensions of the metric. + Dimensions []PredictiveScalingMetricDimension + + // The name of the metric. + MetricName *string + + // The namespace of the metric. + Namespace *string + + noSmithyDocumentSerde +} + +// The metric data to return. Also defines whether this call is returning data +// +// for one metric only, or whether it is performing a math expression on the values +// of returned metric statistics to create a new time series. A time series is a +// series of data points, each of which is associated with a timestamp. +type PredictiveScalingMetricDataQuery struct { + + // A short name that identifies the object's results in the response. This name + // must be unique among all MetricDataQuery objects specified for a single scaling + // policy. If you are performing math expressions on this set of data, this name + // represents that data and can serve as a variable in the mathematical expression. + // The valid characters are letters, numbers, and underscores. The first character + // must be a lowercase letter. + // + // This member is required. + Id *string + + // The math expression to perform on the returned data, if this object is + // performing a math expression. This expression can use the Id of the other + // metrics to refer to those metrics, and can also use the Id of other expressions + // to use the result of those expressions. + // + // Conditional: Within each MetricDataQuery object, you must specify either + // Expression or MetricStat , but not both. + Expression *string + + // A human-readable label for this metric or expression. This is especially + // useful if this is a math expression, so that you know what the value represents. + Label *string + + // Information about the metric data to return. + // + // Conditional: Within each MetricDataQuery object, you must specify either + // Expression or MetricStat , but not both. + MetricStat *PredictiveScalingMetricStat + + // Indicates whether to return the timestamps and raw data values of this metric. + // + // If you use any math expressions, specify true for this value for only the final + // math expression that the metric specification is based on. You must specify + // false for ReturnData for all the other metrics and expressions used in the + // metric specification. + // + // If you are only retrieving metrics and not performing any math expressions, do + // not specify anything for ReturnData . This sets it to its default ( true ). + ReturnData *bool + + noSmithyDocumentSerde +} + +// Describes the dimension of a metric. +type PredictiveScalingMetricDimension struct { + + // The name of the dimension. + // + // This member is required. + Name *string + + // The value of the dimension. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// This structure specifies the metrics and target utilization settings for a +// +// predictive scaling policy. +// +// You must specify either a metric pair, or a load metric and a scaling metric +// individually. Specifying a metric pair instead of individual metrics provides a +// simpler way to configure metrics for a scaling policy. You choose the metric +// pair, and the policy automatically knows the correct sum and average statistics +// to use for the load metric and the scaling metric. +type PredictiveScalingMetricSpecification struct { + + // Specifies the target utilization. + // + // This member is required. + TargetValue *float64 + + // The customized capacity metric specification. + CustomizedCapacityMetricSpecification *PredictiveScalingCustomizedMetricSpecification + + // The customized load metric specification. + CustomizedLoadMetricSpecification *PredictiveScalingCustomizedMetricSpecification + + // The customized scaling metric specification. + CustomizedScalingMetricSpecification *PredictiveScalingCustomizedMetricSpecification + + // The predefined load metric specification. + PredefinedLoadMetricSpecification *PredictiveScalingPredefinedLoadMetricSpecification + + // The predefined metric pair specification that determines the appropriate + // scaling metric and load metric to use. + PredefinedMetricPairSpecification *PredictiveScalingPredefinedMetricPairSpecification + + // The predefined scaling metric specification. + PredefinedScalingMetricSpecification *PredictiveScalingPredefinedScalingMetricSpecification + + noSmithyDocumentSerde +} + +// This structure defines the CloudWatch metric to return, along with the +// +// statistic and unit. +type PredictiveScalingMetricStat struct { + + // The CloudWatch metric to return, including the metric name, namespace, and + // dimensions. To get the exact metric name, namespace, and dimensions, inspect the + // [Metric]object that is returned by a call to [ListMetrics]. + // + // [ListMetrics]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_ListMetrics.html + // [Metric]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_Metric.html + // + // This member is required. + Metric *PredictiveScalingMetric + + // The statistic to return. It can include any CloudWatch statistic or extended + // statistic. For a list of valid values, see the table in [Statistics]in the Amazon + // CloudWatch User Guide. + // + // The most commonly used metrics for predictive scaling are Average and Sum . + // + // [Statistics]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/cloudwatch_concepts.html#Statistic + // + // This member is required. + Stat *string + + // The unit to use for the returned data points. For a complete list of the units + // that CloudWatch supports, see the [MetricDatum]data type in the Amazon CloudWatch API + // Reference. + // + // [MetricDatum]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/APIReference/API_MetricDatum.html + Unit *string + + noSmithyDocumentSerde +} + +// Represents a predictive scaling policy configuration. +type PredictiveScalingPolicyConfiguration struct { + + // This structure includes the metrics and target utilization to use for + // predictive scaling. + // + // This is an array, but we currently only support a single metric specification. + // That is, you can specify a target value and a single metric pair, or a target + // value and one scaling metric and one load metric. + // + // This member is required. + MetricSpecifications []PredictiveScalingMetricSpecification + + // Defines the behavior that should be applied if the forecast capacity + // approaches or exceeds the maximum capacity. Defaults to HonorMaxCapacity if not + // specified. + MaxCapacityBreachBehavior PredictiveScalingMaxCapacityBreachBehavior + + // The size of the capacity buffer to use when the forecast capacity is close to + // or exceeds the maximum capacity. The value is specified as a percentage relative + // to the forecast capacity. For example, if the buffer is 10, this means a 10 + // percent buffer, such that if the forecast capacity is 50, and the maximum + // capacity is 40, then the effective maximum capacity is 55. + // + // Required if the MaxCapacityBreachBehavior property is set to IncreaseMaxCapacity + // , and cannot be used otherwise. + MaxCapacityBuffer *int32 + + // The predictive scaling mode. Defaults to ForecastOnly if not specified. + Mode PredictiveScalingMode + + // The amount of time, in seconds, that the start time can be advanced. + // + // The value must be less than the forecast interval duration of 3600 seconds (60 + // minutes). Defaults to 300 seconds if not specified. + SchedulingBufferTime *int32 + + noSmithyDocumentSerde +} + +// Describes a load metric for a predictive scaling policy. +// +// When returned in the output of DescribePolicies , it indicates that a predictive +// scaling policy uses individually specified load and scaling metrics instead of a +// metric pair. +type PredictiveScalingPredefinedLoadMetricSpecification struct { + + // The metric type. + // + // This member is required. + PredefinedMetricType *string + + // A label that uniquely identifies a target group. + ResourceLabel *string + + noSmithyDocumentSerde +} + +// Represents a metric pair for a predictive scaling policy. +type PredictiveScalingPredefinedMetricPairSpecification struct { + + // Indicates which metrics to use. There are two different types of metrics for + // each metric type: one is a load metric and one is a scaling metric. + // + // This member is required. + PredefinedMetricType *string + + // A label that uniquely identifies a specific target group from which to + // determine the total and average request count. + ResourceLabel *string + + noSmithyDocumentSerde +} + +// Describes a scaling metric for a predictive scaling policy. +// +// When returned in the output of DescribePolicies , it indicates that a predictive +// scaling policy uses individually specified load and scaling metrics instead of a +// metric pair. +type PredictiveScalingPredefinedScalingMetricSpecification struct { + + // The metric type. + // + // This member is required. + PredefinedMetricType *string + + // A label that uniquely identifies a specific target group from which to + // determine the average request count. + ResourceLabel *string + + noSmithyDocumentSerde +} + // Represents a scalable target. type ScalableTarget struct { @@ -356,6 +661,9 @@ type ScalableTarget struct { // This member is required. ServiceNamespace ServiceNamespace + // The predicted capacity of the scalable target. + PredictedCapacity *int32 + // The ARN of the scalable target. ScalableTargetARN *string @@ -793,6 +1101,9 @@ type ScalingPolicy struct { // The CloudWatch alarms associated with the scaling policy. Alarms []Alarm + // The predictive scaling policy configuration. + PredictiveScalingPolicyConfiguration *PredictiveScalingPolicyConfiguration + // A step scaling policy. StepScalingPolicyConfiguration *StepScalingPolicyConfiguration diff --git a/service/applicationautoscaling/validators.go b/service/applicationautoscaling/validators.go index 3b9e779db4e..4d5d8d6562b 100644 --- a/service/applicationautoscaling/validators.go +++ b/service/applicationautoscaling/validators.go @@ -150,6 +150,26 @@ func (m *validateOpDescribeScheduledActions) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpGetPredictiveScalingForecast struct { +} + +func (*validateOpGetPredictiveScalingForecast) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetPredictiveScalingForecast) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetPredictiveScalingForecastInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetPredictiveScalingForecastInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -298,6 +318,10 @@ func addOpDescribeScheduledActionsValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDescribeScheduledActions{}, middleware.After) } +func addOpGetPredictiveScalingForecastValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetPredictiveScalingForecast{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -394,6 +418,262 @@ func validatePredefinedMetricSpecification(v *types.PredefinedMetricSpecificatio } } +func validatePredictiveScalingCustomizedMetricSpecification(v *types.PredictiveScalingCustomizedMetricSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingCustomizedMetricSpecification"} + if v.MetricDataQueries == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricDataQueries")) + } else if v.MetricDataQueries != nil { + if err := validatePredictiveScalingMetricDataQueries(v.MetricDataQueries); err != nil { + invalidParams.AddNested("MetricDataQueries", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingMetric(v *types.PredictiveScalingMetric) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingMetric"} + if v.Dimensions != nil { + if err := validatePredictiveScalingMetricDimensions(v.Dimensions); err != nil { + invalidParams.AddNested("Dimensions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingMetricDataQueries(v []types.PredictiveScalingMetricDataQuery) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingMetricDataQueries"} + for i := range v { + if err := validatePredictiveScalingMetricDataQuery(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingMetricDataQuery(v *types.PredictiveScalingMetricDataQuery) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingMetricDataQuery"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.MetricStat != nil { + if err := validatePredictiveScalingMetricStat(v.MetricStat); err != nil { + invalidParams.AddNested("MetricStat", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingMetricDimension(v *types.PredictiveScalingMetricDimension) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingMetricDimension"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingMetricDimensions(v []types.PredictiveScalingMetricDimension) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingMetricDimensions"} + for i := range v { + if err := validatePredictiveScalingMetricDimension(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingMetricSpecification(v *types.PredictiveScalingMetricSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingMetricSpecification"} + if v.TargetValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetValue")) + } + if v.PredefinedMetricPairSpecification != nil { + if err := validatePredictiveScalingPredefinedMetricPairSpecification(v.PredefinedMetricPairSpecification); err != nil { + invalidParams.AddNested("PredefinedMetricPairSpecification", err.(smithy.InvalidParamsError)) + } + } + if v.PredefinedScalingMetricSpecification != nil { + if err := validatePredictiveScalingPredefinedScalingMetricSpecification(v.PredefinedScalingMetricSpecification); err != nil { + invalidParams.AddNested("PredefinedScalingMetricSpecification", err.(smithy.InvalidParamsError)) + } + } + if v.PredefinedLoadMetricSpecification != nil { + if err := validatePredictiveScalingPredefinedLoadMetricSpecification(v.PredefinedLoadMetricSpecification); err != nil { + invalidParams.AddNested("PredefinedLoadMetricSpecification", err.(smithy.InvalidParamsError)) + } + } + if v.CustomizedScalingMetricSpecification != nil { + if err := validatePredictiveScalingCustomizedMetricSpecification(v.CustomizedScalingMetricSpecification); err != nil { + invalidParams.AddNested("CustomizedScalingMetricSpecification", err.(smithy.InvalidParamsError)) + } + } + if v.CustomizedLoadMetricSpecification != nil { + if err := validatePredictiveScalingCustomizedMetricSpecification(v.CustomizedLoadMetricSpecification); err != nil { + invalidParams.AddNested("CustomizedLoadMetricSpecification", err.(smithy.InvalidParamsError)) + } + } + if v.CustomizedCapacityMetricSpecification != nil { + if err := validatePredictiveScalingCustomizedMetricSpecification(v.CustomizedCapacityMetricSpecification); err != nil { + invalidParams.AddNested("CustomizedCapacityMetricSpecification", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingMetricSpecifications(v []types.PredictiveScalingMetricSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingMetricSpecifications"} + for i := range v { + if err := validatePredictiveScalingMetricSpecification(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingMetricStat(v *types.PredictiveScalingMetricStat) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingMetricStat"} + if v.Metric == nil { + invalidParams.Add(smithy.NewErrParamRequired("Metric")) + } else if v.Metric != nil { + if err := validatePredictiveScalingMetric(v.Metric); err != nil { + invalidParams.AddNested("Metric", err.(smithy.InvalidParamsError)) + } + } + if v.Stat == nil { + invalidParams.Add(smithy.NewErrParamRequired("Stat")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingPolicyConfiguration(v *types.PredictiveScalingPolicyConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingPolicyConfiguration"} + if v.MetricSpecifications == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricSpecifications")) + } else if v.MetricSpecifications != nil { + if err := validatePredictiveScalingMetricSpecifications(v.MetricSpecifications); err != nil { + invalidParams.AddNested("MetricSpecifications", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingPredefinedLoadMetricSpecification(v *types.PredictiveScalingPredefinedLoadMetricSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingPredefinedLoadMetricSpecification"} + if v.PredefinedMetricType == nil { + invalidParams.Add(smithy.NewErrParamRequired("PredefinedMetricType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingPredefinedMetricPairSpecification(v *types.PredictiveScalingPredefinedMetricPairSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingPredefinedMetricPairSpecification"} + if v.PredefinedMetricType == nil { + invalidParams.Add(smithy.NewErrParamRequired("PredefinedMetricType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validatePredictiveScalingPredefinedScalingMetricSpecification(v *types.PredictiveScalingPredefinedScalingMetricSpecification) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PredictiveScalingPredefinedScalingMetricSpecification"} + if v.PredefinedMetricType == nil { + invalidParams.Add(smithy.NewErrParamRequired("PredefinedMetricType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateStepAdjustment(v *types.StepAdjustment) error { if v == nil { return nil @@ -708,6 +988,36 @@ func validateOpDescribeScheduledActionsInput(v *DescribeScheduledActionsInput) e } } +func validateOpGetPredictiveScalingForecastInput(v *GetPredictiveScalingForecastInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetPredictiveScalingForecastInput"} + if len(v.ServiceNamespace) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ServiceNamespace")) + } + if v.ResourceId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ResourceId")) + } + if len(v.ScalableDimension) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("ScalableDimension")) + } + if v.PolicyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + } + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } + if v.EndTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndTime")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -750,6 +1060,11 @@ func validateOpPutScalingPolicyInput(v *PutScalingPolicyInput) error { invalidParams.AddNested("TargetTrackingScalingPolicyConfiguration", err.(smithy.InvalidParamsError)) } } + if v.PredictiveScalingPolicyConfiguration != nil { + if err := validatePredictiveScalingPolicyConfiguration(v.PredictiveScalingPolicyConfiguration); err != nil { + invalidParams.AddNested("PredictiveScalingPolicyConfiguration", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/appsync/types/enums.go b/service/appsync/types/enums.go index 815c58162c1..89f0b744907 100644 --- a/service/appsync/types/enums.go +++ b/service/appsync/types/enums.go @@ -306,6 +306,7 @@ const ( DataSourceTypeRelationalDatabase DataSourceType = "RELATIONAL_DATABASE" DataSourceTypeAmazonOpensearchService DataSourceType = "AMAZON_OPENSEARCH_SERVICE" DataSourceTypeAmazonEventbridge DataSourceType = "AMAZON_EVENTBRIDGE" + DataSourceTypeAmazonBedrockRuntime DataSourceType = "AMAZON_BEDROCK_RUNTIME" ) // Values returns all known values for DataSourceType. Note that this can be @@ -322,6 +323,7 @@ func (DataSourceType) Values() []DataSourceType { "RELATIONAL_DATABASE", "AMAZON_OPENSEARCH_SERVICE", "AMAZON_EVENTBRIDGE", + "AMAZON_BEDROCK_RUNTIME", } } diff --git a/service/braket/internal/endpoints/endpoints.go b/service/braket/internal/endpoints/endpoints.go index de996ff1b58..244bb9f4961 100644 --- a/service/braket/internal/endpoints/endpoints.go +++ b/service/braket/internal/endpoints/endpoints.go @@ -142,18 +142,48 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "braket.eu-north-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "braket.eu-west-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "braket.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "braket.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "braket.us-west-2.api.aws", + }, }, }, { diff --git a/service/cloudfront/deserializers.go b/service/cloudfront/deserializers.go index e29e0af7135..44901b107c7 100644 --- a/service/cloudfront/deserializers.go +++ b/service/cloudfront/deserializers.go @@ -40675,6 +40675,19 @@ func awsRestxml_deserializeDocumentOriginGroup(v **types.OriginGroup, decoder sm return err } + case strings.EqualFold("SelectionCriteria", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.SelectionCriteria = types.OriginGroupSelectionCriteria(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() diff --git a/service/cloudfront/serializers.go b/service/cloudfront/serializers.go index 86f8bf1853d..947ff5a1c6a 100644 --- a/service/cloudfront/serializers.go +++ b/service/cloudfront/serializers.go @@ -13055,6 +13055,17 @@ func awsRestxml_serializeDocumentOriginGroup(v *types.OriginGroup, value smithyx return err } } + if len(v.SelectionCriteria) > 0 { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "SelectionCriteria", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(string(v.SelectionCriteria)) + } return nil } diff --git a/service/cloudfront/types/enums.go b/service/cloudfront/types/enums.go index c530f123fe4..7767d8b077c 100644 --- a/service/cloudfront/types/enums.go +++ b/service/cloudfront/types/enums.go @@ -450,6 +450,26 @@ func (OriginAccessControlSigningProtocols) Values() []OriginAccessControlSigning } } +type OriginGroupSelectionCriteria string + +// Enum values for OriginGroupSelectionCriteria +const ( + OriginGroupSelectionCriteriaDefault OriginGroupSelectionCriteria = "default" + OriginGroupSelectionCriteriaMediaQualityBased OriginGroupSelectionCriteria = "media-quality-based" +) + +// Values returns all known values for OriginGroupSelectionCriteria. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (OriginGroupSelectionCriteria) Values() []OriginGroupSelectionCriteria { + return []OriginGroupSelectionCriteria{ + "default", + "media-quality-based", + } +} + type OriginProtocolPolicy string // Enum values for OriginProtocolPolicy diff --git a/service/cloudfront/types/types.go b/service/cloudfront/types/types.go index 34c0845a41b..98116b0d92a 100644 --- a/service/cloudfront/types/types.go +++ b/service/cloudfront/types/types.go @@ -3570,12 +3570,15 @@ type OriginCustomHeader struct { noSmithyDocumentSerde } -// An origin group includes two origins (a primary origin and a second origin to -// failover to) and a failover criteria that you specify. You create an origin +// An origin group includes two origins (a primary origin and a secondary origin +// to failover to) and a failover criteria that you specify. You create an origin // group to support origin failover in CloudFront. When you create or update a // distribution, you can specify the origin group instead of a single origin, and -// CloudFront will failover from the primary origin to the second origin under the -// failover conditions that you've chosen. +// CloudFront will failover from the primary origin to the secondary origin under +// the failover conditions that you've chosen. +// +// Optionally, you can choose selection criteria for your origin group to specify +// how your origins are selected when your distribution routes viewer requests. type OriginGroup struct { // A complex type that contains information about the failover criteria for an @@ -3594,6 +3597,12 @@ type OriginGroup struct { // This member is required. Members *OriginGroupMembers + // The selection criteria for the origin group. For more information, see [Create an origin group] in the + // Amazon CloudFront Developer Guide. + // + // [Create an origin group]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/high_availability_origin_failover.html#concept_origin_groups.creating + SelectionCriteria OriginGroupSelectionCriteria + noSmithyDocumentSerde } diff --git a/service/cloudtrail/api_op_AddTags.go b/service/cloudtrail/api_op_AddTags.go index dbc9939ecc0..8636ea506d2 100644 --- a/service/cloudtrail/api_op_AddTags.go +++ b/service/cloudtrail/api_op_AddTags.go @@ -11,14 +11,14 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Adds one or more tags to a trail, event data store, or channel, up to a limit -// of 50. Overwrites an existing tag's value when a new value is specified for an -// existing tag key. Tag key names must be unique; you cannot have two keys with -// the same name but different values. If you specify a key without a value, the -// tag will be created with the specified key and a value of null. You can tag a -// trail or event data store that applies to all Amazon Web Services Regions only -// from the Region in which the trail or event data store was created (also known -// as its home Region). +// Adds one or more tags to a trail, event data store, dashboard, or channel, up +// to a limit of 50. Overwrites an existing tag's value when a new value is +// specified for an existing tag key. Tag key names must be unique; you cannot have +// two keys with the same name but different values. If you specify a key without a +// value, the tag will be created with the specified key and a value of null. You +// can tag a trail or event data store that applies to all Amazon Web Services +// Regions only from the Region in which the trail or event data store was created +// (also known as its home Region). func (c *Client) AddTags(ctx context.Context, params *AddTagsInput, optFns ...func(*Options)) (*AddTagsOutput, error) { if params == nil { params = &AddTagsInput{} @@ -34,11 +34,11 @@ func (c *Client) AddTags(ctx context.Context, params *AddTagsInput, optFns ...fu return out, nil } -// Specifies the tags to add to a trail, event data store, or channel. +// Specifies the tags to add to a trail, event data store, dashboard, or channel. type AddTagsInput struct { - // Specifies the ARN of the trail, event data store, or channel to which one or - // more tags will be added. + // Specifies the ARN of the trail, event data store, dashboard, or channel to + // which one or more tags will be added. // // The format of a trail ARN is: // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail @@ -46,6 +46,9 @@ type AddTagsInput struct { // The format of an event data store ARN is: // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE // + // The format of a dashboard ARN is: + // arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash + // // The format of a channel ARN is: // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 // diff --git a/service/cloudtrail/api_op_CancelQuery.go b/service/cloudtrail/api_op_CancelQuery.go index dcf59c41f68..f77add5f7fc 100644 --- a/service/cloudtrail/api_op_CancelQuery.go +++ b/service/cloudtrail/api_op_CancelQuery.go @@ -45,6 +45,9 @@ type CancelQueryInput struct { // Deprecated: EventDataStore is no longer required by CancelQueryRequest EventDataStore *string + // The account ID of the event data store owner. + EventDataStoreOwnerAccountId *string + noSmithyDocumentSerde } @@ -61,6 +64,9 @@ type CancelQueryOutput struct { // This member is required. QueryStatus types.QueryStatus + // The account ID of the event data store owner. + EventDataStoreOwnerAccountId *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/cloudtrail/api_op_CreateDashboard.go b/service/cloudtrail/api_op_CreateDashboard.go new file mode 100644 index 00000000000..650f4e463e2 --- /dev/null +++ b/service/cloudtrail/api_op_CreateDashboard.go @@ -0,0 +1,226 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a custom dashboard or the Highlights dashboard. +// +// - Custom dashboards - Custom dashboards allow you to query events in any +// event data store type. You can add up to 10 widgets to a custom dashboard. You +// can manually refresh a custom dashboard, or you can set a refresh schedule. +// +// - Highlights dashboard - You can create the Highlights dashboard to see a +// summary of key user activities and API usage across all your event data stores. +// CloudTrail Lake manages the Highlights dashboard and refreshes the dashboard +// every 6 hours. To create the Highlights dashboard, you must set and enable a +// refresh schedule. +// +// CloudTrail runs queries to populate the dashboard's widgets during a manual or +// scheduled refresh. CloudTrail must be granted permissions to run the StartQuery +// operation on your behalf. To provide permissions, run the PutResourcePolicy +// operation to attach a resource-based policy to each event data store. For more +// information, see [Example: Allow CloudTrail to run queries to populate a dashboard]in the CloudTrail User Guide. +// +// To set a refresh schedule, CloudTrail must be granted permissions to run the +// StartDashboardRefresh operation to refresh the dashboard on your behalf. To +// provide permissions, run the PutResourcePolicy operation to attach a +// resource-based policy to the dashboard. For more information, see [Resource-based policy example for a dashboard]in the +// CloudTrail User Guide. +// +// For more information about dashboards, see [CloudTrail Lake dashboards] in the CloudTrail User Guide. +// +// [CloudTrail Lake dashboards]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-dashboard.html +// [Example: Allow CloudTrail to run queries to populate a dashboard]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html#security_iam_resource-based-policy-examples-eds-dashboard +// [Resource-based policy example for a dashboard]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html#security_iam_resource-based-policy-examples-dashboards +func (c *Client) CreateDashboard(ctx context.Context, params *CreateDashboardInput, optFns ...func(*Options)) (*CreateDashboardOutput, error) { + if params == nil { + params = &CreateDashboardInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateDashboard", params, optFns, c.addOperationCreateDashboardMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateDashboardOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateDashboardInput struct { + + // The name of the dashboard. The name must be unique to your account. + // + // To create the Highlights dashboard, the name must be AWSCloudTrail-Highlights . + // + // This member is required. + Name *string + + // The refresh schedule configuration for the dashboard. + // + // To create the Highlights dashboard, you must set a refresh schedule and set the + // Status to ENABLED . The Unit for the refresh schedule must be HOURS and the + // Value must be 6 . + RefreshSchedule *types.RefreshSchedule + + // A list of tags. + TagsList []types.Tag + + // Specifies whether termination protection is enabled for the dashboard. If + // termination protection is enabled, you cannot delete the dashboard until + // termination protection is disabled. + TerminationProtectionEnabled *bool + + // An array of widgets for a custom dashboard. A custom dashboard can have a + // maximum of ten widgets. + // + // You do not need to specify widgets for the Highlights dashboard. + Widgets []types.RequestWidget + + noSmithyDocumentSerde +} + +type CreateDashboardOutput struct { + + // The ARN for the dashboard. + DashboardArn *string + + // The name of the dashboard. + Name *string + + // The refresh schedule for the dashboard, if configured. + RefreshSchedule *types.RefreshSchedule + + // A list of tags. + TagsList []types.Tag + + // Indicates whether termination protection is enabled for the dashboard. + TerminationProtectionEnabled *bool + + // The dashboard type. + Type types.DashboardType + + // An array of widgets for the dashboard. + Widgets []types.Widget + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateDashboardMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpCreateDashboard{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpCreateDashboard{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateDashboard"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateDashboardValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateDashboard(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateDashboard(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateDashboard", + } +} diff --git a/service/cloudtrail/api_op_DeleteDashboard.go b/service/cloudtrail/api_op_DeleteDashboard.go new file mode 100644 index 00000000000..a7a506ca8e0 --- /dev/null +++ b/service/cloudtrail/api_op_DeleteDashboard.go @@ -0,0 +1,154 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the specified dashboard. You cannot delete a dashboard that has +// +// termination protection enabled. +func (c *Client) DeleteDashboard(ctx context.Context, params *DeleteDashboardInput, optFns ...func(*Options)) (*DeleteDashboardOutput, error) { + if params == nil { + params = &DeleteDashboardInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteDashboard", params, optFns, c.addOperationDeleteDashboardMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteDashboardOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteDashboardInput struct { + + // The name or ARN for the dashboard. + // + // This member is required. + DashboardId *string + + noSmithyDocumentSerde +} + +type DeleteDashboardOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteDashboardMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteDashboard{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteDashboard{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteDashboard"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteDashboardValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteDashboard(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteDashboard(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteDashboard", + } +} diff --git a/service/cloudtrail/api_op_DeleteResourcePolicy.go b/service/cloudtrail/api_op_DeleteResourcePolicy.go index e84c520ef82..cd934a986a6 100644 --- a/service/cloudtrail/api_op_DeleteResourcePolicy.go +++ b/service/cloudtrail/api_op_DeleteResourcePolicy.go @@ -10,7 +10,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes the resource-based policy attached to the CloudTrail channel. +// Deletes the resource-based policy attached to the CloudTrail event data store, +// +// dashboard, or channel. func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourcePolicyInput, optFns ...func(*Options)) (*DeleteResourcePolicyOutput, error) { if params == nil { params = &DeleteResourcePolicyInput{} @@ -28,9 +30,17 @@ func (c *Client) DeleteResourcePolicy(ctx context.Context, params *DeleteResourc type DeleteResourcePolicyInput struct { - // The Amazon Resource Name (ARN) of the CloudTrail channel you're deleting the - // resource-based policy from. The following is the format of a resource ARN: - // arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel . + // The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, + // or channel you're deleting the resource-based policy from. + // + // Example event data store ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE + // + // Example dashboard ARN format: + // arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash + // + // Example channel ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 // // This member is required. ResourceArn *string diff --git a/service/cloudtrail/api_op_DescribeQuery.go b/service/cloudtrail/api_op_DescribeQuery.go index c7c75717aa1..72829724de6 100644 --- a/service/cloudtrail/api_op_DescribeQuery.go +++ b/service/cloudtrail/api_op_DescribeQuery.go @@ -16,8 +16,10 @@ import ( // were delivered to an S3 bucket, the response also provides the S3 URI and the // delivery status. // -// You must specify either a QueryID or a QueryAlias . Specifying the QueryAlias -// parameter returns information about the last query run for the alias. +// You must specify either QueryId or QueryAlias . Specifying the QueryAlias +// parameter returns information about the last query run for the alias. You can +// provide RefreshId along with QueryAlias to view the query results of a +// dashboard query for the specified RefreshId . func (c *Client) DescribeQuery(ctx context.Context, params *DescribeQueryInput, optFns ...func(*Options)) (*DescribeQueryOutput, error) { if params == nil { params = &DescribeQueryInput{} @@ -41,12 +43,18 @@ type DescribeQueryInput struct { // Deprecated: EventDataStore is no longer required by DescribeQueryRequest EventDataStore *string + // The account ID of the event data store owner. + EventDataStoreOwnerAccountId *string + // The alias that identifies a query template. QueryAlias *string // The query ID. QueryId *string + // The ID of the dashboard refresh. + RefreshId *string + noSmithyDocumentSerde } @@ -62,6 +70,9 @@ type DescribeQueryOutput struct { // The error message returned if a query failed. ErrorMessage *string + // The account ID of the event data store owner. + EventDataStoreOwnerAccountId *string + // The prompt used for a generated query. For information about generated // queries, see [Create CloudTrail Lake queries from natural language prompts]in the CloudTrail user guide. // diff --git a/service/cloudtrail/api_op_GenerateQuery.go b/service/cloudtrail/api_op_GenerateQuery.go index bf0994b90a6..19a8a6e959f 100644 --- a/service/cloudtrail/api_op_GenerateQuery.go +++ b/service/cloudtrail/api_op_GenerateQuery.go @@ -65,6 +65,9 @@ type GenerateQueryInput struct { type GenerateQueryOutput struct { + // The account ID of the event data store owner. + EventDataStoreOwnerAccountId *string + // An alias that identifies the prompt. When you run the StartQuery operation, // you can pass in either the QueryAlias or QueryStatement parameter. QueryAlias *string diff --git a/service/cloudtrail/api_op_GetDashboard.go b/service/cloudtrail/api_op_GetDashboard.go new file mode 100644 index 00000000000..138da8c4c03 --- /dev/null +++ b/service/cloudtrail/api_op_GetDashboard.go @@ -0,0 +1,185 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns the specified dashboard. +func (c *Client) GetDashboard(ctx context.Context, params *GetDashboardInput, optFns ...func(*Options)) (*GetDashboardOutput, error) { + if params == nil { + params = &GetDashboardInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetDashboard", params, optFns, c.addOperationGetDashboardMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetDashboardOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetDashboardInput struct { + + // The name or ARN for the dashboard. + // + // This member is required. + DashboardId *string + + noSmithyDocumentSerde +} + +type GetDashboardOutput struct { + + // The timestamp that shows when the dashboard was created. + CreatedTimestamp *time.Time + + // The ARN for the dashboard. + DashboardArn *string + + // Provides information about failures for the last scheduled refresh. + LastRefreshFailureReason *string + + // The ID of the last dashboard refresh. + LastRefreshId *string + + // The refresh schedule for the dashboard, if configured. + RefreshSchedule *types.RefreshSchedule + + // The status of the dashboard. + Status types.DashboardStatus + + // Indicates whether termination protection is enabled for the dashboard. + TerminationProtectionEnabled *bool + + // The type of dashboard. + Type types.DashboardType + + // The timestamp that shows when the dashboard was last updated. + UpdatedTimestamp *time.Time + + // An array of widgets for the dashboard. + Widgets []types.Widget + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetDashboardMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetDashboard{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetDashboard{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetDashboard"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetDashboardValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetDashboard(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetDashboard(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetDashboard", + } +} diff --git a/service/cloudtrail/api_op_GetQueryResults.go b/service/cloudtrail/api_op_GetQueryResults.go index 6116e1ad7a3..8c5603ce038 100644 --- a/service/cloudtrail/api_op_GetQueryResults.go +++ b/service/cloudtrail/api_op_GetQueryResults.go @@ -41,6 +41,9 @@ type GetQueryResultsInput struct { // Deprecated: EventDataStore is no longer required by GetQueryResultsRequest EventDataStore *string + // The account ID of the event data store owner. + EventDataStoreOwnerAccountId *string + // The maximum number of query results to display on a single page. MaxQueryResults *int32 diff --git a/service/cloudtrail/api_op_GetResourcePolicy.go b/service/cloudtrail/api_op_GetResourcePolicy.go index 56f66256642..eb13954c020 100644 --- a/service/cloudtrail/api_op_GetResourcePolicy.go +++ b/service/cloudtrail/api_op_GetResourcePolicy.go @@ -12,7 +12,7 @@ import ( // Retrieves the JSON text of the resource-based policy document attached to the // -// CloudTrail channel. +// CloudTrail event data store, dashboard, or channel. func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolicyInput, optFns ...func(*Options)) (*GetResourcePolicyOutput, error) { if params == nil { params = &GetResourcePolicyInput{} @@ -30,9 +30,17 @@ func (c *Client) GetResourcePolicy(ctx context.Context, params *GetResourcePolic type GetResourcePolicyInput struct { - // The Amazon Resource Name (ARN) of the CloudTrail channel attached to the - // resource-based policy. The following is the format of a resource ARN: - // arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel . + // The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, + // or channel attached to the resource-based policy. + // + // Example event data store ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE + // + // Example dashboard ARN format: + // arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash + // + // Example channel ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 // // This member is required. ResourceArn *string @@ -42,12 +50,29 @@ type GetResourcePolicyInput struct { type GetResourcePolicyOutput struct { - // The Amazon Resource Name (ARN) of the CloudTrail channel attached to - // resource-based policy. + // The default resource-based policy that is automatically generated for the + // delegated administrator of an Organizations organization. This policy will be + // evaluated in tandem with any policy you submit for the resource. For more + // information about this policy, see [Default resource policy for delegated administrators]. + // + // [Default resource policy for delegated administrators]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html#cloudtrail-lake-organizations-eds-rbp + DelegatedAdminResourcePolicy *string + + // The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, + // or channel attached to resource-based policy. + // + // Example event data store ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE + // + // Example dashboard ARN format: + // arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash + // + // Example channel ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 ResourceArn *string // A JSON-formatted string that contains the resource-based policy attached to - // the CloudTrail channel. + // the CloudTrail event data store, dashboard, or channel. ResourcePolicy *string // Metadata pertaining to the operation's result. diff --git a/service/cloudtrail/api_op_GetTrailStatus.go b/service/cloudtrail/api_op_GetTrailStatus.go index ba08b8403df..e4944c7af25 100644 --- a/service/cloudtrail/api_op_GetTrailStatus.go +++ b/service/cloudtrail/api_op_GetTrailStatus.go @@ -36,10 +36,14 @@ type GetTrailStatusInput struct { // Specifies the name or the CloudTrail ARN of the trail for which you are // requesting status. To get the status of a shadow trail (a replication of the - // trail in another Region), you must specify its ARN. The following is the format - // of a trail ARN. + // trail in another Region), you must specify its ARN. // - // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // The following is the format of a trail ARN: + // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail + // + // If the trail is an organization trail and you are a member account in the + // organization in Organizations, you must provide the full ARN of that trail, and + // not just the name. // // This member is required. Name *string diff --git a/service/cloudtrail/api_op_ListDashboards.go b/service/cloudtrail/api_op_ListDashboards.go new file mode 100644 index 00000000000..f4d552af392 --- /dev/null +++ b/service/cloudtrail/api_op_ListDashboards.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns information about all dashboards in the account, in the current +// +// Region. +func (c *Client) ListDashboards(ctx context.Context, params *ListDashboardsInput, optFns ...func(*Options)) (*ListDashboardsOutput, error) { + if params == nil { + params = &ListDashboardsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListDashboards", params, optFns, c.addOperationListDashboardsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListDashboardsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListDashboardsInput struct { + + // The maximum number of dashboards to display on a single page. + MaxResults *int32 + + // Specify a name prefix to filter on. + NamePrefix *string + + // A token you can use to get the next page of dashboard results. + NextToken *string + + // Specify a dashboard type to filter on: CUSTOM or MANAGED . + Type types.DashboardType + + noSmithyDocumentSerde +} + +type ListDashboardsOutput struct { + + // Contains information about dashboards in the account, in the current Region + // that match the applied filters. + Dashboards []types.DashboardDetail + + // A token you can use to get the next page of dashboard results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListDashboardsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListDashboards{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListDashboards{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListDashboards"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListDashboards(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListDashboards(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListDashboards", + } +} diff --git a/service/cloudtrail/api_op_ListInsightsMetricData.go b/service/cloudtrail/api_op_ListInsightsMetricData.go index ab1416d9860..7b05bfb6e2e 100644 --- a/service/cloudtrail/api_op_ListInsightsMetricData.go +++ b/service/cloudtrail/api_op_ListInsightsMetricData.go @@ -71,7 +71,7 @@ type ListInsightsMetricDataInput struct { // This member is required. InsightType types.InsightType - // Type of datapoints to return. Valid values are NonZeroData and FillWithZeros . + // Type of data points to return. Valid values are NonZeroData and FillWithZeros . // The default is NonZeroData . DataType types.InsightsMetricDataType @@ -88,8 +88,8 @@ type ListInsightsMetricDataInput struct { // error to retrieve data for. For example, AccessDenied . ErrorCode *string - // The maximum number of datapoints to return. Valid values are integers from 1 to - // 21600. The default value is 21600. + // The maximum number of data points to return. Valid values are integers from 1 + // to 21600. The default value is 21600. MaxResults *int32 // Returned if all datapoints can't be returned in a single call. For example, due @@ -257,8 +257,8 @@ func (c *Client) addOperationListInsightsMetricDataMiddlewares(stack *middleware // ListInsightsMetricDataPaginatorOptions is the paginator options for // ListInsightsMetricData type ListInsightsMetricDataPaginatorOptions struct { - // The maximum number of datapoints to return. Valid values are integers from 1 to - // 21600. The default value is 21600. + // The maximum number of data points to return. Valid values are integers from 1 + // to 21600. The default value is 21600. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/cloudtrail/api_op_ListTags.go b/service/cloudtrail/api_op_ListTags.go index 9499f2e80c9..aae61d57b8f 100644 --- a/service/cloudtrail/api_op_ListTags.go +++ b/service/cloudtrail/api_op_ListTags.go @@ -11,8 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Lists the tags for the specified trails, event data stores, or channels in the -// current Region. +// Lists the tags for the specified trails, event data stores, dashboards, or +// channels in the current Region. func (c *Client) ListTags(ctx context.Context, params *ListTagsInput, optFns ...func(*Options)) (*ListTagsOutput, error) { if params == nil { params = &ListTagsInput{} @@ -31,8 +31,8 @@ func (c *Client) ListTags(ctx context.Context, params *ListTagsInput, optFns ... // Specifies a list of tags to return. type ListTagsInput struct { - // Specifies a list of trail, event data store, or channel ARNs whose tags will be - // listed. The list has a limit of 20 ARNs. + // Specifies a list of trail, event data store, dashboard, or channel ARNs whose + // tags will be listed. The list has a limit of 20 ARNs. // // Example trail ARN format: // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail @@ -40,6 +40,9 @@ type ListTagsInput struct { // Example event data store ARN format: // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE // + // Example dashboard ARN format: + // arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash + // // Example channel ARN format: // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 // diff --git a/service/cloudtrail/api_op_PutResourcePolicy.go b/service/cloudtrail/api_op_PutResourcePolicy.go index 5f106c3c32a..586ada218cc 100644 --- a/service/cloudtrail/api_op_PutResourcePolicy.go +++ b/service/cloudtrail/api_op_PutResourcePolicy.go @@ -10,11 +10,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Attaches a resource-based permission policy to a CloudTrail channel that is +// Attaches a resource-based permission policy to a CloudTrail event data store, // -// used for an integration with an event source outside of Amazon Web Services. For -// more information about resource-based policies, see [CloudTrail resource-based policy examples]in the CloudTrail User -// Guide. +// dashboard, or channel. For more information about resource-based policies, see [CloudTrail resource-based policy examples] +// in the CloudTrail User Guide. // // [CloudTrail resource-based policy examples]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolicyInput, optFns ...func(*Options)) (*PutResourcePolicyOutput, error) { @@ -34,24 +33,26 @@ func (c *Client) PutResourcePolicy(ctx context.Context, params *PutResourcePolic type PutResourcePolicyInput struct { - // The Amazon Resource Name (ARN) of the CloudTrail channel attached to the - // resource-based policy. The following is the format of a resource ARN: - // arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel . + // The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, + // or channel attached to the resource-based policy. + // + // Example event data store ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE + // + // Example dashboard ARN format: + // arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash + // + // Example channel ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 // // This member is required. ResourceArn *string // A JSON-formatted string for an Amazon Web Services resource-based policy. // - // The following are requirements for the resource policy: - // - // - Contains only one action: cloudtrail-data:PutAuditEvents - // - // - Contains at least one statement. The policy can have a maximum of 20 - // statements. + // For example resource-based policies, see [CloudTrail resource-based policy examples] in the CloudTrail User Guide. // - // - Each statement contains at least one principal. A statement can have a - // maximum of 50 principals. + // [CloudTrail resource-based policy examples]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html // // This member is required. ResourcePolicy *string @@ -61,12 +62,29 @@ type PutResourcePolicyInput struct { type PutResourcePolicyOutput struct { - // The Amazon Resource Name (ARN) of the CloudTrail channel attached to the - // resource-based policy. + // The default resource-based policy that is automatically generated for the + // delegated administrator of an Organizations organization. This policy will be + // evaluated in tandem with any policy you submit for the resource. For more + // information about this policy, see [Default resource policy for delegated administrators]. + // + // [Default resource policy for delegated administrators]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/cloudtrail-lake-organizations.html#cloudtrail-lake-organizations-eds-rbp + DelegatedAdminResourcePolicy *string + + // The Amazon Resource Name (ARN) of the CloudTrail event data store, dashboard, + // or channel attached to the resource-based policy. + // + // Example event data store ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE + // + // Example dashboard ARN format: + // arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash + // + // Example channel ARN format: + // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 ResourceArn *string // The JSON-formatted string of the Amazon Web Services resource-based policy - // attached to the CloudTrail channel. + // attached to the CloudTrail event data store, dashboard, or channel. ResourcePolicy *string // Metadata pertaining to the operation's result. diff --git a/service/cloudtrail/api_op_RemoveTags.go b/service/cloudtrail/api_op_RemoveTags.go index 4824fc2bb28..a60312bd288 100644 --- a/service/cloudtrail/api_op_RemoveTags.go +++ b/service/cloudtrail/api_op_RemoveTags.go @@ -11,7 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Removes the specified tags from a trail, event data store, or channel. +// Removes the specified tags from a trail, event data store, dashboard, or +// channel. func (c *Client) RemoveTags(ctx context.Context, params *RemoveTagsInput, optFns ...func(*Options)) (*RemoveTagsOutput, error) { if params == nil { params = &RemoveTagsInput{} @@ -27,11 +28,12 @@ func (c *Client) RemoveTags(ctx context.Context, params *RemoveTagsInput, optFns return out, nil } -// Specifies the tags to remove from a trail, event data store, or channel. +// Specifies the tags to remove from a trail, event data store, dashboard, or +// channel. type RemoveTagsInput struct { - // Specifies the ARN of the trail, event data store, or channel from which tags - // should be removed. + // Specifies the ARN of the trail, event data store, dashboard, or channel from + // which tags should be removed. // // Example trail ARN format: // arn:aws:cloudtrail:us-east-2:123456789012:trail/MyTrail @@ -39,6 +41,9 @@ type RemoveTagsInput struct { // Example event data store ARN format: // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE // + // Example dashboard ARN format: + // arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash + // // Example channel ARN format: // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 // diff --git a/service/cloudtrail/api_op_StartDashboardRefresh.go b/service/cloudtrail/api_op_StartDashboardRefresh.go new file mode 100644 index 00000000000..59ebbf095c7 --- /dev/null +++ b/service/cloudtrail/api_op_StartDashboardRefresh.go @@ -0,0 +1,174 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Starts a refresh of the specified dashboard. +// +// Each time a dashboard is refreshed, CloudTrail runs queries to populate the +// dashboard's widgets. CloudTrail must be granted permissions to run the +// StartQuery operation on your behalf. To provide permissions, run the +// PutResourcePolicy operation to attach a resource-based policy to each event data +// store. For more information, see [Example: Allow CloudTrail to run queries to populate a dashboard]in the CloudTrail User Guide. +// +// [Example: Allow CloudTrail to run queries to populate a dashboard]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html#security_iam_resource-based-policy-examples-eds-dashboard +func (c *Client) StartDashboardRefresh(ctx context.Context, params *StartDashboardRefreshInput, optFns ...func(*Options)) (*StartDashboardRefreshOutput, error) { + if params == nil { + params = &StartDashboardRefreshInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartDashboardRefresh", params, optFns, c.addOperationStartDashboardRefreshMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartDashboardRefreshOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartDashboardRefreshInput struct { + + // The name or ARN of the dashboard. + // + // This member is required. + DashboardId *string + + // The query parameter values for the dashboard + // + // For custom dashboards, the following query parameters are valid: $StartTime$ , + // $EndTime$ , and $Period$ . + // + // For managed dashboards, the following query parameters are valid: $StartTime$ , + // $EndTime$ , $Period$ , and $EventDataStoreId$ . The $EventDataStoreId$ query + // parameter is required. + QueryParameterValues map[string]string + + noSmithyDocumentSerde +} + +type StartDashboardRefreshOutput struct { + + // The refresh ID for the dashboard. + RefreshId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartDashboardRefreshMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartDashboardRefresh{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartDashboardRefresh{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartDashboardRefresh"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartDashboardRefreshValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartDashboardRefresh(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartDashboardRefresh(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartDashboardRefresh", + } +} diff --git a/service/cloudtrail/api_op_StartQuery.go b/service/cloudtrail/api_op_StartQuery.go index 7aad4c283af..4b7dea9d23e 100644 --- a/service/cloudtrail/api_op_StartQuery.go +++ b/service/cloudtrail/api_op_StartQuery.go @@ -38,6 +38,9 @@ type StartQueryInput struct { // The URI for the S3 bucket where CloudTrail delivers the query results. DeliveryS3Uri *string + // The account ID of the event data store owner. + EventDataStoreOwnerAccountId *string + // The alias that identifies a query template. QueryAlias *string @@ -52,6 +55,9 @@ type StartQueryInput struct { type StartQueryOutput struct { + // The account ID of the event data store owner. + EventDataStoreOwnerAccountId *string + // The ID of the started query. QueryId *string diff --git a/service/cloudtrail/api_op_UpdateDashboard.go b/service/cloudtrail/api_op_UpdateDashboard.go new file mode 100644 index 00000000000..c370b9d763d --- /dev/null +++ b/service/cloudtrail/api_op_UpdateDashboard.go @@ -0,0 +1,213 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudtrail + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudtrail/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Updates the specified dashboard. +// +// To set a refresh schedule, CloudTrail must be granted permissions to run the +// StartDashboardRefresh operation to refresh the dashboard on your behalf. To +// provide permissions, run the PutResourcePolicy operation to attach a +// resource-based policy to the dashboard. For more information, see [Resource-based policy example for a dashboard]in the +// CloudTrail User Guide. +// +// CloudTrail runs queries to populate the dashboard's widgets during a manual or +// scheduled refresh. CloudTrail must be granted permissions to run the StartQuery +// operation on your behalf. To provide permissions, run the PutResourcePolicy +// operation to attach a resource-based policy to each event data store. For more +// information, see [Example: Allow CloudTrail to run queries to populate a dashboard]in the CloudTrail User Guide. +// +// [Example: Allow CloudTrail to run queries to populate a dashboard]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html#security_iam_resource-based-policy-examples-eds-dashboard +// [Resource-based policy example for a dashboard]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/security_iam_resource-based-policy-examples.html#security_iam_resource-based-policy-examples-dashboards +func (c *Client) UpdateDashboard(ctx context.Context, params *UpdateDashboardInput, optFns ...func(*Options)) (*UpdateDashboardOutput, error) { + if params == nil { + params = &UpdateDashboardInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateDashboard", params, optFns, c.addOperationUpdateDashboardMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateDashboardOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateDashboardInput struct { + + // The name or ARN of the dashboard. + // + // This member is required. + DashboardId *string + + // The refresh schedule configuration for the dashboard. + RefreshSchedule *types.RefreshSchedule + + // Specifies whether termination protection is enabled for the dashboard. If + // termination protection is enabled, you cannot delete the dashboard until + // termination protection is disabled. + TerminationProtectionEnabled *bool + + // An array of widgets for the dashboard. A custom dashboard can have a maximum + // of 10 widgets. + // + // To add new widgets, pass in an array that includes the existing widgets along + // with any new widgets. Run the GetDashboard operation to get the list of widgets + // for the dashboard. + // + // To remove widgets, pass in an array that includes the existing widgets minus + // the widgets you want removed. + Widgets []types.RequestWidget + + noSmithyDocumentSerde +} + +type UpdateDashboardOutput struct { + + // The timestamp that shows when the dashboard was created. + CreatedTimestamp *time.Time + + // The ARN for the dashboard. + DashboardArn *string + + // The name for the dashboard. + Name *string + + // The refresh schedule for the dashboard, if configured. + RefreshSchedule *types.RefreshSchedule + + // Indicates whether termination protection is enabled for the dashboard. + TerminationProtectionEnabled *bool + + // The type of dashboard. + Type types.DashboardType + + // The timestamp that shows when the dashboard was updated. + UpdatedTimestamp *time.Time + + // An array of widgets for the dashboard. + Widgets []types.Widget + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateDashboardMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpUpdateDashboard{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpUpdateDashboard{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateDashboard"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateDashboardValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateDashboard(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateDashboard(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateDashboard", + } +} diff --git a/service/cloudtrail/deserializers.go b/service/cloudtrail/deserializers.go index 9782776853c..903d56d9e31 100644 --- a/service/cloudtrail/deserializers.go +++ b/service/cloudtrail/deserializers.go @@ -469,6 +469,138 @@ func awsAwsjson11_deserializeOpErrorCreateChannel(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpCreateDashboard struct { +} + +func (*awsAwsjson11_deserializeOpCreateDashboard) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpCreateDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorCreateDashboard(response, &metadata) + } + output := &CreateDashboardOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentCreateDashboardOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorCreateDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("EventDataStoreNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreNotFoundException(response, errorBody) + + case strings.EqualFold("InactiveEventDataStoreException", errorCode): + return awsAwsjson11_deserializeErrorInactiveEventDataStoreException(response, errorBody) + + case strings.EqualFold("InsufficientEncryptionPolicyException", errorCode): + return awsAwsjson11_deserializeErrorInsufficientEncryptionPolicyException(response, errorBody) + + case strings.EqualFold("InvalidQueryStatementException", errorCode): + return awsAwsjson11_deserializeErrorInvalidQueryStatementException(response, errorBody) + + case strings.EqualFold("InvalidTagParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidTagParameterException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpCreateEventDataStore struct { } @@ -958,6 +1090,123 @@ func awsAwsjson11_deserializeOpErrorDeleteChannel(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpDeleteDashboard struct { +} + +func (*awsAwsjson11_deserializeOpDeleteDashboard) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteDashboard(response, &metadata) + } + output := &DeleteDashboardOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDeleteDashboardOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteEventDataStore struct { } @@ -1206,6 +1455,9 @@ func awsAwsjson11_deserializeOpErrorDeleteResourcePolicy(response *smithyhttp.Re errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) @@ -2326,14 +2578,14 @@ func awsAwsjson11_deserializeOpErrorGetChannel(response *smithyhttp.Response, me } } -type awsAwsjson11_deserializeOpGetEventDataStore struct { +type awsAwsjson11_deserializeOpGetDashboard struct { } -func (*awsAwsjson11_deserializeOpGetEventDataStore) ID() string { +func (*awsAwsjson11_deserializeOpGetDashboard) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpGetEventDataStore) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2351,9 +2603,9 @@ func (m *awsAwsjson11_deserializeOpGetEventDataStore) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorGetEventDataStore(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetDashboard(response, &metadata) } - output := &GetEventDataStoreOutput{} + output := &GetDashboardOutput{} out.Result = output var buff [1024]byte @@ -2373,7 +2625,7 @@ func (m *awsAwsjson11_deserializeOpGetEventDataStore) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentGetEventDataStoreOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetDashboardOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2387,7 +2639,7 @@ func (m *awsAwsjson11_deserializeOpGetEventDataStore) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorGetEventDataStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2424,17 +2676,131 @@ func awsAwsjson11_deserializeOpErrorGetEventDataStore(response *smithyhttp.Respo errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EventDataStoreARNInvalidException", errorCode): - return awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response, errorBody) - - case strings.EqualFold("EventDataStoreNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorEventDataStoreNotFoundException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) - case strings.EqualFold("NoManagementAccountSLRExistsException", errorCode): - return awsAwsjson11_deserializeErrorNoManagementAccountSLRExistsException(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpGetEventDataStore struct { +} + +func (*awsAwsjson11_deserializeOpGetEventDataStore) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetEventDataStore) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetEventDataStore(response, &metadata) + } + output := &GetEventDataStoreOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetEventDataStoreOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetEventDataStore(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("EventDataStoreARNInvalidException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response, errorBody) + + case strings.EqualFold("EventDataStoreNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreNotFoundException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("NoManagementAccountSLRExistsException", errorCode): + return awsAwsjson11_deserializeErrorNoManagementAccountSLRExistsException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) @@ -3466,6 +3832,117 @@ func awsAwsjson11_deserializeOpErrorListChannels(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpListDashboards struct { +} + +func (*awsAwsjson11_deserializeOpListDashboards) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListDashboards) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListDashboards(response, &metadata) + } + output := &ListDashboardsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListDashboardsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListDashboards(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListEventDataStores struct { } @@ -4995,6 +5472,9 @@ func awsAwsjson11_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) @@ -5470,14 +5950,14 @@ func awsAwsjson11_deserializeOpErrorRestoreEventDataStore(response *smithyhttp.R } } -type awsAwsjson11_deserializeOpStartEventDataStoreIngestion struct { +type awsAwsjson11_deserializeOpStartDashboardRefresh struct { } -func (*awsAwsjson11_deserializeOpStartEventDataStoreIngestion) ID() string { +func (*awsAwsjson11_deserializeOpStartDashboardRefresh) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartEventDataStoreIngestion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartDashboardRefresh) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5495,9 +5975,9 @@ func (m *awsAwsjson11_deserializeOpStartEventDataStoreIngestion) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartEventDataStoreIngestion(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartDashboardRefresh(response, &metadata) } - output := &StartEventDataStoreIngestionOutput{} + output := &StartDashboardRefreshOutput{} out.Result = output var buff [1024]byte @@ -5517,7 +5997,7 @@ func (m *awsAwsjson11_deserializeOpStartEventDataStoreIngestion) HandleDeseriali return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartEventDataStoreIngestionOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartDashboardRefreshOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5531,7 +6011,7 @@ func (m *awsAwsjson11_deserializeOpStartEventDataStoreIngestion) HandleDeseriali return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartEventDataStoreIngestion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartDashboardRefresh(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5568,29 +6048,152 @@ func awsAwsjson11_deserializeOpErrorStartEventDataStoreIngestion(response *smith errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("EventDataStoreARNInvalidException", errorCode): - return awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response, errorBody) - case strings.EqualFold("EventDataStoreNotFoundException", errorCode): return awsAwsjson11_deserializeErrorEventDataStoreNotFoundException(response, errorBody) - case strings.EqualFold("InsufficientDependencyServiceAccessPermissionException", errorCode): - return awsAwsjson11_deserializeErrorInsufficientDependencyServiceAccessPermissionException(response, errorBody) - - case strings.EqualFold("InvalidEventDataStoreCategoryException", errorCode): - return awsAwsjson11_deserializeErrorInvalidEventDataStoreCategoryException(response, errorBody) - - case strings.EqualFold("InvalidEventDataStoreStatusException", errorCode): - return awsAwsjson11_deserializeErrorInvalidEventDataStoreStatusException(response, errorBody) + case strings.EqualFold("InactiveEventDataStoreException", errorCode): + return awsAwsjson11_deserializeErrorInactiveEventDataStoreException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("NoManagementAccountSLRExistsException", errorCode): - return awsAwsjson11_deserializeErrorNoManagementAccountSLRExistsException(response, errorBody) + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) - case strings.EqualFold("NotOrganizationMasterAccountException", errorCode): - return awsAwsjson11_deserializeErrorNotOrganizationMasterAccountException(response, errorBody) + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartEventDataStoreIngestion struct { +} + +func (*awsAwsjson11_deserializeOpStartEventDataStoreIngestion) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartEventDataStoreIngestion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorStartEventDataStoreIngestion(response, &metadata) + } + output := &StartEventDataStoreIngestionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentStartEventDataStoreIngestionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorStartEventDataStoreIngestion(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("EventDataStoreARNInvalidException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreARNInvalidException(response, errorBody) + + case strings.EqualFold("EventDataStoreNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreNotFoundException(response, errorBody) + + case strings.EqualFold("InsufficientDependencyServiceAccessPermissionException", errorCode): + return awsAwsjson11_deserializeErrorInsufficientDependencyServiceAccessPermissionException(response, errorBody) + + case strings.EqualFold("InvalidEventDataStoreCategoryException", errorCode): + return awsAwsjson11_deserializeErrorInvalidEventDataStoreCategoryException(response, errorBody) + + case strings.EqualFold("InvalidEventDataStoreStatusException", errorCode): + return awsAwsjson11_deserializeErrorInvalidEventDataStoreStatusException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("NoManagementAccountSLRExistsException", errorCode): + return awsAwsjson11_deserializeErrorNoManagementAccountSLRExistsException(response, errorBody) + + case strings.EqualFold("NotOrganizationMasterAccountException", errorCode): + return awsAwsjson11_deserializeErrorNotOrganizationMasterAccountException(response, errorBody) case strings.EqualFold("OperationNotPermittedException", errorCode): return awsAwsjson11_deserializeErrorOperationNotPermittedException(response, errorBody) @@ -6580,6 +7183,138 @@ func awsAwsjson11_deserializeOpErrorUpdateChannel(response *smithyhttp.Response, } } +type awsAwsjson11_deserializeOpUpdateDashboard struct { +} + +func (*awsAwsjson11_deserializeOpUpdateDashboard) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUpdateDashboard) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUpdateDashboard(response, &metadata) + } + output := &UpdateDashboardOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentUpdateDashboardOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorUpdateDashboard(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson11_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("EventDataStoreNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorEventDataStoreNotFoundException(response, errorBody) + + case strings.EqualFold("InactiveEventDataStoreException", errorCode): + return awsAwsjson11_deserializeErrorInactiveEventDataStoreException(response, errorBody) + + case strings.EqualFold("InsufficientEncryptionPolicyException", errorCode): + return awsAwsjson11_deserializeErrorInsufficientEncryptionPolicyException(response, errorBody) + + case strings.EqualFold("InvalidQueryStatementException", errorCode): + return awsAwsjson11_deserializeErrorInvalidQueryStatementException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpUpdateEventDataStore struct { } @@ -9685,7 +10420,42 @@ func awsAwsjson11_deserializeErrorS3BucketDoesNotExistException(response *smithy return output } -func awsAwsjson11_deserializeErrorTagsLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorServiceQuotaExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ServiceQuotaExceededException{} + err := awsAwsjson11_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 awsAwsjson11_deserializeErrorTagsLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -10841,6 +11611,89 @@ func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } +func awsAwsjson11_deserializeDocumentDashboardDetail(v **types.DashboardDetail, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DashboardDetail + if *v == nil { + sv = &types.DashboardDetail{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DashboardArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DashboardArn to be of type string, got %T instead", value) + } + sv.DashboardArn = ptr.String(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DashboardType to be of type string, got %T instead", value) + } + sv.Type = types.DashboardType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDashboards(v *[]types.DashboardDetail, 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.DashboardDetail + if *v == nil { + cv = []types.DashboardDetail{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DashboardDetail + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDashboardDetail(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentDataResource(v **types.DataResource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14653,6 +15506,42 @@ func awsAwsjson11_deserializeDocumentQueryIdNotFoundException(v **types.QueryIdN return nil } +func awsAwsjson11_deserializeDocumentQueryParameters(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 QueryParameter to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentQueryResultColumn(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14922,6 +15811,113 @@ func awsAwsjson11_deserializeDocumentQueryStatisticsForDescribeQuery(v **types.Q return nil } +func awsAwsjson11_deserializeDocumentRefreshSchedule(v **types.RefreshSchedule, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RefreshSchedule + if *v == nil { + sv = &types.RefreshSchedule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Frequency": + if err := awsAwsjson11_deserializeDocumentRefreshScheduleFrequency(&sv.Frequency, value); err != nil { + return err + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RefreshScheduleStatus to be of type string, got %T instead", value) + } + sv.Status = types.RefreshScheduleStatus(jtv) + } + + case "TimeOfDay": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeOfDay to be of type string, got %T instead", value) + } + sv.TimeOfDay = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRefreshScheduleFrequency(v **types.RefreshScheduleFrequency, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RefreshScheduleFrequency + if *v == nil { + sv = &types.RefreshScheduleFrequency{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RefreshScheduleFrequencyUnit to be of type string, got %T instead", value) + } + sv.Unit = types.RefreshScheduleFrequencyUnit(jtv) + } + + case "Value": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected RefreshScheduleFrequencyValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Value = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentResource(v **types.Resource, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15382,7 +16378,7 @@ func awsAwsjson11_deserializeDocumentS3ImportSource(v **types.S3ImportSource, va return nil } -func awsAwsjson11_deserializeDocumentSourceConfig(v **types.SourceConfig, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15395,27 +16391,22 @@ func awsAwsjson11_deserializeDocumentSourceConfig(v **types.SourceConfig, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SourceConfig + var sv *types.ServiceQuotaExceededException if *v == nil { - sv = &types.SourceConfig{} + sv = &types.ServiceQuotaExceededException{} } else { sv = *v } for key, value := range shape { switch key { - case "AdvancedEventSelectors": - if err := awsAwsjson11_deserializeDocumentAdvancedEventSelectors(&sv.AdvancedEventSelectors, value); err != nil { - return err - } - - case "ApplyToAllRegions": + case "message", "Message": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) } - sv.ApplyToAllRegions = ptr.Bool(jtv) + sv.Message = ptr.String(jtv) } default: @@ -15427,7 +16418,7 @@ func awsAwsjson11_deserializeDocumentSourceConfig(v **types.SourceConfig, value return nil } -func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { +func awsAwsjson11_deserializeDocumentSourceConfig(v **types.SourceConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -15440,18 +16431,63 @@ func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Tag + var sv *types.SourceConfig if *v == nil { - sv = &types.Tag{} + sv = &types.SourceConfig{} } else { sv = *v } for key, value := range shape { switch key { - case "Key": + case "AdvancedEventSelectors": + if err := awsAwsjson11_deserializeDocumentAdvancedEventSelectors(&sv.AdvancedEventSelectors, value); err != nil { + return err + } + + case "ApplyToAllRegions": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.ApplyToAllRegions = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTag(v **types.Tag, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.Tag + if *v == nil { + sv = &types.Tag{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Key": + if value != nil { + jtv, ok := value.(string) if !ok { return fmt.Errorf("expected TagKey to be of type string, got %T instead", value) } @@ -16094,6 +17130,135 @@ func awsAwsjson11_deserializeDocumentUnsupportedOperationException(v **types.Uns return nil } +func awsAwsjson11_deserializeDocumentViewPropertiesMap(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 ViewPropertiesValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson11_deserializeDocumentWidget(v **types.Widget, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Widget + if *v == nil { + sv = &types.Widget{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "QueryAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryAlias to be of type string, got %T instead", value) + } + sv.QueryAlias = ptr.String(jtv) + } + + case "QueryParameters": + if err := awsAwsjson11_deserializeDocumentQueryParameters(&sv.QueryParameters, value); err != nil { + return err + } + + case "QueryStatement": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryStatement to be of type string, got %T instead", value) + } + sv.QueryStatement = ptr.String(jtv) + } + + case "ViewProperties": + if err := awsAwsjson11_deserializeDocumentViewPropertiesMap(&sv.ViewProperties, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentWidgetList(v *[]types.Widget, 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.Widget + if *v == nil { + cv = []types.Widget{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Widget + destAddr := &col + if err := awsAwsjson11_deserializeDocumentWidget(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeOpDocumentAddTagsOutput(v **AddTagsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16147,6 +17312,15 @@ func awsAwsjson11_deserializeOpDocumentCancelQueryOutput(v **CancelQueryOutput, for key, value := range shape { switch key { + case "EventDataStoreOwnerAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.EventDataStoreOwnerAccountId = ptr.String(jtv) + } + case "QueryId": if value != nil { jtv, ok := value.(string) @@ -16242,6 +17416,88 @@ func awsAwsjson11_deserializeOpDocumentCreateChannelOutput(v **CreateChannelOutp return nil } +func awsAwsjson11_deserializeOpDocumentCreateDashboardOutput(v **CreateDashboardOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateDashboardOutput + if *v == nil { + sv = &CreateDashboardOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DashboardArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DashboardArn to be of type string, got %T instead", value) + } + sv.DashboardArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DashboardName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RefreshSchedule": + if err := awsAwsjson11_deserializeDocumentRefreshSchedule(&sv.RefreshSchedule, value); err != nil { + return err + } + + case "TagsList": + if err := awsAwsjson11_deserializeDocumentTagsList(&sv.TagsList, value); err != nil { + return err + } + + case "TerminationProtectionEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected TerminationProtectionEnabled to be of type *bool, got %T instead", value) + } + sv.TerminationProtectionEnabled = ptr.Bool(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DashboardType to be of type string, got %T instead", value) + } + sv.Type = types.DashboardType(jtv) + } + + case "Widgets": + if err := awsAwsjson11_deserializeDocumentWidgetList(&sv.Widgets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentCreateEventDataStoreOutput(v **CreateEventDataStoreOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16579,6 +17835,37 @@ func awsAwsjson11_deserializeOpDocumentDeleteChannelOutput(v **DeleteChannelOutp return nil } +func awsAwsjson11_deserializeOpDocumentDeleteDashboardOutput(v **DeleteDashboardOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteDashboardOutput + if *v == nil { + sv = &DeleteDashboardOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteEventDataStoreOutput(v **DeleteEventDataStoreOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16752,6 +18039,15 @@ func awsAwsjson11_deserializeOpDocumentDescribeQueryOutput(v **DescribeQueryOutp sv.ErrorMessage = ptr.String(jtv) } + case "EventDataStoreOwnerAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.EventDataStoreOwnerAccountId = ptr.String(jtv) + } + case "Prompt": if value != nil { jtv, ok := value.(string) @@ -16967,6 +18263,15 @@ func awsAwsjson11_deserializeOpDocumentGenerateQueryOutput(v **GenerateQueryOutp for key, value := range shape { switch key { + case "EventDataStoreOwnerAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.EventDataStoreOwnerAccountId = ptr.String(jtv) + } + case "QueryAlias": if value != nil { jtv, ok := value.(string) @@ -17007,54 +18312,181 @@ func awsAwsjson11_deserializeOpDocumentGetChannelOutput(v **GetChannelOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetChannelOutput - if *v == nil { - sv = &GetChannelOutput{} - } else { - sv = *v - } + var sv *GetChannelOutput + if *v == nil { + sv = &GetChannelOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ChannelArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChannelArn to be of type string, got %T instead", value) + } + sv.ChannelArn = ptr.String(jtv) + } + + case "Destinations": + if err := awsAwsjson11_deserializeDocumentDestinations(&sv.Destinations, value); err != nil { + return err + } + + case "IngestionStatus": + if err := awsAwsjson11_deserializeDocumentIngestionStatus(&sv.IngestionStatus, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ChannelName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "SourceConfig": + if err := awsAwsjson11_deserializeDocumentSourceConfig(&sv.SourceConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentGetDashboardOutput(v **GetDashboardOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetDashboardOutput + if *v == nil { + sv = &GetDashboardOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) + + } + } - for key, value := range shape { - switch key { - case "ChannelArn": + case "DashboardArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChannelArn to be of type string, got %T instead", value) + return fmt.Errorf("expected DashboardArn to be of type string, got %T instead", value) } - sv.ChannelArn = ptr.String(jtv) + sv.DashboardArn = ptr.String(jtv) } - case "Destinations": - if err := awsAwsjson11_deserializeDocumentDestinations(&sv.Destinations, value); err != nil { - return err + case "LastRefreshFailureReason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.LastRefreshFailureReason = ptr.String(jtv) } - case "IngestionStatus": - if err := awsAwsjson11_deserializeDocumentIngestionStatus(&sv.IngestionStatus, value); err != nil { + case "LastRefreshId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RefreshId to be of type string, got %T instead", value) + } + sv.LastRefreshId = ptr.String(jtv) + } + + case "RefreshSchedule": + if err := awsAwsjson11_deserializeDocumentRefreshSchedule(&sv.RefreshSchedule, value); err != nil { return err } - case "Name": + case "Status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ChannelName to be of type string, got %T instead", value) + return fmt.Errorf("expected DashboardStatus to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Status = types.DashboardStatus(jtv) } - case "Source": + case "TerminationProtectionEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected TerminationProtectionEnabled to be of type *bool, got %T instead", value) + } + sv.TerminationProtectionEnabled = ptr.Bool(jtv) + } + + case "Type": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Source to be of type string, got %T instead", value) + return fmt.Errorf("expected DashboardType to be of type string, got %T instead", value) } - sv.Source = ptr.String(jtv) + sv.Type = types.DashboardType(jtv) } - case "SourceConfig": - if err := awsAwsjson11_deserializeDocumentSourceConfig(&sv.SourceConfig, value); err != nil { + case "UpdatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) + + } + } + + case "Widgets": + if err := awsAwsjson11_deserializeDocumentWidgetList(&sv.Widgets, value); err != nil { return err } @@ -17574,6 +19006,15 @@ func awsAwsjson11_deserializeOpDocumentGetResourcePolicyOutput(v **GetResourcePo for key, value := range shape { switch key { + case "DelegatedAdminResourcePolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicy to be of type string, got %T instead", value) + } + sv.DelegatedAdminResourcePolicy = ptr.String(jtv) + } + case "ResourceArn": if value != nil { jtv, ok := value.(string) @@ -17908,6 +19349,51 @@ func awsAwsjson11_deserializeOpDocumentListChannelsOutput(v **ListChannelsOutput return nil } +func awsAwsjson11_deserializeOpDocumentListDashboardsOutput(v **ListDashboardsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDashboardsOutput + if *v == nil { + sv = &ListDashboardsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Dashboards": + if err := awsAwsjson11_deserializeDocumentDashboards(&sv.Dashboards, 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 +} + func awsAwsjson11_deserializeOpDocumentListEventDataStoresOutput(v **ListEventDataStoresOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18489,6 +19975,15 @@ func awsAwsjson11_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePo for key, value := range shape { switch key { + case "DelegatedAdminResourcePolicy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourcePolicy to be of type string, got %T instead", value) + } + sv.DelegatedAdminResourcePolicy = ptr.String(jtv) + } + case "ResourceArn": if value != nil { jtv, ok := value.(string) @@ -18731,6 +20226,46 @@ func awsAwsjson11_deserializeOpDocumentRestoreEventDataStoreOutput(v **RestoreEv return nil } +func awsAwsjson11_deserializeOpDocumentStartDashboardRefreshOutput(v **StartDashboardRefreshOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartDashboardRefreshOutput + if *v == nil { + sv = &StartDashboardRefreshOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RefreshId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RefreshId to be of type string, got %T instead", value) + } + sv.RefreshId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentStartEventDataStoreIngestionOutput(v **StartEventDataStoreIngestionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -18938,6 +20473,15 @@ func awsAwsjson11_deserializeOpDocumentStartQueryOutput(v **StartQueryOutput, va for key, value := range shape { switch key { + case "EventDataStoreOwnerAccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.EventDataStoreOwnerAccountId = ptr.String(jtv) + } + case "QueryId": if value != nil { jtv, ok := value.(string) @@ -19209,6 +20753,115 @@ func awsAwsjson11_deserializeOpDocumentUpdateChannelOutput(v **UpdateChannelOutp return nil } +func awsAwsjson11_deserializeOpDocumentUpdateDashboardOutput(v **UpdateDashboardOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateDashboardOutput + if *v == nil { + sv = &UpdateDashboardOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CreatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) + + } + } + + case "DashboardArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DashboardArn to be of type string, got %T instead", value) + } + sv.DashboardArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DashboardName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "RefreshSchedule": + if err := awsAwsjson11_deserializeDocumentRefreshSchedule(&sv.RefreshSchedule, value); err != nil { + return err + } + + case "TerminationProtectionEnabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected TerminationProtectionEnabled to be of type *bool, got %T instead", value) + } + sv.TerminationProtectionEnabled = ptr.Bool(jtv) + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DashboardType to be of type string, got %T instead", value) + } + sv.Type = types.DashboardType(jtv) + } + + case "UpdatedTimestamp": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.UpdatedTimestamp = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Date to be a JSON Number, got %T instead", value) + + } + } + + case "Widgets": + if err := awsAwsjson11_deserializeDocumentWidgetList(&sv.Widgets, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateEventDataStoreOutput(v **UpdateEventDataStoreOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/cloudtrail/generated.json b/service/cloudtrail/generated.json index 0f5acfb5881..c5de6530cc0 100644 --- a/service/cloudtrail/generated.json +++ b/service/cloudtrail/generated.json @@ -11,9 +11,11 @@ "api_op_AddTags.go", "api_op_CancelQuery.go", "api_op_CreateChannel.go", + "api_op_CreateDashboard.go", "api_op_CreateEventDataStore.go", "api_op_CreateTrail.go", "api_op_DeleteChannel.go", + "api_op_DeleteDashboard.go", "api_op_DeleteEventDataStore.go", "api_op_DeleteResourcePolicy.go", "api_op_DeleteTrail.go", @@ -24,6 +26,7 @@ "api_op_EnableFederation.go", "api_op_GenerateQuery.go", "api_op_GetChannel.go", + "api_op_GetDashboard.go", "api_op_GetEventDataStore.go", "api_op_GetEventSelectors.go", "api_op_GetImport.go", @@ -33,6 +36,7 @@ "api_op_GetTrail.go", "api_op_GetTrailStatus.go", "api_op_ListChannels.go", + "api_op_ListDashboards.go", "api_op_ListEventDataStores.go", "api_op_ListImportFailures.go", "api_op_ListImports.go", @@ -48,6 +52,7 @@ "api_op_RegisterOrganizationDelegatedAdmin.go", "api_op_RemoveTags.go", "api_op_RestoreEventDataStore.go", + "api_op_StartDashboardRefresh.go", "api_op_StartEventDataStoreIngestion.go", "api_op_StartImport.go", "api_op_StartLogging.go", @@ -56,6 +61,7 @@ "api_op_StopImport.go", "api_op_StopLogging.go", "api_op_UpdateChannel.go", + "api_op_UpdateDashboard.go", "api_op_UpdateEventDataStore.go", "api_op_UpdateTrail.go", "auth.go", diff --git a/service/cloudtrail/serializers.go b/service/cloudtrail/serializers.go index 2138f3c9da1..5c29cf115fc 100644 --- a/service/cloudtrail/serializers.go +++ b/service/cloudtrail/serializers.go @@ -200,6 +200,67 @@ func (m *awsAwsjson11_serializeOpCreateChannel) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpCreateDashboard struct { +} + +func (*awsAwsjson11_serializeOpCreateDashboard) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpCreateDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateDashboardInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.CreateDashboard") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentCreateDashboardInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpCreateEventDataStore struct { } @@ -383,6 +444,67 @@ func (m *awsAwsjson11_serializeOpDeleteChannel) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteDashboard struct { +} + +func (*awsAwsjson11_serializeOpDeleteDashboard) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteDashboardInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.DeleteDashboard") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteDashboardInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteEventDataStore struct { } @@ -993,6 +1115,67 @@ func (m *awsAwsjson11_serializeOpGetChannel) HandleSerialize(ctx context.Context return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetDashboard struct { +} + +func (*awsAwsjson11_serializeOpGetDashboard) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetDashboardInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.GetDashboard") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetDashboardInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetEventDataStore struct { } @@ -1542,6 +1725,67 @@ func (m *awsAwsjson11_serializeOpListChannels) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListDashboards struct { +} + +func (*awsAwsjson11_serializeOpListDashboards) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListDashboards) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListDashboardsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.ListDashboards") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListDashboardsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListEventDataStores struct { } @@ -2457,14 +2701,14 @@ func (m *awsAwsjson11_serializeOpRestoreEventDataStore) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpStartEventDataStoreIngestion struct { +type awsAwsjson11_serializeOpStartDashboardRefresh struct { } -func (*awsAwsjson11_serializeOpStartEventDataStoreIngestion) ID() string { +func (*awsAwsjson11_serializeOpStartDashboardRefresh) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpStartEventDataStoreIngestion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartDashboardRefresh) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2476,7 +2720,7 @@ func (m *awsAwsjson11_serializeOpStartEventDataStoreIngestion) HandleSerialize(c return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartEventDataStoreIngestionInput) + input, ok := in.Parameters.(*StartDashboardRefreshInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2497,10 +2741,10 @@ func (m *awsAwsjson11_serializeOpStartEventDataStoreIngestion) HandleSerialize(c return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.StartEventDataStoreIngestion") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.StartDashboardRefresh") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartEventDataStoreIngestionInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentStartDashboardRefreshInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2518,14 +2762,14 @@ func (m *awsAwsjson11_serializeOpStartEventDataStoreIngestion) HandleSerialize(c return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpStartImport struct { +type awsAwsjson11_serializeOpStartEventDataStoreIngestion struct { } -func (*awsAwsjson11_serializeOpStartImport) ID() string { +func (*awsAwsjson11_serializeOpStartEventDataStoreIngestion) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpStartImport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartEventDataStoreIngestion) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2537,7 +2781,7 @@ func (m *awsAwsjson11_serializeOpStartImport) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartImportInput) + input, ok := in.Parameters.(*StartEventDataStoreIngestionInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2558,10 +2802,10 @@ func (m *awsAwsjson11_serializeOpStartImport) HandleSerialize(ctx context.Contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.StartImport") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.StartEventDataStoreIngestion") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartImportInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentStartEventDataStoreIngestionInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2579,14 +2823,14 @@ func (m *awsAwsjson11_serializeOpStartImport) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpStartLogging struct { +type awsAwsjson11_serializeOpStartImport struct { } -func (*awsAwsjson11_serializeOpStartLogging) ID() string { +func (*awsAwsjson11_serializeOpStartImport) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpStartLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartImport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2598,7 +2842,7 @@ func (m *awsAwsjson11_serializeOpStartLogging) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*StartLoggingInput) + input, ok := in.Parameters.(*StartImportInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2619,10 +2863,10 @@ func (m *awsAwsjson11_serializeOpStartLogging) HandleSerialize(ctx context.Conte return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.StartLogging") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.StartImport") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentStartLoggingInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentStartImportInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -2640,14 +2884,75 @@ func (m *awsAwsjson11_serializeOpStartLogging) HandleSerialize(ctx context.Conte return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpStartQuery struct { +type awsAwsjson11_serializeOpStartLogging struct { } -func (*awsAwsjson11_serializeOpStartQuery) ID() string { +func (*awsAwsjson11_serializeOpStartLogging) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpStartQuery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpStartLogging) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartLoggingInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.StartLogging") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStartLoggingInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpStartQuery struct { +} + +func (*awsAwsjson11_serializeOpStartQuery) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStartQuery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2945,6 +3250,67 @@ func (m *awsAwsjson11_serializeOpUpdateChannel) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpUpdateDashboard struct { +} + +func (*awsAwsjson11_serializeOpUpdateDashboard) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateDashboard) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateDashboardInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("CloudTrail_20131101.UpdateDashboard") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUpdateDashboardInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpUpdateEventDataStore struct { } @@ -3406,6 +3772,97 @@ func awsAwsjson11_serializeDocumentQueryParameters(v []string, value smithyjson. return nil } +func awsAwsjson11_serializeDocumentQueryParameterValues(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 awsAwsjson11_serializeDocumentRefreshSchedule(v *types.RefreshSchedule, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Frequency != nil { + ok := object.Key("Frequency") + if err := awsAwsjson11_serializeDocumentRefreshScheduleFrequency(v.Frequency, ok); err != nil { + return err + } + } + + if len(v.Status) > 0 { + ok := object.Key("Status") + ok.String(string(v.Status)) + } + + if v.TimeOfDay != nil { + ok := object.Key("TimeOfDay") + ok.String(*v.TimeOfDay) + } + + return nil +} + +func awsAwsjson11_serializeDocumentRefreshScheduleFrequency(v *types.RefreshScheduleFrequency, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Unit) > 0 { + ok := object.Key("Unit") + ok.String(string(v.Unit)) + } + + if v.Value != nil { + ok := object.Key("Value") + ok.Integer(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentRequestWidget(v *types.RequestWidget, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.QueryParameters != nil { + ok := object.Key("QueryParameters") + if err := awsAwsjson11_serializeDocumentQueryParameters(v.QueryParameters, ok); err != nil { + return err + } + } + + if v.QueryStatement != nil { + ok := object.Key("QueryStatement") + ok.String(*v.QueryStatement) + } + + if v.ViewProperties != nil { + ok := object.Key("ViewProperties") + if err := awsAwsjson11_serializeDocumentViewPropertiesMap(v.ViewProperties, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentRequestWidgetList(v []types.RequestWidget, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentRequestWidget(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsAwsjson11_serializeDocumentResourceIdList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3480,6 +3937,17 @@ func awsAwsjson11_serializeDocumentTrailNameList(v []string, value smithyjson.Va return nil } +func awsAwsjson11_serializeDocumentViewPropertiesMap(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 awsAwsjson11_serializeOpDocumentAddTagsInput(v *AddTagsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3508,6 +3976,11 @@ func awsAwsjson11_serializeOpDocumentCancelQueryInput(v *CancelQueryInput, value ok.String(*v.EventDataStore) } + if v.EventDataStoreOwnerAccountId != nil { + ok := object.Key("EventDataStoreOwnerAccountId") + ok.String(*v.EventDataStoreOwnerAccountId) + } + if v.QueryId != nil { ok := object.Key("QueryId") ok.String(*v.QueryId) @@ -3547,6 +4020,44 @@ func awsAwsjson11_serializeOpDocumentCreateChannelInput(v *CreateChannelInput, v return nil } +func awsAwsjson11_serializeOpDocumentCreateDashboardInput(v *CreateDashboardInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.RefreshSchedule != nil { + ok := object.Key("RefreshSchedule") + if err := awsAwsjson11_serializeDocumentRefreshSchedule(v.RefreshSchedule, ok); err != nil { + return err + } + } + + if v.TagsList != nil { + ok := object.Key("TagsList") + if err := awsAwsjson11_serializeDocumentTagsList(v.TagsList, ok); err != nil { + return err + } + } + + if v.TerminationProtectionEnabled != nil { + ok := object.Key("TerminationProtectionEnabled") + ok.Boolean(*v.TerminationProtectionEnabled) + } + + if v.Widgets != nil { + ok := object.Key("Widgets") + if err := awsAwsjson11_serializeDocumentRequestWidgetList(v.Widgets, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentCreateEventDataStoreInput(v *CreateEventDataStoreInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3689,6 +4200,18 @@ func awsAwsjson11_serializeOpDocumentDeleteChannelInput(v *DeleteChannelInput, v return nil } +func awsAwsjson11_serializeOpDocumentDeleteDashboardInput(v *DeleteDashboardInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DashboardId != nil { + ok := object.Key("DashboardId") + ok.String(*v.DashboardId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteEventDataStoreInput(v *DeleteEventDataStoreInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3746,6 +4269,11 @@ func awsAwsjson11_serializeOpDocumentDescribeQueryInput(v *DescribeQueryInput, v ok.String(*v.EventDataStore) } + if v.EventDataStoreOwnerAccountId != nil { + ok := object.Key("EventDataStoreOwnerAccountId") + ok.String(*v.EventDataStoreOwnerAccountId) + } + if v.QueryAlias != nil { ok := object.Key("QueryAlias") ok.String(*v.QueryAlias) @@ -3756,6 +4284,11 @@ func awsAwsjson11_serializeOpDocumentDescribeQueryInput(v *DescribeQueryInput, v ok.String(*v.QueryId) } + if v.RefreshId != nil { + ok := object.Key("RefreshId") + ok.String(*v.RefreshId) + } + return nil } @@ -3838,6 +4371,18 @@ func awsAwsjson11_serializeOpDocumentGetChannelInput(v *GetChannelInput, value s return nil } +func awsAwsjson11_serializeOpDocumentGetDashboardInput(v *GetDashboardInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DashboardId != nil { + ok := object.Key("DashboardId") + ok.String(*v.DashboardId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetEventDataStoreInput(v *GetEventDataStoreInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3900,6 +4445,11 @@ func awsAwsjson11_serializeOpDocumentGetQueryResultsInput(v *GetQueryResultsInpu ok.String(*v.EventDataStore) } + if v.EventDataStoreOwnerAccountId != nil { + ok := object.Key("EventDataStoreOwnerAccountId") + ok.String(*v.EventDataStoreOwnerAccountId) + } + if v.MaxQueryResults != nil { ok := object.Key("MaxQueryResults") ok.Integer(*v.MaxQueryResults) @@ -3971,6 +4521,33 @@ func awsAwsjson11_serializeOpDocumentListChannelsInput(v *ListChannelsInput, val return nil } +func awsAwsjson11_serializeOpDocumentListDashboardsInput(v *ListDashboardsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("MaxResults") + ok.Integer(*v.MaxResults) + } + + if v.NamePrefix != nil { + ok := object.Key("NamePrefix") + ok.String(*v.NamePrefix) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListEventDataStoresInput(v *ListEventDataStoresInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4338,6 +4915,25 @@ func awsAwsjson11_serializeOpDocumentRestoreEventDataStoreInput(v *RestoreEventD return nil } +func awsAwsjson11_serializeOpDocumentStartDashboardRefreshInput(v *StartDashboardRefreshInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DashboardId != nil { + ok := object.Key("DashboardId") + ok.String(*v.DashboardId) + } + + if v.QueryParameterValues != nil { + ok := object.Key("QueryParameterValues") + if err := awsAwsjson11_serializeDocumentQueryParameterValues(v.QueryParameterValues, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentStartEventDataStoreIngestionInput(v *StartEventDataStoreIngestionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4407,6 +5003,11 @@ func awsAwsjson11_serializeOpDocumentStartQueryInput(v *StartQueryInput, value s ok.String(*v.DeliveryS3Uri) } + if v.EventDataStoreOwnerAccountId != nil { + ok := object.Key("EventDataStoreOwnerAccountId") + ok.String(*v.EventDataStoreOwnerAccountId) + } + if v.QueryAlias != nil { ok := object.Key("QueryAlias") ok.String(*v.QueryAlias) @@ -4487,6 +5088,37 @@ func awsAwsjson11_serializeOpDocumentUpdateChannelInput(v *UpdateChannelInput, v return nil } +func awsAwsjson11_serializeOpDocumentUpdateDashboardInput(v *UpdateDashboardInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DashboardId != nil { + ok := object.Key("DashboardId") + ok.String(*v.DashboardId) + } + + if v.RefreshSchedule != nil { + ok := object.Key("RefreshSchedule") + if err := awsAwsjson11_serializeDocumentRefreshSchedule(v.RefreshSchedule, ok); err != nil { + return err + } + } + + if v.TerminationProtectionEnabled != nil { + ok := object.Key("TerminationProtectionEnabled") + ok.Boolean(*v.TerminationProtectionEnabled) + } + + if v.Widgets != nil { + ok := object.Key("Widgets") + if err := awsAwsjson11_serializeDocumentRequestWidgetList(v.Widgets, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUpdateEventDataStoreInput(v *UpdateEventDataStoreInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/cloudtrail/snapshot/api_op_CreateDashboard.go.snap b/service/cloudtrail/snapshot/api_op_CreateDashboard.go.snap new file mode 100644 index 00000000000..92c8f18ba28 --- /dev/null +++ b/service/cloudtrail/snapshot/api_op_CreateDashboard.go.snap @@ -0,0 +1,41 @@ +CreateDashboard + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudtrail/snapshot/api_op_DeleteDashboard.go.snap b/service/cloudtrail/snapshot/api_op_DeleteDashboard.go.snap new file mode 100644 index 00000000000..013b0338758 --- /dev/null +++ b/service/cloudtrail/snapshot/api_op_DeleteDashboard.go.snap @@ -0,0 +1,41 @@ +DeleteDashboard + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudtrail/snapshot/api_op_GetDashboard.go.snap b/service/cloudtrail/snapshot/api_op_GetDashboard.go.snap new file mode 100644 index 00000000000..392e6edec1c --- /dev/null +++ b/service/cloudtrail/snapshot/api_op_GetDashboard.go.snap @@ -0,0 +1,41 @@ +GetDashboard + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudtrail/snapshot/api_op_ListDashboards.go.snap b/service/cloudtrail/snapshot/api_op_ListDashboards.go.snap new file mode 100644 index 00000000000..a4ee9bdd7cd --- /dev/null +++ b/service/cloudtrail/snapshot/api_op_ListDashboards.go.snap @@ -0,0 +1,40 @@ +ListDashboards + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudtrail/snapshot/api_op_StartDashboardRefresh.go.snap b/service/cloudtrail/snapshot/api_op_StartDashboardRefresh.go.snap new file mode 100644 index 00000000000..032312aa994 --- /dev/null +++ b/service/cloudtrail/snapshot/api_op_StartDashboardRefresh.go.snap @@ -0,0 +1,41 @@ +StartDashboardRefresh + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudtrail/snapshot/api_op_UpdateDashboard.go.snap b/service/cloudtrail/snapshot/api_op_UpdateDashboard.go.snap new file mode 100644 index 00000000000..baf8d8ce5f6 --- /dev/null +++ b/service/cloudtrail/snapshot/api_op_UpdateDashboard.go.snap @@ -0,0 +1,41 @@ +UpdateDashboard + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudtrail/snapshot_test.go b/service/cloudtrail/snapshot_test.go index 2f16766b56a..55cc6cd9af9 100644 --- a/service/cloudtrail/snapshot_test.go +++ b/service/cloudtrail/snapshot_test.go @@ -98,6 +98,18 @@ func TestCheckSnapshot_CreateChannel(t *testing.T) { } } +func TestCheckSnapshot_CreateDashboard(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateDashboard(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateDashboard") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateEventDataStore(t *testing.T) { svc := New(Options{}) _, err := svc.CreateEventDataStore(context.Background(), nil, func(o *Options) { @@ -134,6 +146,18 @@ func TestCheckSnapshot_DeleteChannel(t *testing.T) { } } +func TestCheckSnapshot_DeleteDashboard(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteDashboard(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteDashboard") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteEventDataStore(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteEventDataStore(context.Background(), nil, func(o *Options) { @@ -254,6 +278,18 @@ func TestCheckSnapshot_GetChannel(t *testing.T) { } } +func TestCheckSnapshot_GetDashboard(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetDashboard(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetDashboard") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetEventDataStore(t *testing.T) { svc := New(Options{}) _, err := svc.GetEventDataStore(context.Background(), nil, func(o *Options) { @@ -362,6 +398,18 @@ func TestCheckSnapshot_ListChannels(t *testing.T) { } } +func TestCheckSnapshot_ListDashboards(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListDashboards(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListDashboards") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListEventDataStores(t *testing.T) { svc := New(Options{}) _, err := svc.ListEventDataStores(context.Background(), nil, func(o *Options) { @@ -542,6 +590,18 @@ func TestCheckSnapshot_RestoreEventDataStore(t *testing.T) { } } +func TestCheckSnapshot_StartDashboardRefresh(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartDashboardRefresh(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartDashboardRefresh") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartEventDataStoreIngestion(t *testing.T) { svc := New(Options{}) _, err := svc.StartEventDataStoreIngestion(context.Background(), nil, func(o *Options) { @@ -638,6 +698,18 @@ func TestCheckSnapshot_UpdateChannel(t *testing.T) { } } +func TestCheckSnapshot_UpdateDashboard(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateDashboard(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateDashboard") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateEventDataStore(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateEventDataStore(context.Background(), nil, func(o *Options) { @@ -697,6 +769,18 @@ func TestUpdateSnapshot_CreateChannel(t *testing.T) { } } +func TestUpdateSnapshot_CreateDashboard(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateDashboard(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateDashboard") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateEventDataStore(t *testing.T) { svc := New(Options{}) _, err := svc.CreateEventDataStore(context.Background(), nil, func(o *Options) { @@ -733,6 +817,18 @@ func TestUpdateSnapshot_DeleteChannel(t *testing.T) { } } +func TestUpdateSnapshot_DeleteDashboard(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteDashboard(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteDashboard") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteEventDataStore(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteEventDataStore(context.Background(), nil, func(o *Options) { @@ -853,6 +949,18 @@ func TestUpdateSnapshot_GetChannel(t *testing.T) { } } +func TestUpdateSnapshot_GetDashboard(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetDashboard(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetDashboard") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetEventDataStore(t *testing.T) { svc := New(Options{}) _, err := svc.GetEventDataStore(context.Background(), nil, func(o *Options) { @@ -961,6 +1069,18 @@ func TestUpdateSnapshot_ListChannels(t *testing.T) { } } +func TestUpdateSnapshot_ListDashboards(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListDashboards(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListDashboards") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListEventDataStores(t *testing.T) { svc := New(Options{}) _, err := svc.ListEventDataStores(context.Background(), nil, func(o *Options) { @@ -1141,6 +1261,18 @@ func TestUpdateSnapshot_RestoreEventDataStore(t *testing.T) { } } +func TestUpdateSnapshot_StartDashboardRefresh(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartDashboardRefresh(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartDashboardRefresh") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartEventDataStoreIngestion(t *testing.T) { svc := New(Options{}) _, err := svc.StartEventDataStoreIngestion(context.Background(), nil, func(o *Options) { @@ -1237,6 +1369,18 @@ func TestUpdateSnapshot_UpdateChannel(t *testing.T) { } } +func TestUpdateSnapshot_UpdateDashboard(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateDashboard(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateDashboard") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateEventDataStore(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateEventDataStore(context.Background(), nil, func(o *Options) { diff --git a/service/cloudtrail/types/enums.go b/service/cloudtrail/types/enums.go index 6f4c522d3d0..bde379215c9 100644 --- a/service/cloudtrail/types/enums.go +++ b/service/cloudtrail/types/enums.go @@ -21,6 +21,50 @@ func (BillingMode) Values() []BillingMode { } } +type DashboardStatus string + +// Enum values for DashboardStatus +const ( + DashboardStatusCreating DashboardStatus = "CREATING" + DashboardStatusCreated DashboardStatus = "CREATED" + DashboardStatusUpdating DashboardStatus = "UPDATING" + DashboardStatusUpdated DashboardStatus = "UPDATED" + DashboardStatusDeleting DashboardStatus = "DELETING" +) + +// Values returns all known values for DashboardStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DashboardStatus) Values() []DashboardStatus { + return []DashboardStatus{ + "CREATING", + "CREATED", + "UPDATING", + "UPDATED", + "DELETING", + } +} + +type DashboardType string + +// Enum values for DashboardType +const ( + DashboardTypeManaged DashboardType = "MANAGED" + DashboardTypeCustom DashboardType = "CUSTOM" +) + +// Values returns all known values for DashboardType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DashboardType) Values() []DashboardType { + return []DashboardType{ + "MANAGED", + "CUSTOM", + } +} + type DeliveryStatus string // Enum values for DeliveryStatus @@ -302,3 +346,42 @@ func (ReadWriteType) Values() []ReadWriteType { "All", } } + +type RefreshScheduleFrequencyUnit string + +// Enum values for RefreshScheduleFrequencyUnit +const ( + RefreshScheduleFrequencyUnitHours RefreshScheduleFrequencyUnit = "HOURS" + RefreshScheduleFrequencyUnitDays RefreshScheduleFrequencyUnit = "DAYS" +) + +// Values returns all known values for RefreshScheduleFrequencyUnit. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (RefreshScheduleFrequencyUnit) Values() []RefreshScheduleFrequencyUnit { + return []RefreshScheduleFrequencyUnit{ + "HOURS", + "DAYS", + } +} + +type RefreshScheduleStatus string + +// Enum values for RefreshScheduleStatus +const ( + RefreshScheduleStatusEnabled RefreshScheduleStatus = "ENABLED" + RefreshScheduleStatusDisabled RefreshScheduleStatus = "DISABLED" +) + +// Values returns all known values for RefreshScheduleStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (RefreshScheduleStatus) Values() []RefreshScheduleStatus { + return []RefreshScheduleStatus{ + "ENABLED", + "DISABLED", + } +} diff --git a/service/cloudtrail/types/errors.go b/service/cloudtrail/types/errors.go index 4e73a6a5f21..a1d34710395 100644 --- a/service/cloudtrail/types/errors.go +++ b/service/cloudtrail/types/errors.go @@ -346,6 +346,9 @@ func (e *CloudTrailAccessNotEnabledException) ErrorFault() smithy.ErrorFault { // The following is the format of an event data store ARN: // arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE // +// The following is the format of a dashboard ARN: +// arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash +// // The following is the format of a channel ARN: // arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 type CloudTrailARNInvalidException struct { @@ -884,8 +887,12 @@ func (e *InsufficientDependencyServiceAccessPermissionException) ErrorFault() sm return smithy.FaultClient } -// This exception is thrown when the policy on the S3 bucket or KMS key does not -// have sufficient permissions for the operation. +// For the CreateTrail PutInsightSelectors , UpdateTrail , StartQuery , and +// StartImport operations, this exception is thrown when the policy on the S3 +// bucket or KMS key does not have sufficient permissions for the operation. +// +// For all other operations, this exception is thrown when the policy for the KMS +// key does not have sufficient permissions for the operation. type InsufficientEncryptionPolicyException struct { Message *string @@ -2065,8 +2072,16 @@ func (e *QueryIdNotFoundException) ErrorFault() smithy.ErrorFault { return smith // This exception is thrown when the provided resource does not exist, or the ARN // -// format of the resource is not valid. The following is the valid format for a -// resource ARN: arn:aws:cloudtrail:us-east-2:123456789012:channel/MyChannel . +// format of the resource is not valid. +// +// The following is the format of an event data store ARN: +// arn:aws:cloudtrail:us-east-2:123456789012:eventdatastore/EXAMPLE-f852-4e8f-8bd1-bcf6cEXAMPLE +// +// The following is the format of a dashboard ARN: +// arn:aws:cloudtrail:us-east-1:123456789012:dashboard/exampleDash +// +// The following is the format of a channel ARN: +// arn:aws:cloudtrail:us-east-2:123456789012:channel/01234567890 type ResourceARNNotValidException struct { Message *string @@ -2147,16 +2162,6 @@ func (e *ResourcePolicyNotFoundException) ErrorFault() smithy.ErrorFault { retur // This exception is thrown when the resouce-based policy has syntax errors, or // // contains a principal that is not valid. -// -// The following are requirements for the resource policy: -// -// - Contains only one action: cloudtrail-data:PutAuditEvents -// -// - Contains at least one statement. The policy can have a maximum of 20 -// statements. -// -// - Each statement contains at least one principal. A statement can have a -// maximum of 50 principals. type ResourcePolicyNotValidException struct { Message *string @@ -2235,8 +2240,38 @@ func (e *S3BucketDoesNotExistException) ErrorCode() string { } func (e *S3BucketDoesNotExistException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The number of tags per trail, event data store, or channel has exceeded the -// permitted amount. Currently, the limit is 50. +// This exception is thrown when the quota is exceeded. For information about +// +// CloudTrail quotas, see [Service quotas]in the Amazon Web Services General Reference. +// +// [Service quotas]: https://docs.aws.amazon.com/general/latest/gr/ct.html#limits_cloudtrail +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *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 { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The number of tags per trail, event data store, dashboard, or channel has +// exceeded the permitted amount. Currently, the limit is 50. type TagsLimitExceededException struct { Message *string diff --git a/service/cloudtrail/types/types.go b/service/cloudtrail/types/types.go index 23b28733e7e..aa4493118b3 100644 --- a/service/cloudtrail/types/types.go +++ b/service/cloudtrail/types/types.go @@ -268,6 +268,18 @@ type Channel struct { noSmithyDocumentSerde } +// Provides information about a CloudTrail Lake dashboard. +type DashboardDetail struct { + + // The ARN for the dashboard. + DashboardArn *string + + // The type of dashboard. + Type DashboardType + + noSmithyDocumentSerde +} + // You can configure the DataResource in an EventSelector to log data events for // the following three resource types: // @@ -797,6 +809,77 @@ type QueryStatisticsForDescribeQuery struct { noSmithyDocumentSerde } +// The schedule for a dashboard refresh. +type RefreshSchedule struct { + + // The frequency at which you want the dashboard refreshed. + Frequency *RefreshScheduleFrequency + + // Specifies whether the refresh schedule is enabled. Set the value to ENABLED to + // enable the refresh schedule, or to DISABLED to turn off the refresh schedule. + Status RefreshScheduleStatus + + // The time of day in UTC to run the schedule; for hourly only refer to minutes; + // default is 00:00. + TimeOfDay *string + + noSmithyDocumentSerde +} + +// Specifies the frequency for a dashboard refresh schedule. +// +// For a custom dashboard, you can schedule a refresh for every 1, 6, 12, or 24 +// hours, or every day. +type RefreshScheduleFrequency struct { + + // The unit to use for the refresh. + // + // For custom dashboards, the unit can be HOURS or DAYS . + // + // For the Highlights dashboard, the Unit must be HOURS . + Unit RefreshScheduleFrequencyUnit + + // The value for the refresh schedule. + // + // For custom dashboards, the following values are valid when the unit is HOURS : 1 + // , 6 , 12 , 24 + // + // For custom dashboards, the only valid value when the unit is DAYS is 1 . + // + // For the Highlights dashboard, the Value must be 6 . + Value *int32 + + noSmithyDocumentSerde +} + +// Contains information about a widget on a CloudTrail Lake dashboard. +type RequestWidget struct { + + // The query statement for the widget. For custom dashboard widgets, you can + // query across multiple event data stores as long as all event data stores exist + // in your account. + // + // When a query uses ? with eventTime , ? must be surrounded by single quotes as + // follows: '?' . + // + // This member is required. + QueryStatement *string + + // The view properties for the widget. For more information about view + // properties, see [View properties for widgets]in the CloudTrail User Guide. + // + // [View properties for widgets]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html + // + // This member is required. + ViewProperties map[string]string + + // The optional query parameters. The following query parameters are valid: + // $StartTime$ , $EndTime$ , and $Period$ . + QueryParameters []string + + noSmithyDocumentSerde +} + // Specifies the type and name of a resource referenced by an event. type Resource struct { @@ -864,7 +947,7 @@ type SourceConfig struct { } // A custom key-value pair associated with a resource such as a CloudTrail trail, -// event data store, or channel. +// event data store, dashboard, or channel. type Tag struct { // The key in a key-value pair. The key must be must be no longer than 128 Unicode @@ -972,4 +1055,25 @@ type TrailInfo struct { noSmithyDocumentSerde } +// A widget on a CloudTrail Lake dashboard. +type Widget struct { + + // The query alias used to identify the query for the widget. + QueryAlias *string + + // The query parameters for the widget. + QueryParameters []string + + // The SQL query statement for the widget. + QueryStatement *string + + // The view properties for the widget. For more information about view + // properties, see [View properties for widgets]in the CloudTrail User Guide.. + // + // [View properties for widgets]: https://docs.aws.amazon.com/awscloudtrail/latest/userguide/lake-widget-properties.html + ViewProperties map[string]string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/cloudtrail/validators.go b/service/cloudtrail/validators.go index e65609aa959..ff0140b6f2f 100644 --- a/service/cloudtrail/validators.go +++ b/service/cloudtrail/validators.go @@ -70,6 +70,26 @@ func (m *validateOpCreateChannel) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpCreateDashboard struct { +} + +func (*validateOpCreateDashboard) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateDashboard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateDashboardInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateDashboardInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateEventDataStore struct { } @@ -130,6 +150,26 @@ func (m *validateOpDeleteChannel) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpDeleteDashboard struct { +} + +func (*validateOpDeleteDashboard) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteDashboard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteDashboardInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteDashboardInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteEventDataStore struct { } @@ -290,6 +330,26 @@ func (m *validateOpGetChannel) HandleInitialize(ctx context.Context, in middlewa return next.HandleInitialize(ctx, in) } +type validateOpGetDashboard struct { +} + +func (*validateOpGetDashboard) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetDashboard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetDashboardInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetDashboardInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetEventDataStore struct { } @@ -650,6 +710,26 @@ func (m *validateOpRestoreEventDataStore) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpStartDashboardRefresh struct { +} + +func (*validateOpStartDashboardRefresh) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartDashboardRefresh) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartDashboardRefreshInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartDashboardRefreshInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartEventDataStoreIngestion struct { } @@ -790,6 +870,26 @@ func (m *validateOpUpdateChannel) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateDashboard struct { +} + +func (*validateOpUpdateDashboard) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateDashboard) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateDashboardInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateDashboardInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateEventDataStore struct { } @@ -842,6 +942,10 @@ func addOpCreateChannelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateChannel{}, middleware.After) } +func addOpCreateDashboardValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateDashboard{}, middleware.After) +} + func addOpCreateEventDataStoreValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateEventDataStore{}, middleware.After) } @@ -854,6 +958,10 @@ func addOpDeleteChannelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteChannel{}, middleware.After) } +func addOpDeleteDashboardValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteDashboard{}, middleware.After) +} + func addOpDeleteEventDataStoreValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteEventDataStore{}, middleware.After) } @@ -886,6 +994,10 @@ func addOpGetChannelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetChannel{}, middleware.After) } +func addOpGetDashboardValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetDashboard{}, middleware.After) +} + func addOpGetEventDataStoreValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetEventDataStore{}, middleware.After) } @@ -958,6 +1070,10 @@ func addOpRestoreEventDataStoreValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpRestoreEventDataStore{}, middleware.After) } +func addOpStartDashboardRefreshValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartDashboardRefresh{}, middleware.After) +} + func addOpStartEventDataStoreIngestionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartEventDataStoreIngestion{}, middleware.After) } @@ -986,6 +1102,10 @@ func addOpUpdateChannelValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateChannel{}, middleware.After) } +func addOpUpdateDashboardValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateDashboard{}, middleware.After) +} + func addOpUpdateEventDataStoreValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateEventDataStore{}, middleware.After) } @@ -1151,6 +1271,41 @@ func validateLookupAttributesList(v []types.LookupAttribute) error { } } +func validateRequestWidget(v *types.RequestWidget) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RequestWidget"} + if v.QueryStatement == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryStatement")) + } + if v.ViewProperties == nil { + invalidParams.Add(smithy.NewErrParamRequired("ViewProperties")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRequestWidgetList(v []types.RequestWidget) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RequestWidgetList"} + for i := range v { + if err := validateRequestWidget(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateS3ImportSource(v *types.S3ImportSource) error { if v == nil { return nil @@ -1271,6 +1426,31 @@ func validateOpCreateChannelInput(v *CreateChannelInput) error { } } +func validateOpCreateDashboardInput(v *CreateDashboardInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDashboardInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.TagsList != nil { + if err := validateTagsList(v.TagsList); err != nil { + invalidParams.AddNested("TagsList", err.(smithy.InvalidParamsError)) + } + } + if v.Widgets != nil { + if err := validateRequestWidgetList(v.Widgets); err != nil { + invalidParams.AddNested("Widgets", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateEventDataStoreInput(v *CreateEventDataStoreInput) error { if v == nil { return nil @@ -1334,6 +1514,21 @@ func validateOpDeleteChannelInput(v *DeleteChannelInput) error { } } +func validateOpDeleteDashboardInput(v *DeleteDashboardInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDashboardInput"} + if v.DashboardId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DashboardId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteEventDataStoreInput(v *DeleteEventDataStoreInput) error { if v == nil { return nil @@ -1460,6 +1655,21 @@ func validateOpGetChannelInput(v *GetChannelInput) error { } } +func validateOpGetDashboardInput(v *GetDashboardInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetDashboardInput"} + if v.DashboardId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DashboardId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetEventDataStoreInput(v *GetEventDataStoreInput) error { if v == nil { return nil @@ -1753,6 +1963,21 @@ func validateOpRestoreEventDataStoreInput(v *RestoreEventDataStoreInput) error { } } +func validateOpStartDashboardRefreshInput(v *StartDashboardRefreshInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartDashboardRefreshInput"} + if v.DashboardId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DashboardId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartEventDataStoreIngestionInput(v *StartEventDataStoreIngestionInput) error { if v == nil { return nil @@ -1865,6 +2090,26 @@ func validateOpUpdateChannelInput(v *UpdateChannelInput) error { } } +func validateOpUpdateDashboardInput(v *UpdateDashboardInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateDashboardInput"} + if v.DashboardId == nil { + invalidParams.Add(smithy.NewErrParamRequired("DashboardId")) + } + if v.Widgets != nil { + if err := validateRequestWidgetList(v.Widgets); err != nil { + invalidParams.AddNested("Widgets", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateEventDataStoreInput(v *UpdateEventDataStoreInput) error { if v == nil { return nil diff --git a/service/cloudwatchlogs/api_op_DeleteAccountPolicy.go b/service/cloudwatchlogs/api_op_DeleteAccountPolicy.go index 8a3cb587757..600587b2eaf 100644 --- a/service/cloudwatchlogs/api_op_DeleteAccountPolicy.go +++ b/service/cloudwatchlogs/api_op_DeleteAccountPolicy.go @@ -11,9 +11,10 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a CloudWatch Logs account policy. This stops the policy from applying -// to all log groups or a subset of log groups in the account. Log-group level -// policies will still be in effect. +// Deletes a CloudWatch Logs account policy. This stops the account-wide policy +// from applying to log groups in the account. If you delete a data protection +// policy or subscription filter policy, any log-group level policies of those +// types remain in effect. // // To use this operation, you must be signed on with the correct permissions // depending on the type of policy that you are deleting. @@ -23,6 +24,16 @@ import ( // // - To delete a subscription filter policy, you must have the // logs:DeleteSubscriptionFilter and logs:DeleteAccountPolicy permissions. +// +// - To delete a transformer policy, you must have the logs:DeleteTransformer and +// logs:DeleteAccountPolicy permissions. +// +// - To delete a field index policy, you must have the logs:DeleteIndexPolicy and +// logs:DeleteAccountPolicy permissions. +// +// If you delete a field index policy, the indexing of the log events that +// happened before you deleted the policy will still be used for up to 30 days to +// improve CloudWatch Logs Insights queries. func (c *Client) DeleteAccountPolicy(ctx context.Context, params *DeleteAccountPolicyInput, optFns ...func(*Options)) (*DeleteAccountPolicyOutput, error) { if params == nil { params = &DeleteAccountPolicyInput{} diff --git a/service/cloudwatchlogs/api_op_DeleteIndexPolicy.go b/service/cloudwatchlogs/api_op_DeleteIndexPolicy.go new file mode 100644 index 00000000000..12e84d98c32 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DeleteIndexPolicy.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a log-group level field index policy that was applied to a single log +// group. The indexing of the log events that happened before you delete the policy +// will still be used for as many as 30 days to improve CloudWatch Logs Insights +// queries. +// +// You can't use this operation to delete an account-level index policy. Instead, +// use [DeletAccountPolicy]. +// +// If you delete a log-group level field index policy and there is an +// account-level field index policy, in a few minutes the log group begins using +// that account-wide policy to index new incoming log events. +// +// [DeletAccountPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DeleteAccountPolicy.html +func (c *Client) DeleteIndexPolicy(ctx context.Context, params *DeleteIndexPolicyInput, optFns ...func(*Options)) (*DeleteIndexPolicyOutput, error) { + if params == nil { + params = &DeleteIndexPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteIndexPolicy", params, optFns, c.addOperationDeleteIndexPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteIndexPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteIndexPolicyInput struct { + + // The log group to delete the index policy for. You can specify either the name + // or the ARN of the log group. + // + // This member is required. + LogGroupIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteIndexPolicyOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteIndexPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteIndexPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteIndexPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteIndexPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteIndexPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteIndexPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteIndexPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteIndexPolicy", + } +} diff --git a/service/cloudwatchlogs/api_op_DeleteTransformer.go b/service/cloudwatchlogs/api_op_DeleteTransformer.go new file mode 100644 index 00000000000..0fd19ebb374 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DeleteTransformer.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes the log transformer for the specified log group. As soon as you do +// this, the transformation of incoming log events according to that transformer +// stops. If this account has an account-level transformer that applies to this log +// group, the log group begins using that account-level transformer when this +// log-group level transformer is deleted. +// +// After you delete a transformer, be sure to edit any metric filters or +// subscription filters that relied on the transformed versions of the log events. +func (c *Client) DeleteTransformer(ctx context.Context, params *DeleteTransformerInput, optFns ...func(*Options)) (*DeleteTransformerOutput, error) { + if params == nil { + params = &DeleteTransformerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteTransformer", params, optFns, c.addOperationDeleteTransformerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteTransformerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteTransformerInput struct { + + // Specify either the name or ARN of the log group to delete the transformer for. + // If the log group is in a source account and you are using a monitoring account, + // you must use the log group ARN. + // + // This member is required. + LogGroupIdentifier *string + + noSmithyDocumentSerde +} + +type DeleteTransformerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteTransformerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDeleteTransformer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDeleteTransformer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteTransformer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteTransformerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteTransformer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteTransformer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteTransformer", + } +} diff --git a/service/cloudwatchlogs/api_op_DescribeAccountPolicies.go b/service/cloudwatchlogs/api_op_DescribeAccountPolicies.go index 00f458574e7..f88b294196e 100644 --- a/service/cloudwatchlogs/api_op_DescribeAccountPolicies.go +++ b/service/cloudwatchlogs/api_op_DescribeAccountPolicies.go @@ -44,6 +44,10 @@ type DescribeAccountPoliciesInput struct { // If you omit this parameter, only the policy in the current account is returned. AccountIdentifiers []string + // The token for the next set of items to return. (You received this token from a + // previous call.) + NextToken *string + // Use this parameter to limit the returned policies to only the policy with the // name that you specify. PolicyName *string @@ -57,6 +61,10 @@ type DescribeAccountPoliciesOutput struct { // account policies that match the specified filters. AccountPolicies []types.AccountPolicy + // The token to use when requesting the next set of items. The token expires after + // 24 hours. + NextToken *string + // Metadata pertaining to the operation's result. ResultMetadata middleware.Metadata diff --git a/service/cloudwatchlogs/api_op_DescribeFieldIndexes.go b/service/cloudwatchlogs/api_op_DescribeFieldIndexes.go new file mode 100644 index 00000000000..3cc942a5c62 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DescribeFieldIndexes.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of field indexes listed in the field index policies of one or +// more log groups. For more information about field index policies, see [PutIndexPolicy]. +// +// [PutIndexPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html +func (c *Client) DescribeFieldIndexes(ctx context.Context, params *DescribeFieldIndexesInput, optFns ...func(*Options)) (*DescribeFieldIndexesOutput, error) { + if params == nil { + params = &DescribeFieldIndexesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeFieldIndexes", params, optFns, c.addOperationDescribeFieldIndexesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeFieldIndexesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeFieldIndexesInput struct { + + // An array containing the names or ARNs of the log groups that you want to + // retrieve field indexes for. + // + // This member is required. + LogGroupIdentifiers []string + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeFieldIndexesOutput struct { + + // An array containing the field index information. + FieldIndexes []types.FieldIndex + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeFieldIndexesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeFieldIndexes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeFieldIndexes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeFieldIndexes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeFieldIndexesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeFieldIndexes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeFieldIndexes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeFieldIndexes", + } +} diff --git a/service/cloudwatchlogs/api_op_DescribeIndexPolicies.go b/service/cloudwatchlogs/api_op_DescribeIndexPolicies.go new file mode 100644 index 00000000000..a2a8683c650 --- /dev/null +++ b/service/cloudwatchlogs/api_op_DescribeIndexPolicies.go @@ -0,0 +1,177 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the field index policies of one or more log groups. For more +// information about field index policies, see [PutIndexPolicy]. +// +// If a specified log group has a log-group level index policy, that policy is +// returned by this operation. +// +// If a specified log group doesn't have a log-group level index policy, but an +// account-wide index policy applies to it, that account-wide policy is returned by +// this operation. +// +// To find information about only account-level policies, use [DescribeAccountPolicies] instead. +// +// [PutIndexPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html +// [DescribeAccountPolicies]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeAccountPolicies.html +func (c *Client) DescribeIndexPolicies(ctx context.Context, params *DescribeIndexPoliciesInput, optFns ...func(*Options)) (*DescribeIndexPoliciesOutput, error) { + if params == nil { + params = &DescribeIndexPoliciesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeIndexPolicies", params, optFns, c.addOperationDescribeIndexPoliciesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeIndexPoliciesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeIndexPoliciesInput struct { + + // An array containing the name or ARN of the log group that you want to retrieve + // field index policies for. + // + // This member is required. + LogGroupIdentifiers []string + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeIndexPoliciesOutput struct { + + // An array containing the field index policies. + IndexPolicies []types.IndexPolicy + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeIndexPoliciesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpDescribeIndexPolicies{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpDescribeIndexPolicies{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeIndexPolicies"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeIndexPoliciesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeIndexPolicies(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeIndexPolicies(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeIndexPolicies", + } +} diff --git a/service/cloudwatchlogs/api_op_GetTransformer.go b/service/cloudwatchlogs/api_op_GetTransformer.go new file mode 100644 index 00000000000..381fede74cf --- /dev/null +++ b/service/cloudwatchlogs/api_op_GetTransformer.go @@ -0,0 +1,176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns the information about the log transformer associated with this log +// group. +// +// This operation returns data only for transformers created at the log group +// level. To get information for an account-level transformer, use [DescribeAccountPolicies]. +// +// [DescribeAccountPolicies]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_DescribeAccountPolicies.html +func (c *Client) GetTransformer(ctx context.Context, params *GetTransformerInput, optFns ...func(*Options)) (*GetTransformerOutput, error) { + if params == nil { + params = &GetTransformerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTransformer", params, optFns, c.addOperationGetTransformerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTransformerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTransformerInput struct { + + // Specify either the name or ARN of the log group to return transformer + // information for. If the log group is in a source account and you are using a + // monitoring account, you must use the log group ARN. + // + // This member is required. + LogGroupIdentifier *string + + noSmithyDocumentSerde +} + +type GetTransformerOutput struct { + + // The creation time of the transformer, expressed as the number of milliseconds + // after Jan 1, 1970 00:00:00 UTC. + CreationTime *int64 + + // The date and time when this transformer was most recently modified, expressed + // as the number of milliseconds after Jan 1, 1970 00:00:00 UTC. + LastModifiedTime *int64 + + // The ARN of the log group that you specified in your request. + LogGroupIdentifier *string + + // This sructure contains the configuration of the requested transformer. + TransformerConfig []types.Processor + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTransformerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetTransformer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetTransformer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTransformer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetTransformerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTransformer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetTransformer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTransformer", + } +} diff --git a/service/cloudwatchlogs/api_op_ListLogGroupsForQuery.go b/service/cloudwatchlogs/api_op_ListLogGroupsForQuery.go new file mode 100644 index 00000000000..c39851b2c53 --- /dev/null +++ b/service/cloudwatchlogs/api_op_ListLogGroupsForQuery.go @@ -0,0 +1,270 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of the log groups that were analyzed during a single CloudWatch +// Logs Insights query. This can be useful for queries that use log group name +// prefixes or the filterIndex command, because the log groups are dynamically +// selected in these cases. +// +// For more information about field indexes, see [Create field indexes to improve query performance and reduce costs]. +// +// [Create field indexes to improve query performance and reduce costs]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing.html +func (c *Client) ListLogGroupsForQuery(ctx context.Context, params *ListLogGroupsForQueryInput, optFns ...func(*Options)) (*ListLogGroupsForQueryOutput, error) { + if params == nil { + params = &ListLogGroupsForQueryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListLogGroupsForQuery", params, optFns, c.addOperationListLogGroupsForQueryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListLogGroupsForQueryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListLogGroupsForQueryInput struct { + + // The ID of the query to use. This query ID is from the response to your [StartQuery] + // operation. + // + // [StartQuery]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html + // + // This member is required. + QueryId *string + + // Limits the number of returned log groups to the specified number. + MaxResults *int32 + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + noSmithyDocumentSerde +} + +type ListLogGroupsForQueryOutput struct { + + // An array of the names and ARNs of the log groups that were processed in the + // query. + LogGroupIdentifiers []string + + // The token for the next set of items to return. The token expires after 24 hours. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListLogGroupsForQueryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListLogGroupsForQuery{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListLogGroupsForQuery{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListLogGroupsForQuery"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListLogGroupsForQueryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListLogGroupsForQuery(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListLogGroupsForQueryPaginatorOptions is the paginator options for +// ListLogGroupsForQuery +type ListLogGroupsForQueryPaginatorOptions struct { + // Limits the number of returned log groups to the specified number. + 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 +} + +// ListLogGroupsForQueryPaginator is a paginator for ListLogGroupsForQuery +type ListLogGroupsForQueryPaginator struct { + options ListLogGroupsForQueryPaginatorOptions + client ListLogGroupsForQueryAPIClient + params *ListLogGroupsForQueryInput + nextToken *string + firstPage bool +} + +// NewListLogGroupsForQueryPaginator returns a new ListLogGroupsForQueryPaginator +func NewListLogGroupsForQueryPaginator(client ListLogGroupsForQueryAPIClient, params *ListLogGroupsForQueryInput, optFns ...func(*ListLogGroupsForQueryPaginatorOptions)) *ListLogGroupsForQueryPaginator { + if params == nil { + params = &ListLogGroupsForQueryInput{} + } + + options := ListLogGroupsForQueryPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListLogGroupsForQueryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListLogGroupsForQueryPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListLogGroupsForQuery page. +func (p *ListLogGroupsForQueryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListLogGroupsForQueryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListLogGroupsForQuery(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 +} + +// ListLogGroupsForQueryAPIClient is a client that implements the +// ListLogGroupsForQuery operation. +type ListLogGroupsForQueryAPIClient interface { + ListLogGroupsForQuery(context.Context, *ListLogGroupsForQueryInput, ...func(*Options)) (*ListLogGroupsForQueryOutput, error) +} + +var _ ListLogGroupsForQueryAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListLogGroupsForQuery(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListLogGroupsForQuery", + } +} diff --git a/service/cloudwatchlogs/api_op_PutAccountPolicy.go b/service/cloudwatchlogs/api_op_PutAccountPolicy.go index 7e4ec95f91a..4c201fb79e7 100644 --- a/service/cloudwatchlogs/api_op_PutAccountPolicy.go +++ b/service/cloudwatchlogs/api_op_PutAccountPolicy.go @@ -11,8 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Creates an account-level data protection policy or subscription filter policy -// that applies to all log groups or a subset of log groups in the account. +// Creates an account-level data protection policy, subscription filter policy, or +// field index policy that applies to all log groups or a subset of log groups in +// the account. // // # Data protection policy // @@ -80,10 +81,100 @@ import ( // any destination except a Lambda function, you must also have the iam:PassRole // permission. // +// # Transformer policy +// +// Creates or updates a log transformer policy for your account. You use log +// transformers to transform log events into a different format, making them easier +// for you to process and analyze. You can also transform logs from different +// sources into standardized formats that contain relevant, source-specific +// information. After you have created a transformer, CloudWatch Logs performs this +// transformation at the time of log ingestion. You can then refer to the +// transformed versions of the logs during operations such as querying with +// CloudWatch Logs Insights or creating metric filters or subscription filters. +// +// You can also use a transformer to copy metadata from metadata keys into the log +// events themselves. This metadata can include log group name, log stream name, +// account ID and Region. +// +// A transformer for a log group is a series of processors, where each processor +// applies one type of transformation to the log events ingested into this log +// group. For more information about the available processors to use in a +// transformer, see [Processors that you can use]. +// +// Having log events in standardized format enables visibility across your +// applications for your log analysis, reporting, and alarming needs. CloudWatch +// Logs provides transformation for common log types with out-of-the-box +// transformation templates for major Amazon Web Services log sources such as VPC +// flow logs, Lambda, and Amazon RDS. You can use pre-built transformation +// templates or create custom transformation policies. +// +// You can create transformers only for the log groups in the Standard log class. +// +// You can have one account-level transformer policy that applies to all log +// groups in the account. Or you can create as many as 20 account-level transformer +// policies that are each scoped to a subset of log groups with the +// selectionCriteria parameter. If you have multiple account-level transformer +// policies with selection criteria, no two of them can use the same or overlapping +// log group name prefixes. For example, if you have one policy filtered to log +// groups that start with my-log , you can't have another field index policy +// filtered to my-logpprod or my-logging . +// +// You can also set up a transformer at the log-group level. For more information, +// see [PutTransformer]. If there is both a log-group level transformer created with PutTransformer +// and an account-level transformer that could apply to the same log group, the log +// group uses only the log-group level transformer. It ignores the account-level +// transformer. +// +// # Field index policy +// +// You can use field index policies to create indexes on fields found in log +// events in the log group. Creating field indexes can help lower the scan volume +// for CloudWatch Logs Insights queries that reference those fields, because these +// queries attempt to skip the processing of log events that are known to not match +// the indexed field. Good fields to index are fields that you often need to query +// for and fields or values that match only a small fraction of the total log +// events. Common examples of indexes include request ID, session ID, user IDs, or +// instance IDs. For more information, see [Create field indexes to improve query performance and reduce costs] +// +// To find the fields that are in your log group events, use the [GetLogGroupFields] operation. +// +// For example, suppose you have created a field index for requestId . Then, any +// CloudWatch Logs Insights query on that log group that includes requestId = +// value or requestId in [value, value, ...] will attempt to process only the log +// events where the indexed field matches the specified value. +// +// Matches of log events to the names of indexed fields are case-sensitive. For +// example, an indexed field of RequestId won't match a log event containing +// requestId . +// +// You can have one account-level field index policy that applies to all log +// groups in the account. Or you can create as many as 20 account-level field index +// policies that are each scoped to a subset of log groups with the +// selectionCriteria parameter. If you have multiple account-level index policies +// with selection criteria, no two of them can use the same or overlapping log +// group name prefixes. For example, if you have one policy filtered to log groups +// that start with my-log , you can't have another field index policy filtered to +// my-logpprod or my-logging . +// +// If you create an account-level field index policy in a monitoring account in +// cross-account observability, the policy is applied only to the monitoring +// account and not to any source accounts. +// +// If you want to create a field index policy for a single log group, you can use [PutIndexPolicy] +// instead of PutAccountPolicy . If you do so, that log group will use only that +// log-group level policy, and will ignore the account-level policy that you create +// with [PutAccountPolicy]. +// // [PutDestination]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestination.html +// [PutTransformer]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html +// [PutIndexPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html // [PutDataProtectionPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDataProtectionPolicy.html // [Protect sensitive log data with masking]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data.html // [FilterLogEvents]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_FilterLogEvents.html +// [GetLogGroupFields]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogGroupFields.html +// [Processors that you can use]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-Processors +// [PutAccountPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutAccountPolicy.html +// [Create field indexes to improve query performance and reduce costs]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing.html // [GetLogEvents]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogEvents.html func (c *Client) PutAccountPolicy(ctx context.Context, params *PutAccountPolicyInput, optFns ...func(*Options)) (*PutAccountPolicyOutput, error) { if params == nil { @@ -172,7 +263,27 @@ type PutAccountPolicyInput struct { // Random for a more even distribution. This property is only applicable when the // destination is an Kinesis Data Streams data stream. // + // Transformer policy + // + // A transformer policy must include one JSON block with the array of processors + // and their configurations. For more information about available processors, see [Processors that you can use] + // . + // + // Field index policy + // + // A field index filter policy can include the following attribute in a JSON block: + // + // - Fields The array of field indexes to create. + // + // It must contain at least one field index. + // + // The following is an example of an index policy document that creates two + // indexes, RequestId and TransactionId . + // + // "policyDocument": "{ \"Fields\": [ \"RequestId\", \"TransactionId\" ] }" + // // [PutDestination]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutDestination.html + // [Processors that you can use]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-Processors // [Types of data that you can mask]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/mask-sensitive-log-data-types.html // // This member is required. @@ -193,16 +304,24 @@ type PutAccountPolicyInput struct { // this parameter, the default of ALL is used. Scope types.Scope - // Use this parameter to apply the subscription filter policy to a subset of log - // groups in the account. Currently, the only supported filter is LogGroupName NOT - // IN [] . The selectionCriteria string can be up to 25KB in length. The length is - // determined by using its UTF-8 bytes. - // - // Using the selectionCriteria parameter is useful to help prevent infinite loops. - // For more information, see [Log recursion prevention]. + // Use this parameter to apply the new policy to a subset of log groups in the + // account. // // Specifing selectionCriteria is valid only when you specify - // SUBSCRIPTION_FILTER_POLICY for policyType . + // SUBSCRIPTION_FILTER_POLICY , FIELD_INDEX_POLICY or TRANSFORMER_POLICY for + // policyType . + // + // If policyType is SUBSCRIPTION_FILTER_POLICY , the only supported + // selectionCriteria filter is LogGroupName NOT IN [] + // + // If policyType is FIELD_INDEX_POLICY or TRANSFORMER_POLICY , the only supported + // selectionCriteria filter is LogGroupNamePrefix + // + // The selectionCriteria string can be up to 25KB in length. The length is + // determined by using its UTF-8 bytes. + // + // Using the selectionCriteria parameter with SUBSCRIPTION_FILTER_POLICY is useful + // to help prevent infinite loops. For more information, see [Log recursion prevention]. // // [Log recursion prevention]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/Subscriptions-recursion-prevention.html SelectionCriteria *string diff --git a/service/cloudwatchlogs/api_op_PutIndexPolicy.go b/service/cloudwatchlogs/api_op_PutIndexPolicy.go new file mode 100644 index 00000000000..fe3d377faa2 --- /dev/null +++ b/service/cloudwatchlogs/api_op_PutIndexPolicy.go @@ -0,0 +1,212 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates a field index policy for the specified log group. Only log +// groups in the Standard log class support field index policies. For more +// information about log classes, see [Log classes]. +// +// You can use field index policies to create field indexes on fields found in log +// events in the log group. Creating field indexes speeds up and lowers the costs +// for CloudWatch Logs Insights queries that reference those field indexes, because +// these queries attempt to skip the processing of log events that are known to not +// match the indexed field. Good fields to index are fields that you often need to +// query for and fields or values that match only a small fraction of the total log +// events. Common examples of indexes include request ID, session ID, userID, and +// instance IDs. For more information, see [Create field indexes to improve query performance and reduce costs]. +// +// To find the fields that are in your log group events, use the [GetLogGroupFields] operation. +// +// For example, suppose you have created a field index for requestId . Then, any +// CloudWatch Logs Insights query on that log group that includes requestId = +// value or requestId IN [value, value, ...] will process fewer log events to +// reduce costs, and have improved performance. +// +// Each index policy has the following quotas and restrictions: +// +// - As many as 20 fields can be included in the policy. +// +// - Each field name can include as many as 100 characters. +// +// Matches of log events to the names of indexed fields are case-sensitive. For +// example, a field index of RequestId won't match a log event containing requestId +// . +// +// Log group-level field index policies created with PutIndexPolicy override +// account-level field index policies created with [PutAccountPolicy]. If you use PutIndexPolicy to +// create a field index policy for a log group, that log group uses only that +// policy. The log group ignores any account-wide field index policy that you might +// have created. +// +// [Log classes]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch_Logs_Log_Classes.html +// [GetLogGroupFields]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetLogGroupFields.html +// [PutAccountPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutAccountPolicy.html +// [Create field indexes to improve query performance and reduce costs]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing.html +func (c *Client) PutIndexPolicy(ctx context.Context, params *PutIndexPolicyInput, optFns ...func(*Options)) (*PutIndexPolicyOutput, error) { + if params == nil { + params = &PutIndexPolicyInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutIndexPolicy", params, optFns, c.addOperationPutIndexPolicyMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutIndexPolicyOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutIndexPolicyInput struct { + + // Specify either the log group name or log group ARN to apply this field index + // policy to. If you specify an ARN, use the format + // arn:aws:logs:region:account-id:log-group:log_group_name Don't include an * at + // the end. + // + // This member is required. + LogGroupIdentifier *string + + // The index policy document, in JSON format. The following is an example of an + // index policy document that creates two indexes, RequestId and TransactionId . + // + // "policyDocument": "{ "Fields": [ "RequestId", "TransactionId" ] }" + // + // The policy document must include at least one field index. For more information + // about the fields that can be included and other restrictions, see [Field index syntax and quotas]. + // + // [Field index syntax and quotas]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing-Syntax.html + // + // This member is required. + PolicyDocument *string + + noSmithyDocumentSerde +} + +type PutIndexPolicyOutput struct { + + // The index policy that you just created or updated. + IndexPolicy *types.IndexPolicy + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutIndexPolicyMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutIndexPolicy{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutIndexPolicy{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutIndexPolicy"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPutIndexPolicyValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutIndexPolicy(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutIndexPolicy(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutIndexPolicy", + } +} diff --git a/service/cloudwatchlogs/api_op_PutLogEvents.go b/service/cloudwatchlogs/api_op_PutLogEvents.go index 995cbb2326e..f8f3ae09f27 100644 --- a/service/cloudwatchlogs/api_op_PutLogEvents.go +++ b/service/cloudwatchlogs/api_op_PutLogEvents.go @@ -82,7 +82,7 @@ type PutLogEventsInput struct { // This member is required. LogStreamName *string - // Reserved for internal use. + // The entity associated with the log events. Entity *types.Entity // The sequence token obtained from the response of the previous PutLogEvents call. @@ -108,7 +108,10 @@ type PutLogEventsOutput struct { // nextSequenceToken value. NextSequenceToken *string - // Reserved for internal use. + // Information about why the entity is rejected when calling PutLogEvents . Only + // returned when the entity is rejected. + // + // When the entity is rejected, the events may still be accepted. RejectedEntityInfo *types.RejectedEntityInfo // The rejected events. diff --git a/service/cloudwatchlogs/api_op_PutMetricFilter.go b/service/cloudwatchlogs/api_op_PutMetricFilter.go index e39c204b839..9c8acb9f7fe 100644 --- a/service/cloudwatchlogs/api_op_PutMetricFilter.go +++ b/service/cloudwatchlogs/api_op_PutMetricFilter.go @@ -19,9 +19,9 @@ import ( // 100. // // Using regular expressions to create metric filters is supported. For these -// filters, there is a quotas of quota of two regular expression patterns within a -// single filter pattern. There is also a quota of five regular expression patterns -// per log group. For more information about using regular expressions in metric +// filters, there is a quota of two regular expression patterns within a single +// filter pattern. There is also a quota of five regular expression patterns per +// log group. For more information about using regular expressions in metric // filters, see [Filter pattern syntax for metric filters, subscription filters, filter log events, and Live Tail]. // // When you create a metric filter, you can also optionally assign a unit and @@ -79,6 +79,16 @@ type PutMetricFilterInput struct { // This member is required. MetricTransformations []types.MetricTransformation + // This parameter is valid only for log groups that have an active log + // transformer. For more information about log transformers, see [PutTransformer]. + // + // If the log group uses either a log-group level or account-level transformer, + // and you specify true , the metric filter will be applied on the transformed + // version of the log events instead of the original ingested log events. + // + // [PutTransformer]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html + ApplyOnTransformedLogs bool + noSmithyDocumentSerde } diff --git a/service/cloudwatchlogs/api_op_PutSubscriptionFilter.go b/service/cloudwatchlogs/api_op_PutSubscriptionFilter.go index 4e4c6a3b04c..57a898e8213 100644 --- a/service/cloudwatchlogs/api_op_PutSubscriptionFilter.go +++ b/service/cloudwatchlogs/api_op_PutSubscriptionFilter.go @@ -108,6 +108,17 @@ type PutSubscriptionFilterInput struct { // This member is required. LogGroupName *string + // This parameter is valid only for log groups that have an active log + // transformer. For more information about log transformers, see [PutTransformer]. + // + // If the log group uses either a log-group level or account-level transformer, + // and you specify true , the subscription filter will be applied on the + // transformed version of the log events instead of the original ingested log + // events. + // + // [PutTransformer]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html + ApplyOnTransformedLogs bool + // The method used to distribute log data to the destination. By default, log data // is grouped by log stream, but the grouping can be set to random for a more even // distribution. This property is only applicable when the destination is an Amazon diff --git a/service/cloudwatchlogs/api_op_PutTransformer.go b/service/cloudwatchlogs/api_op_PutTransformer.go new file mode 100644 index 00000000000..cb26197a67d --- /dev/null +++ b/service/cloudwatchlogs/api_op_PutTransformer.go @@ -0,0 +1,197 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates or updates a log transformer for a single log group. You use log +// transformers to transform log events into a different format, making them easier +// for you to process and analyze. You can also transform logs from different +// sources into standardized formats that contains relevant, source-specific +// information. +// +// After you have created a transformer, CloudWatch Logs performs the +// transformations at the time of log ingestion. You can then refer to the +// transformed versions of the logs during operations such as querying with +// CloudWatch Logs Insights or creating metric filters or subscription filers. +// +// You can also use a transformer to copy metadata from metadata keys into the log +// events themselves. This metadata can include log group name, log stream name, +// account ID and Region. +// +// A transformer for a log group is a series of processors, where each processor +// applies one type of transformation to the log events ingested into this log +// group. The processors work one after another, in the order that you list them, +// like a pipeline. For more information about the available processors to use in a +// transformer, see [Processors that you can use]. +// +// Having log events in standardized format enables visibility across your +// applications for your log analysis, reporting, and alarming needs. CloudWatch +// Logs provides transformation for common log types with out-of-the-box +// transformation templates for major Amazon Web Services log sources such as VPC +// flow logs, Lambda, and Amazon RDS. You can use pre-built transformation +// templates or create custom transformation policies. +// +// You can create transformers only for the log groups in the Standard log class. +// +// You can also set up a transformer at the account level. For more information, +// see [PutAccountPolicy]. If there is both a log-group level transformer created with PutTransformer +// and an account-level transformer that could apply to the same log group, the log +// group uses only the log-group level transformer. It ignores the account-level +// transformer. +// +// [Processors that you can use]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-Processors +// [PutAccountPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutAccountPolicy.html +func (c *Client) PutTransformer(ctx context.Context, params *PutTransformerInput, optFns ...func(*Options)) (*PutTransformerOutput, error) { + if params == nil { + params = &PutTransformerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PutTransformer", params, optFns, c.addOperationPutTransformerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PutTransformerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PutTransformerInput struct { + + // Specify either the name or ARN of the log group to create the transformer for. + // + // This member is required. + LogGroupIdentifier *string + + // This structure contains the configuration of this log transformer. A log + // transformer is an array of processors, where each processor applies one type of + // transformation to the log events that are ingested. + // + // This member is required. + TransformerConfig []types.Processor + + noSmithyDocumentSerde +} + +type PutTransformerOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPutTransformerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpPutTransformer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpPutTransformer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PutTransformer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPutTransformerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPutTransformer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPutTransformer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PutTransformer", + } +} diff --git a/service/cloudwatchlogs/api_op_StartQuery.go b/service/cloudwatchlogs/api_op_StartQuery.go index 5ef1e826829..c78ee5fe8b6 100644 --- a/service/cloudwatchlogs/api_op_StartQuery.go +++ b/service/cloudwatchlogs/api_op_StartQuery.go @@ -10,8 +10,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Schedules a query of a log group using CloudWatch Logs Insights. You specify -// the log group and time range to query and the query string to use. +// Starts a query of one or more log groups using CloudWatch Logs Insights. You +// specify the log groups and time range to query and the query string to use. // // For more information, see [CloudWatch Logs Insights Query Syntax]. // @@ -19,6 +19,18 @@ import ( // CloudWatch Logs. You can use [GetQueryResults]to retrieve the results of a query, using the // queryId that StartQuery returns. // +// To specify the log groups to query, a StartQuery operation must include one of +// the following: +// +// - Either exactly one of the following parameters: logGroupName , logGroupNames +// , or logGroupIdentifiers +// +// - Or the queryString must include a SOURCE command to select log groups for +// the query. The SOURCE command can select log groups based on log group name +// prefix, account ID, and log class. +// +// For more information about the SOURCE command, see [SOURCE]. +// // If you have associated a KMS key with the query results in this account, then [StartQuery] // uses that key to encrypt the results when it stores them. If no key is // associated with query results, the query results are encrypted with the default @@ -38,6 +50,7 @@ import ( // // [CloudWatch Logs Insights Query Syntax]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax.html // [CloudWatch cross-account observability]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html +// [SOURCE]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CWL_QuerySyntax-Source.html // [GetQueryResults]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_GetQueryResults.html // [StartQuery]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_StartQuery.html func (c *Client) StartQuery(ctx context.Context, params *StartQueryInput, optFns ...func(*Options)) (*StartQueryOutput, error) { @@ -90,22 +103,18 @@ type StartQueryInput struct { // specify the ARN of the log group here. The query definition must also be defined // in the monitoring account. // - // If you specify an ARN, the ARN can't end with an asterisk (*). + // If you specify an ARN, use the format + // arn:aws:logs:region:account-id:log-group:log_group_name Don't include an * at + // the end. // // A StartQuery operation must include exactly one of the following parameters: // logGroupName , logGroupNames , or logGroupIdentifiers . LogGroupIdentifiers []string // The log group on which to perform the query. - // - // A StartQuery operation must include exactly one of the following parameters: - // logGroupName , logGroupNames , or logGroupIdentifiers . LogGroupName *string // The list of log groups to be queried. You can include up to 50 log groups. - // - // A StartQuery operation must include exactly one of the following parameters: - // logGroupName , logGroupNames , or logGroupIdentifiers . LogGroupNames []string noSmithyDocumentSerde diff --git a/service/cloudwatchlogs/api_op_TestTransformer.go b/service/cloudwatchlogs/api_op_TestTransformer.go new file mode 100644 index 00000000000..18a4ad1eacb --- /dev/null +++ b/service/cloudwatchlogs/api_op_TestTransformer.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package cloudwatchlogs + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/cloudwatchlogs/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Use this operation to test a log transformer. You enter the transformer +// configuration and a set of log events to test with. The operation responds with +// an array that includes the original log events and the transformed versions. +func (c *Client) TestTransformer(ctx context.Context, params *TestTransformerInput, optFns ...func(*Options)) (*TestTransformerOutput, error) { + if params == nil { + params = &TestTransformerInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TestTransformer", params, optFns, c.addOperationTestTransformerMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TestTransformerOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TestTransformerInput struct { + + // An array of the raw log events that you want to use to test this transformer. + // + // This member is required. + LogEventMessages []string + + // This structure contains the configuration of this log transformer that you want + // to test. A log transformer is an array of processors, where each processor + // applies one type of transformation to the log events that are ingested. + // + // This member is required. + TransformerConfig []types.Processor + + noSmithyDocumentSerde +} + +type TestTransformerOutput struct { + + // An array where each member of the array includes both the original version and + // the transformed version of one of the log events that you input. + TransformedLogs []types.TransformedLogRecord + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTestTransformerMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpTestTransformer{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpTestTransformer{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TestTransformer"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpTestTransformerValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTestTransformer(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTestTransformer(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TestTransformer", + } +} diff --git a/service/cloudwatchlogs/deserializers.go b/service/cloudwatchlogs/deserializers.go index b6e92e152c1..b587eba579a 100644 --- a/service/cloudwatchlogs/deserializers.go +++ b/service/cloudwatchlogs/deserializers.go @@ -1510,6 +1510,129 @@ func awsAwsjson11_deserializeOpErrorDeleteDestination(response *smithyhttp.Respo } } +type awsAwsjson11_deserializeOpDeleteIndexPolicy struct { +} + +func (*awsAwsjson11_deserializeOpDeleteIndexPolicy) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteIndexPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteIndexPolicy(response, &metadata) + } + output := &DeleteIndexPolicyOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDeleteIndexPolicyOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteIndexPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDeleteLogAnomalyDetector struct { } @@ -2310,6 +2433,107 @@ func awsAwsjson11_deserializeOpErrorDeleteSubscriptionFilter(response *smithyhtt } } +type awsAwsjson11_deserializeOpDeleteTransformer struct { +} + +func (*awsAwsjson11_deserializeOpDeleteTransformer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDeleteTransformer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDeleteTransformer(response, &metadata) + } + output := &DeleteTransformerOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDeleteTransformer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpDescribeAccountPolicies struct { } @@ -3138,14 +3362,14 @@ func awsAwsjson11_deserializeOpErrorDescribeExportTasks(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpDescribeLogGroups struct { +type awsAwsjson11_deserializeOpDescribeFieldIndexes struct { } -func (*awsAwsjson11_deserializeOpDescribeLogGroups) ID() string { +func (*awsAwsjson11_deserializeOpDescribeFieldIndexes) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeLogGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeFieldIndexes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3163,9 +3387,9 @@ func (m *awsAwsjson11_deserializeOpDescribeLogGroups) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLogGroups(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeFieldIndexes(response, &metadata) } - output := &DescribeLogGroupsOutput{} + output := &DescribeFieldIndexesOutput{} out.Result = output var buff [1024]byte @@ -3185,7 +3409,7 @@ func (m *awsAwsjson11_deserializeOpDescribeLogGroups) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeLogGroupsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeFieldIndexesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3199,7 +3423,7 @@ func (m *awsAwsjson11_deserializeOpDescribeLogGroups) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeLogGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeFieldIndexes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3239,6 +3463,15 @@ func awsAwsjson11_deserializeOpErrorDescribeLogGroups(response *smithyhttp.Respo case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -3252,14 +3485,14 @@ func awsAwsjson11_deserializeOpErrorDescribeLogGroups(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpDescribeLogStreams struct { +type awsAwsjson11_deserializeOpDescribeIndexPolicies struct { } -func (*awsAwsjson11_deserializeOpDescribeLogStreams) ID() string { +func (*awsAwsjson11_deserializeOpDescribeIndexPolicies) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeIndexPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3277,9 +3510,9 @@ func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLogStreams(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeIndexPolicies(response, &metadata) } - output := &DescribeLogStreamsOutput{} + output := &DescribeIndexPoliciesOutput{} out.Result = output var buff [1024]byte @@ -3299,7 +3532,7 @@ func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx con return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeLogStreamsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeIndexPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3313,7 +3546,7 @@ func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx con return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeLogStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeIndexPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3353,6 +3586,12 @@ func awsAwsjson11_deserializeOpErrorDescribeLogStreams(response *smithyhttp.Resp case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -3369,14 +3608,14 @@ func awsAwsjson11_deserializeOpErrorDescribeLogStreams(response *smithyhttp.Resp } } -type awsAwsjson11_deserializeOpDescribeMetricFilters struct { +type awsAwsjson11_deserializeOpDescribeLogGroups struct { } -func (*awsAwsjson11_deserializeOpDescribeMetricFilters) ID() string { +func (*awsAwsjson11_deserializeOpDescribeLogGroups) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpDescribeLogGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3394,9 +3633,9 @@ func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLogGroups(response, &metadata) } - output := &DescribeMetricFiltersOutput{} + output := &DescribeLogGroupsOutput{} out.Result = output var buff [1024]byte @@ -3416,7 +3655,7 @@ func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentDescribeMetricFiltersOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentDescribeLogGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3430,7 +3669,7 @@ func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorDescribeLogGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3470,8 +3709,239 @@ func awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response *smithyhttp.R case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDescribeLogStreams struct { +} + +func (*awsAwsjson11_deserializeOpDescribeLogStreams) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeLogStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeLogStreams(response, &metadata) + } + output := &DescribeLogStreamsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDescribeLogStreamsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDescribeLogStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpDescribeMetricFilters struct { +} + +func (*awsAwsjson11_deserializeOpDescribeMetricFilters) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpDescribeMetricFilters) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response, &metadata) + } + output := &DescribeMetricFiltersOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentDescribeMetricFiltersOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorDescribeMetricFilters(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) @@ -5363,14 +5833,14 @@ func awsAwsjson11_deserializeOpErrorGetQueryResults(response *smithyhttp.Respons } } -type awsAwsjson11_deserializeOpListAnomalies struct { +type awsAwsjson11_deserializeOpGetTransformer struct { } -func (*awsAwsjson11_deserializeOpListAnomalies) ID() string { +func (*awsAwsjson11_deserializeOpGetTransformer) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListAnomalies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpGetTransformer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5388,9 +5858,9 @@ func (m *awsAwsjson11_deserializeOpListAnomalies) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListAnomalies(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorGetTransformer(response, &metadata) } - output := &ListAnomaliesOutput{} + output := &GetTransformerOutput{} out.Result = output var buff [1024]byte @@ -5410,7 +5880,7 @@ func (m *awsAwsjson11_deserializeOpListAnomalies) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListAnomaliesOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentGetTransformerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -5424,7 +5894,7 @@ func (m *awsAwsjson11_deserializeOpListAnomalies) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListAnomalies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorGetTransformer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -5461,12 +5931,12 @@ func awsAwsjson11_deserializeOpErrorListAnomalies(response *smithyhttp.Response, errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("OperationAbortedException", errorCode): - return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -5483,14 +5953,14 @@ func awsAwsjson11_deserializeOpErrorListAnomalies(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpListLogAnomalyDetectors struct { +type awsAwsjson11_deserializeOpListAnomalies struct { } -func (*awsAwsjson11_deserializeOpListLogAnomalyDetectors) ID() string { +func (*awsAwsjson11_deserializeOpListAnomalies) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListLogAnomalyDetectors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListAnomalies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -5508,9 +5978,129 @@ func (m *awsAwsjson11_deserializeOpListLogAnomalyDetectors) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListLogAnomalyDetectors(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListAnomalies(response, &metadata) } - output := &ListLogAnomalyDetectorsOutput{} + output := &ListAnomaliesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListAnomaliesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListAnomalies(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListLogAnomalyDetectors struct { +} + +func (*awsAwsjson11_deserializeOpListLogAnomalyDetectors) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListLogAnomalyDetectors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListLogAnomalyDetectors(response, &metadata) + } + output := &ListLogAnomalyDetectorsOutput{} out.Result = output var buff [1024]byte @@ -5603,6 +6193,126 @@ func awsAwsjson11_deserializeOpErrorListLogAnomalyDetectors(response *smithyhttp } } +type awsAwsjson11_deserializeOpListLogGroupsForQuery struct { +} + +func (*awsAwsjson11_deserializeOpListLogGroupsForQuery) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListLogGroupsForQuery) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListLogGroupsForQuery(response, &metadata) + } + output := &ListLogGroupsForQueryOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListLogGroupsForQueryOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListLogGroupsForQuery(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson11_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpListTagsForResource struct { } @@ -6661,14 +7371,14 @@ func awsAwsjson11_deserializeOpErrorPutDestinationPolicy(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpPutLogEvents struct { +type awsAwsjson11_deserializeOpPutIndexPolicy struct { } -func (*awsAwsjson11_deserializeOpPutLogEvents) ID() string { +func (*awsAwsjson11_deserializeOpPutIndexPolicy) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpPutIndexPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6686,9 +7396,9 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorPutLogEvents(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorPutIndexPolicy(response, &metadata) } - output := &PutLogEventsOutput{} + output := &PutIndexPolicyOutput{} out.Result = output var buff [1024]byte @@ -6708,7 +7418,7 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentPutLogEventsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentPutIndexPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6722,7 +7432,7 @@ func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.C return out, metadata, err } -func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorPutIndexPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6759,14 +7469,14 @@ func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("DataAlreadyAcceptedException", errorCode): - return awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response, errorBody) - case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) - case strings.EqualFold("InvalidSequenceTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidSequenceTokenException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) @@ -6774,9 +7484,6 @@ func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, case strings.EqualFold("ServiceUnavailableException", errorCode): return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("UnrecognizedClientException", errorCode): - return awsAwsjson11_deserializeErrorUnrecognizedClientException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -6787,10 +7494,136 @@ func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, } } -type awsAwsjson11_deserializeOpPutMetricFilter struct { +type awsAwsjson11_deserializeOpPutLogEvents struct { } -func (*awsAwsjson11_deserializeOpPutMetricFilter) ID() string { +func (*awsAwsjson11_deserializeOpPutLogEvents) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutLogEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutLogEvents(response, &metadata) + } + output := &PutLogEventsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentPutLogEventsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorPutLogEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("DataAlreadyAcceptedException", errorCode): + return awsAwsjson11_deserializeErrorDataAlreadyAcceptedException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("InvalidSequenceTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidSequenceTokenException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("UnrecognizedClientException", errorCode): + return awsAwsjson11_deserializeErrorUnrecognizedClientException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutMetricFilter struct { +} + +func (*awsAwsjson11_deserializeOpPutMetricFilter) ID() string { return "OperationDeserializer" } @@ -6863,6 +7696,9 @@ func awsAwsjson11_deserializeOpErrorPutMetricFilter(response *smithyhttp.Respons errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -7299,6 +8135,113 @@ func awsAwsjson11_deserializeOpErrorPutSubscriptionFilter(response *smithyhttp.R errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("OperationAbortedException", errorCode): + return awsAwsjson11_deserializeErrorOperationAbortedException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpPutTransformer struct { +} + +func (*awsAwsjson11_deserializeOpPutTransformer) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpPutTransformer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorPutTransformer(response, &metadata) + } + output := &PutTransformerOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorPutTransformer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + case strings.EqualFold("InvalidParameterException", errorCode): return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) @@ -7963,14 +8906,14 @@ func awsAwsjson11_deserializeOpErrorTestMetricFilter(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpUntagLogGroup struct { +type awsAwsjson11_deserializeOpTestTransformer struct { } -func (*awsAwsjson11_deserializeOpUntagLogGroup) ID() string { +func (*awsAwsjson11_deserializeOpTestTransformer) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpTestTransformer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -7988,20 +8931,137 @@ func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorUntagLogGroup(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorTestTransformer(response, &metadata) } - output := &UntagLogGroupOutput{} + output := &TestTransformerOutput{} 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), + 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 } - return out, metadata, err -} - + err = awsAwsjson11_deserializeOpDocumentTestTransformerOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorTestTransformer(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InvalidOperationException", errorCode): + return awsAwsjson11_deserializeErrorInvalidOperationException(response, errorBody) + + case strings.EqualFold("InvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorInvalidParameterException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpUntagLogGroup struct { +} + +func (*awsAwsjson11_deserializeOpUntagLogGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpUntagLogGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorUntagLogGroup(response, &metadata) + } + output := &UntagLogGroupOutput{} + out.Result = output + + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + return out, metadata, err +} + func awsAwsjson11_deserializeOpErrorUntagLogGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { @@ -9955,6 +11015,134 @@ func awsAwsjson11_deserializeDocumentAccountPolicy(v **types.AccountPolicy, valu return nil } +func awsAwsjson11_deserializeDocumentAddKeyEntries(v *[]types.AddKeyEntry, 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.AddKeyEntry + if *v == nil { + cv = []types.AddKeyEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AddKeyEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAddKeyEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentAddKeyEntry(v **types.AddKeyEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AddKeyEntry + if *v == nil { + sv = &types.AddKeyEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Key to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "overwriteIfExists": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected OverwriteIfExists to be of type *bool, got %T instead", value) + } + sv.OverwriteIfExists = jtv + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AddKeyValue to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAddKeys(v **types.AddKeys, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AddKeys + if *v == nil { + sv = &types.AddKeys{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "entries": + if err := awsAwsjson11_deserializeDocumentAddKeyEntries(&sv.Entries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentAllowedFieldDelimiters(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10424,6 +11612,42 @@ func awsAwsjson11_deserializeDocumentAnomalyDetectors(v *[]types.AnomalyDetector return nil } +func awsAwsjson11_deserializeDocumentColumns(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 Column to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentConfigurationTemplate(v **types.ConfigurationTemplate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10649,7 +11873,7 @@ func awsAwsjson11_deserializeDocumentConflictException(v **types.ConflictExcepti return nil } -func awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(v **types.DataAlreadyAcceptedException, value interface{}) error { +func awsAwsjson11_deserializeDocumentCopyValue(v **types.CopyValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10662,31 +11886,18 @@ func awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(v **types.Data return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DataAlreadyAcceptedException + var sv *types.CopyValue if *v == nil { - sv = &types.DataAlreadyAcceptedException{} + sv = &types.CopyValue{} } else { sv = *v } for key, value := range shape { switch key { - case "expectedSequenceToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SequenceToken to be of type string, got %T instead", value) - } - sv.ExpectedSequenceToken = ptr.String(jtv) - } - - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "entries": + if err := awsAwsjson11_deserializeDocumentCopyValueEntries(&sv.Entries, value); err != nil { + return err } default: @@ -10698,7 +11909,7 @@ func awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(v **types.Data return nil } -func awsAwsjson11_deserializeDocumentDeliveries(v *[]types.Delivery, value interface{}) error { +func awsAwsjson11_deserializeDocumentCopyValueEntries(v *[]types.CopyValueEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10711,17 +11922,17 @@ func awsAwsjson11_deserializeDocumentDeliveries(v *[]types.Delivery, value inter return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Delivery + var cv []types.CopyValueEntry if *v == nil { - cv = []types.Delivery{} + cv = []types.CopyValueEntry{} } else { cv = *v } for _, value := range shape { - var col types.Delivery + var col types.CopyValueEntry destAddr := &col - if err := awsAwsjson11_deserializeDocumentDelivery(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentCopyValueEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -10732,7 +11943,7 @@ func awsAwsjson11_deserializeDocumentDeliveries(v *[]types.Delivery, value inter return nil } -func awsAwsjson11_deserializeDocumentDelivery(v **types.Delivery, value interface{}) error { +func awsAwsjson11_deserializeDocumentCopyValueEntry(v **types.CopyValueEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10745,82 +11956,152 @@ func awsAwsjson11_deserializeDocumentDelivery(v **types.Delivery, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Delivery + var sv *types.CopyValueEntry if *v == nil { - sv = &types.Delivery{} + sv = &types.CopyValueEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": + case "overwriteIfExists": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected OverwriteIfExists to be of type *bool, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.OverwriteIfExists = jtv } - case "deliveryDestinationArn": + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.DeliveryDestinationArn = ptr.String(jtv) + sv.Source = ptr.String(jtv) } - case "deliveryDestinationType": + case "target": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DeliveryDestinationType to be of type string, got %T instead", value) + return fmt.Errorf("expected Target to be of type string, got %T instead", value) } - sv.DeliveryDestinationType = types.DeliveryDestinationType(jtv) + sv.Target = ptr.String(jtv) } - case "deliverySourceName": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentCSV(v **types.CSV, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CSV + if *v == nil { + sv = &types.CSV{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "columns": + if err := awsAwsjson11_deserializeDocumentColumns(&sv.Columns, value); err != nil { + return err + } + + case "delimiter": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DeliverySourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected Delimiter to be of type string, got %T instead", value) } - sv.DeliverySourceName = ptr.String(jtv) + sv.Delimiter = ptr.String(jtv) } - case "fieldDelimiter": + case "quoteCharacter": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected FieldDelimiter to be of type string, got %T instead", value) + return fmt.Errorf("expected QuoteCharacter to be of type string, got %T instead", value) } - sv.FieldDelimiter = ptr.String(jtv) + sv.QuoteCharacter = ptr.String(jtv) } - case "id": + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DeliveryId to be of type string, got %T instead", value) + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.Source = ptr.String(jtv) } - case "recordFields": - if err := awsAwsjson11_deserializeDocumentRecordFields(&sv.RecordFields, value); err != nil { - return err - } + default: + _, _ = key, value - case "s3DeliveryConfiguration": - if err := awsAwsjson11_deserializeDocumentS3DeliveryConfiguration(&sv.S3DeliveryConfiguration, value); err != nil { - return err + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDataAlreadyAcceptedException(v **types.DataAlreadyAcceptedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DataAlreadyAcceptedException + if *v == nil { + sv = &types.DataAlreadyAcceptedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expectedSequenceToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SequenceToken to be of type string, got %T instead", value) + } + sv.ExpectedSequenceToken = ptr.String(jtv) } - case "tags": - if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { - return err + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) } default: @@ -10832,7 +12113,7 @@ func awsAwsjson11_deserializeDocumentDelivery(v **types.Delivery, value interfac return nil } -func awsAwsjson11_deserializeDocumentDeliveryDestination(v **types.DeliveryDestination, value interface{}) error { +func awsAwsjson11_deserializeDocumentDateTimeConverter(v **types.DateTimeConverter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10845,59 +12126,72 @@ func awsAwsjson11_deserializeDocumentDeliveryDestination(v **types.DeliveryDesti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DeliveryDestination + var sv *types.DateTimeConverter if *v == nil { - sv = &types.DeliveryDestination{} + sv = &types.DateTimeConverter{} } else { sv = *v } for key, value := range shape { switch key { - case "arn": + case "locale": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + return fmt.Errorf("expected Locale to be of type string, got %T instead", value) } - sv.Arn = ptr.String(jtv) + sv.Locale = ptr.String(jtv) } - case "deliveryDestinationConfiguration": - if err := awsAwsjson11_deserializeDocumentDeliveryDestinationConfiguration(&sv.DeliveryDestinationConfiguration, value); err != nil { + case "matchPatterns": + if err := awsAwsjson11_deserializeDocumentMatchPatterns(&sv.MatchPatterns, value); err != nil { return err } - case "deliveryDestinationType": + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DeliveryDestinationType to be of type string, got %T instead", value) + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.DeliveryDestinationType = types.DeliveryDestinationType(jtv) + sv.Source = ptr.String(jtv) } - case "name": + case "sourceTimezone": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DeliveryDestinationName to be of type string, got %T instead", value) + return fmt.Errorf("expected SourceTimezone to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.SourceTimezone = ptr.String(jtv) } - case "outputFormat": + case "target": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected OutputFormat to be of type string, got %T instead", value) + return fmt.Errorf("expected Target to be of type string, got %T instead", value) } - sv.OutputFormat = types.OutputFormat(jtv) + sv.Target = ptr.String(jtv) } - case "tags": - if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { - return err + case "targetFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetFormat to be of type string, got %T instead", value) + } + sv.TargetFormat = ptr.String(jtv) + } + + case "targetTimezone": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetTimezone to be of type string, got %T instead", value) + } + sv.TargetTimezone = ptr.String(jtv) } default: @@ -10909,7 +12203,7 @@ func awsAwsjson11_deserializeDocumentDeliveryDestination(v **types.DeliveryDesti return nil } -func awsAwsjson11_deserializeDocumentDeliveryDestinationConfiguration(v **types.DeliveryDestinationConfiguration, value interface{}) error { +func awsAwsjson11_deserializeDocumentDeleteKeys(v **types.DeleteKeys, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10922,22 +12216,18 @@ func awsAwsjson11_deserializeDocumentDeliveryDestinationConfiguration(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DeliveryDestinationConfiguration + var sv *types.DeleteKeys if *v == nil { - sv = &types.DeliveryDestinationConfiguration{} + sv = &types.DeleteKeys{} } else { sv = *v } for key, value := range shape { switch key { - case "destinationResourceArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - sv.DestinationResourceArn = ptr.String(jtv) + case "withKeys": + if err := awsAwsjson11_deserializeDocumentDeleteWithKeys(&sv.WithKeys, value); err != nil { + return err } default: @@ -10949,7 +12239,7 @@ func awsAwsjson11_deserializeDocumentDeliveryDestinationConfiguration(v **types. return nil } -func awsAwsjson11_deserializeDocumentDeliveryDestinations(v *[]types.DeliveryDestination, value interface{}) error { +func awsAwsjson11_deserializeDocumentDeleteWithKeys(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10962,17 +12252,53 @@ func awsAwsjson11_deserializeDocumentDeliveryDestinations(v *[]types.DeliveryDes return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.DeliveryDestination + var cv []string if *v == nil { - cv = []types.DeliveryDestination{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.DeliveryDestination + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WithKey to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDeliveries(v *[]types.Delivery, 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.Delivery + if *v == nil { + cv = []types.Delivery{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Delivery destAddr := &col - if err := awsAwsjson11_deserializeDocumentDeliveryDestination(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentDelivery(&destAddr, value); err != nil { return err } col = *destAddr @@ -10983,7 +12309,7 @@ func awsAwsjson11_deserializeDocumentDeliveryDestinations(v *[]types.DeliveryDes return nil } -func awsAwsjson11_deserializeDocumentDeliverySource(v **types.DeliverySource, value interface{}) error { +func awsAwsjson11_deserializeDocumentDelivery(v **types.Delivery, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10996,9 +12322,9 @@ func awsAwsjson11_deserializeDocumentDeliverySource(v **types.DeliverySource, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.DeliverySource + var sv *types.Delivery if *v == nil { - sv = &types.DeliverySource{} + sv = &types.Delivery{} } else { sv = *v } @@ -11014,40 +12340,291 @@ func awsAwsjson11_deserializeDocumentDeliverySource(v **types.DeliverySource, va sv.Arn = ptr.String(jtv) } - case "logType": + case "deliveryDestinationArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LogType to be of type string, got %T instead", value) + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) } - sv.LogType = ptr.String(jtv) + sv.DeliveryDestinationArn = ptr.String(jtv) } - case "name": + case "deliveryDestinationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliveryDestinationType to be of type string, got %T instead", value) + } + sv.DeliveryDestinationType = types.DeliveryDestinationType(jtv) + } + + case "deliverySourceName": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected DeliverySourceName to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.DeliverySourceName = ptr.String(jtv) } - case "resourceArns": - if err := awsAwsjson11_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil { - return err + case "fieldDelimiter": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldDelimiter to be of type string, got %T instead", value) + } + sv.FieldDelimiter = ptr.String(jtv) } - case "service": + case "id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Service to be of type string, got %T instead", value) + return fmt.Errorf("expected DeliveryId to be of type string, got %T instead", value) } - sv.Service = ptr.String(jtv) + sv.Id = ptr.String(jtv) } - case "tags": - if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { + case "recordFields": + if err := awsAwsjson11_deserializeDocumentRecordFields(&sv.RecordFields, value); err != nil { + return err + } + + case "s3DeliveryConfiguration": + if err := awsAwsjson11_deserializeDocumentS3DeliveryConfiguration(&sv.S3DeliveryConfiguration, value); err != nil { + return err + } + + case "tags": + if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDeliveryDestination(v **types.DeliveryDestination, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DeliveryDestination + if *v == nil { + sv = &types.DeliveryDestination{} + } 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 "deliveryDestinationConfiguration": + if err := awsAwsjson11_deserializeDocumentDeliveryDestinationConfiguration(&sv.DeliveryDestinationConfiguration, value); err != nil { + return err + } + + case "deliveryDestinationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliveryDestinationType to be of type string, got %T instead", value) + } + sv.DeliveryDestinationType = types.DeliveryDestinationType(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliveryDestinationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "outputFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected OutputFormat to be of type string, got %T instead", value) + } + sv.OutputFormat = types.OutputFormat(jtv) + } + + case "tags": + if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDeliveryDestinationConfiguration(v **types.DeliveryDestinationConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DeliveryDestinationConfiguration + if *v == nil { + sv = &types.DeliveryDestinationConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "destinationResourceArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Arn to be of type string, got %T instead", value) + } + sv.DestinationResourceArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentDeliveryDestinations(v *[]types.DeliveryDestination, 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.DeliveryDestination + if *v == nil { + cv = []types.DeliveryDestination{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DeliveryDestination + destAddr := &col + if err := awsAwsjson11_deserializeDocumentDeliveryDestination(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentDeliverySource(v **types.DeliverySource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DeliverySource + if *v == nil { + sv = &types.DeliverySource{} + } 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 "logType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogType to be of type string, got %T instead", value) + } + sv.LogType = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliverySourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "resourceArns": + if err := awsAwsjson11_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil { + return err + } + + case "service": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Service to be of type string, got %T instead", value) + } + sv.Service = ptr.String(jtv) + } + + case "tags": + if err := awsAwsjson11_deserializeDocumentTags(&sv.Tags, value); err != nil { return err } @@ -11581,7 +13158,7 @@ func awsAwsjson11_deserializeDocumentExtractedValues(v *map[string]string, value return nil } -func awsAwsjson11_deserializeDocumentFilteredLogEvent(v **types.FilteredLogEvent, value interface{}) error { +func awsAwsjson11_deserializeDocumentFieldIndex(v **types.FieldIndex, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11594,25 +13171,25 @@ func awsAwsjson11_deserializeDocumentFilteredLogEvent(v **types.FilteredLogEvent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.FilteredLogEvent + var sv *types.FieldIndex if *v == nil { - sv = &types.FilteredLogEvent{} + sv = &types.FieldIndex{} } else { sv = *v } for key, value := range shape { switch key { - case "eventId": + case "fieldIndexName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EventId to be of type string, got %T instead", value) + return fmt.Errorf("expected FieldIndexName to be of type string, got %T instead", value) } - sv.EventId = ptr.String(jtv) + sv.FieldIndexName = ptr.String(jtv) } - case "ingestionTime": + case "firstEventTime": if value != nil { jtv, ok := value.(json.Number) if !ok { @@ -11622,16 +13199,138 @@ func awsAwsjson11_deserializeDocumentFilteredLogEvent(v **types.FilteredLogEvent if err != nil { return err } - sv.IngestionTime = ptr.Int64(i64) + sv.FirstEventTime = ptr.Int64(i64) } - case "logStreamName": + case "lastEventTime": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected LogStreamName to be of type string, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } - sv.LogStreamName = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastEventTime = ptr.Int64(i64) + } + + case "lastScanTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastScanTime = ptr.Int64(i64) + } + + case "logGroupIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogGroupIdentifier to be of type string, got %T instead", value) + } + sv.LogGroupIdentifier = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentFieldIndexes(v *[]types.FieldIndex, 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.FieldIndex + if *v == nil { + cv = []types.FieldIndex{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.FieldIndex + destAddr := &col + if err := awsAwsjson11_deserializeDocumentFieldIndex(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentFilteredLogEvent(v **types.FilteredLogEvent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.FilteredLogEvent + if *v == nil { + sv = &types.FilteredLogEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "eventId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventId to be of type string, got %T instead", value) + } + sv.EventId = ptr.String(jtv) + } + + case "ingestionTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.IngestionTime = ptr.Int64(i64) + } + + case "logStreamName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogStreamName to be of type string, got %T instead", value) + } + sv.LogStreamName = ptr.String(jtv) } case "message": @@ -11699,6 +13398,55 @@ func awsAwsjson11_deserializeDocumentFilteredLogEvents(v *[]types.FilteredLogEve return nil } +func awsAwsjson11_deserializeDocumentGrok(v **types.Grok, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Grok + if *v == nil { + sv = &types.Grok{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "match": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GrokMatch to be of type string, got %T instead", value) + } + sv.Match = ptr.String(jtv) + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentHistogram(v *map[string]int64, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11739,6 +13487,120 @@ func awsAwsjson11_deserializeDocumentHistogram(v *map[string]int64, value interf return nil } +func awsAwsjson11_deserializeDocumentIndexPolicies(v *[]types.IndexPolicy, 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.IndexPolicy + if *v == nil { + cv = []types.IndexPolicy{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IndexPolicy + destAddr := &col + if err := awsAwsjson11_deserializeDocumentIndexPolicy(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentIndexPolicy(v **types.IndexPolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.IndexPolicy + if *v == nil { + sv = &types.IndexPolicy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lastUpdateTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastUpdateTime = ptr.Int64(i64) + } + + case "logGroupIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogGroupIdentifier to be of type string, got %T instead", value) + } + sv.LogGroupIdentifier = ptr.String(jtv) + } + + case "policyDocument": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) + } + sv.PolicyDocument = ptr.String(jtv) + } + + case "policyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + } + sv.PolicyName = ptr.String(jtv) + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IndexSource to be of type string, got %T instead", value) + } + sv.Source = types.IndexSource(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentInheritedProperties(v *[]types.InheritedProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11944,7 +13806,7 @@ func awsAwsjson11_deserializeDocumentLimitExceededException(v **types.LimitExcee return nil } -func awsAwsjson11_deserializeDocumentLogEvent(v **types.LogEvent, value interface{}) error { +func awsAwsjson11_deserializeDocumentListToMap(v **types.ListToMap, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11957,16 +13819,101 @@ func awsAwsjson11_deserializeDocumentLogEvent(v **types.LogEvent, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.LogEvent + var sv *types.ListToMap if *v == nil { - sv = &types.LogEvent{} + sv = &types.ListToMap{} } else { sv = *v } for key, value := range shape { switch key { - case "message": + case "flatten": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Flatten to be of type *bool, got %T instead", value) + } + sv.Flatten = jtv + } + + case "flattenedElement": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FlattenedElement to be of type string, got %T instead", value) + } + sv.FlattenedElement = types.FlattenedElement(jtv) + } + + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Key to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Target to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) + } + + case "valueKey": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValueKey to be of type string, got %T instead", value) + } + sv.ValueKey = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentLogEvent(v **types.LogEvent, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.LogEvent + if *v == nil { + sv = &types.LogEvent{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": if value != nil { jtv, ok := value.(string) if !ok { @@ -12262,6 +14209,42 @@ func awsAwsjson11_deserializeDocumentLogGroupFieldList(v *[]types.LogGroupField, return nil } +func awsAwsjson11_deserializeDocumentLogGroupIdentifiers(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 LogGroupIdentifier to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentLogGroupNames(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12559,6 +14542,78 @@ func awsAwsjson11_deserializeDocumentLogStreams(v *[]types.LogStream, value inte return nil } +func awsAwsjson11_deserializeDocumentLowerCaseString(v **types.LowerCaseString, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.LowerCaseString + if *v == nil { + sv = &types.LowerCaseString{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "withKeys": + if err := awsAwsjson11_deserializeDocumentLowerCaseStringWithKeys(&sv.WithKeys, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentLowerCaseStringWithKeys(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 WithKey to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentMalformedQueryException(v **types.MalformedQueryException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12604,6 +14659,42 @@ func awsAwsjson11_deserializeDocumentMalformedQueryException(v **types.Malformed return nil } +func awsAwsjson11_deserializeDocumentMatchPatterns(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 MatchPattern to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentMetricFilter(v **types.MetricFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12626,6 +14717,15 @@ func awsAwsjson11_deserializeDocumentMetricFilter(v **types.MetricFilter, value for key, value := range shape { switch key { + case "applyOnTransformedLogs": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected ApplyOnTransformedLogs to be of type *bool, got %T instead", value) + } + sv.ApplyOnTransformedLogs = jtv + } + case "creationTime": if value != nil { jtv, ok := value.(json.Number) @@ -12946,7 +15046,41 @@ func awsAwsjson11_deserializeDocumentMetricTransformations(v *[]types.MetricTran return nil } -func awsAwsjson11_deserializeDocumentOperationAbortedException(v **types.OperationAbortedException, value interface{}) error { +func awsAwsjson11_deserializeDocumentMoveKeyEntries(v *[]types.MoveKeyEntry, 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.MoveKeyEntry + if *v == nil { + cv = []types.MoveKeyEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MoveKeyEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentMoveKeyEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentMoveKeyEntry(v **types.MoveKeyEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12959,22 +15093,40 @@ func awsAwsjson11_deserializeDocumentOperationAbortedException(v **types.Operati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.OperationAbortedException + var sv *types.MoveKeyEntry if *v == nil { - sv = &types.OperationAbortedException{} + sv = &types.MoveKeyEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "message", "Message": + case "overwriteIfExists": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected OverwriteIfExists to be of type *bool, got %T instead", value) + } + sv.OverwriteIfExists = jtv + } + + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Source = ptr.String(jtv) + } + + case "target": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Target to be of type string, got %T instead", value) + } + sv.Target = ptr.String(jtv) } default: @@ -12986,7 +15138,83 @@ func awsAwsjson11_deserializeDocumentOperationAbortedException(v **types.Operati return nil } -func awsAwsjson11_deserializeDocumentOutputFormats(v *[]types.OutputFormat, value interface{}) error { +func awsAwsjson11_deserializeDocumentMoveKeys(v **types.MoveKeys, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.MoveKeys + if *v == nil { + sv = &types.MoveKeys{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "entries": + if err := awsAwsjson11_deserializeDocumentMoveKeyEntries(&sv.Entries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentOperationAbortedException(v **types.OperationAbortedException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.OperationAbortedException + if *v == nil { + sv = &types.OperationAbortedException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentOutputFormats(v *[]types.OutputFormat, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13122,7 +15350,7 @@ func awsAwsjson11_deserializeDocumentOutputLogEvents(v *[]types.OutputLogEvent, return nil } -func awsAwsjson11_deserializeDocumentPatternToken(v **types.PatternToken, value interface{}) error { +func awsAwsjson11_deserializeDocumentParseCloudfront(v **types.ParseCloudfront, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13135,58 +15363,71 @@ func awsAwsjson11_deserializeDocumentPatternToken(v **types.PatternToken, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PatternToken + var sv *types.ParseCloudfront if *v == nil { - sv = &types.PatternToken{} + sv = &types.ParseCloudfront{} } else { sv = *v } for key, value := range shape { switch key { - case "dynamicTokenPosition": + case "source": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DynamicTokenPosition to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.DynamicTokenPosition = int32(i64) + sv.Source = ptr.String(jtv) } - case "enumerations": - if err := awsAwsjson11_deserializeDocumentEnumerations(&sv.Enumerations, value); err != nil { - return err - } + default: + _, _ = key, value - case "inferredTokenName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InferredTokenName to be of type string, got %T instead", value) - } - sv.InferredTokenName = ptr.String(jtv) - } + } + } + *v = sv + return nil +} - case "isDynamic": +func awsAwsjson11_deserializeDocumentParseJSON(v **types.ParseJSON, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ParseJSON + if *v == nil { + sv = &types.ParseJSON{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "destination": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected DestinationField to be of type string, got %T instead", value) } - sv.IsDynamic = ptr.Bool(jtv) + sv.Destination = ptr.String(jtv) } - case "tokenString": + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TokenString to be of type string, got %T instead", value) + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.TokenString = ptr.String(jtv) + sv.Source = ptr.String(jtv) } default: @@ -13198,7 +15439,7 @@ func awsAwsjson11_deserializeDocumentPatternToken(v **types.PatternToken, value return nil } -func awsAwsjson11_deserializeDocumentPatternTokens(v *[]types.PatternToken, value interface{}) error { +func awsAwsjson11_deserializeDocumentParseKeyValue(v **types.ParseKeyValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13206,33 +15447,93 @@ func awsAwsjson11_deserializeDocumentPatternTokens(v *[]types.PatternToken, valu return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.PatternToken + var sv *types.ParseKeyValue if *v == nil { - cv = []types.PatternToken{} + sv = &types.ParseKeyValue{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.PatternToken - destAddr := &col - if err := awsAwsjson11_deserializeDocumentPatternToken(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "destination": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DestinationField to be of type string, got %T instead", value) + } + sv.Destination = ptr.String(jtv) + } + + case "fieldDelimiter": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ParserFieldDelimiter to be of type string, got %T instead", value) + } + sv.FieldDelimiter = ptr.String(jtv) + } + + case "keyPrefix": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KeyPrefix to be of type string, got %T instead", value) + } + sv.KeyPrefix = ptr.String(jtv) + } + + case "keyValueDelimiter": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected KeyValueDelimiter to be of type string, got %T instead", value) + } + sv.KeyValueDelimiter = ptr.String(jtv) + } + + case "nonMatchValue": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NonMatchValue to be of type string, got %T instead", value) + } + sv.NonMatchValue = ptr.String(jtv) + } + + case "overwriteIfExists": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected OverwriteIfExists to be of type *bool, got %T instead", value) + } + sv.OverwriteIfExists = jtv + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) error { +func awsAwsjson11_deserializeDocumentParsePostgres(v **types.ParsePostgres, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13245,22 +15546,22 @@ func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Policy + var sv *types.ParsePostgres if *v == nil { - sv = &types.Policy{} + sv = &types.ParsePostgres{} } else { sv = *v } for key, value := range shape { switch key { - case "deliveryDestinationPolicy": + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DeliveryDestinationPolicy to be of type string, got %T instead", value) + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.DeliveryDestinationPolicy = ptr.String(jtv) + sv.Source = ptr.String(jtv) } default: @@ -13272,7 +15573,7 @@ func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) return nil } -func awsAwsjson11_deserializeDocumentQueryCompileError(v **types.QueryCompileError, value interface{}) error { +func awsAwsjson11_deserializeDocumentParseRoute53(v **types.ParseRoute53, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13285,27 +15586,22 @@ func awsAwsjson11_deserializeDocumentQueryCompileError(v **types.QueryCompileErr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QueryCompileError + var sv *types.ParseRoute53 if *v == nil { - sv = &types.QueryCompileError{} + sv = &types.ParseRoute53{} } else { sv = *v } for key, value := range shape { switch key { - case "location": - if err := awsAwsjson11_deserializeDocumentQueryCompileErrorLocation(&sv.Location, value); err != nil { - return err - } - - case "message": + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.Source = ptr.String(jtv) } default: @@ -13317,7 +15613,7 @@ func awsAwsjson11_deserializeDocumentQueryCompileError(v **types.QueryCompileErr return nil } -func awsAwsjson11_deserializeDocumentQueryCompileErrorLocation(v **types.QueryCompileErrorLocation, value interface{}) error { +func awsAwsjson11_deserializeDocumentParseVPC(v **types.ParseVPC, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13330,39 +15626,22 @@ func awsAwsjson11_deserializeDocumentQueryCompileErrorLocation(v **types.QueryCo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QueryCompileErrorLocation + var sv *types.ParseVPC if *v == nil { - sv = &types.QueryCompileErrorLocation{} + sv = &types.ParseVPC{} } else { sv = *v } for key, value := range shape { switch key { - case "endCharOffset": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected QueryCharOffset to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.EndCharOffset = ptr.Int32(int32(i64)) - } - - case "startCharOffset": + case "source": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryCharOffset to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.StartCharOffset = ptr.Int32(int32(i64)) + sv.Source = ptr.String(jtv) } default: @@ -13374,7 +15653,7 @@ func awsAwsjson11_deserializeDocumentQueryCompileErrorLocation(v **types.QueryCo return nil } -func awsAwsjson11_deserializeDocumentQueryDefinition(v **types.QueryDefinition, value interface{}) error { +func awsAwsjson11_deserializeDocumentParseWAF(v **types.ParseWAF, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13387,58 +15666,172 @@ func awsAwsjson11_deserializeDocumentQueryDefinition(v **types.QueryDefinition, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QueryDefinition + var sv *types.ParseWAF if *v == nil { - sv = &types.QueryDefinition{} + sv = &types.ParseWAF{} } else { sv = *v } for key, value := range shape { switch key { - case "lastModified": + case "source": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.LastModified = ptr.Int64(i64) + sv.Source = ptr.String(jtv) } - case "logGroupNames": - if err := awsAwsjson11_deserializeDocumentLogGroupNames(&sv.LogGroupNames, value); err != nil { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPatternToken(v **types.PatternToken, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PatternToken + if *v == nil { + sv = &types.PatternToken{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dynamicTokenPosition": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected DynamicTokenPosition to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DynamicTokenPosition = int32(i64) + } + + case "enumerations": + if err := awsAwsjson11_deserializeDocumentEnumerations(&sv.Enumerations, value); err != nil { return err } - case "name": + case "inferredTokenName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryDefinitionName to be of type string, got %T instead", value) + return fmt.Errorf("expected InferredTokenName to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.InferredTokenName = ptr.String(jtv) } - case "queryDefinitionId": + case "isDynamic": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.IsDynamic = ptr.Bool(jtv) + } + + case "tokenString": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryId to be of type string, got %T instead", value) + return fmt.Errorf("expected TokenString to be of type string, got %T instead", value) } - sv.QueryDefinitionId = ptr.String(jtv) + sv.TokenString = ptr.String(jtv) } - case "queryString": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentPatternTokens(v *[]types.PatternToken, 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.PatternToken + if *v == nil { + cv = []types.PatternToken{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.PatternToken + destAddr := &col + if err := awsAwsjson11_deserializeDocumentPatternToken(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentPolicy(v **types.Policy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Policy + if *v == nil { + sv = &types.Policy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "deliveryDestinationPolicy": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryDefinitionString to be of type string, got %T instead", value) + return fmt.Errorf("expected DeliveryDestinationPolicy to be of type string, got %T instead", value) } - sv.QueryString = ptr.String(jtv) + sv.DeliveryDestinationPolicy = ptr.String(jtv) } default: @@ -13450,7 +15843,148 @@ func awsAwsjson11_deserializeDocumentQueryDefinition(v **types.QueryDefinition, return nil } -func awsAwsjson11_deserializeDocumentQueryDefinitionList(v *[]types.QueryDefinition, value interface{}) error { +func awsAwsjson11_deserializeDocumentProcessor(v **types.Processor, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Processor + if *v == nil { + sv = &types.Processor{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "addKeys": + if err := awsAwsjson11_deserializeDocumentAddKeys(&sv.AddKeys, value); err != nil { + return err + } + + case "copyValue": + if err := awsAwsjson11_deserializeDocumentCopyValue(&sv.CopyValue, value); err != nil { + return err + } + + case "csv": + if err := awsAwsjson11_deserializeDocumentCSV(&sv.Csv, value); err != nil { + return err + } + + case "dateTimeConverter": + if err := awsAwsjson11_deserializeDocumentDateTimeConverter(&sv.DateTimeConverter, value); err != nil { + return err + } + + case "deleteKeys": + if err := awsAwsjson11_deserializeDocumentDeleteKeys(&sv.DeleteKeys, value); err != nil { + return err + } + + case "grok": + if err := awsAwsjson11_deserializeDocumentGrok(&sv.Grok, value); err != nil { + return err + } + + case "listToMap": + if err := awsAwsjson11_deserializeDocumentListToMap(&sv.ListToMap, value); err != nil { + return err + } + + case "lowerCaseString": + if err := awsAwsjson11_deserializeDocumentLowerCaseString(&sv.LowerCaseString, value); err != nil { + return err + } + + case "moveKeys": + if err := awsAwsjson11_deserializeDocumentMoveKeys(&sv.MoveKeys, value); err != nil { + return err + } + + case "parseCloudfront": + if err := awsAwsjson11_deserializeDocumentParseCloudfront(&sv.ParseCloudfront, value); err != nil { + return err + } + + case "parseJSON": + if err := awsAwsjson11_deserializeDocumentParseJSON(&sv.ParseJSON, value); err != nil { + return err + } + + case "parseKeyValue": + if err := awsAwsjson11_deserializeDocumentParseKeyValue(&sv.ParseKeyValue, value); err != nil { + return err + } + + case "parsePostgres": + if err := awsAwsjson11_deserializeDocumentParsePostgres(&sv.ParsePostgres, value); err != nil { + return err + } + + case "parseRoute53": + if err := awsAwsjson11_deserializeDocumentParseRoute53(&sv.ParseRoute53, value); err != nil { + return err + } + + case "parseVPC": + if err := awsAwsjson11_deserializeDocumentParseVPC(&sv.ParseVPC, value); err != nil { + return err + } + + case "parseWAF": + if err := awsAwsjson11_deserializeDocumentParseWAF(&sv.ParseWAF, value); err != nil { + return err + } + + case "renameKeys": + if err := awsAwsjson11_deserializeDocumentRenameKeys(&sv.RenameKeys, value); err != nil { + return err + } + + case "splitString": + if err := awsAwsjson11_deserializeDocumentSplitString(&sv.SplitString, value); err != nil { + return err + } + + case "substituteString": + if err := awsAwsjson11_deserializeDocumentSubstituteString(&sv.SubstituteString, value); err != nil { + return err + } + + case "trimString": + if err := awsAwsjson11_deserializeDocumentTrimString(&sv.TrimString, value); err != nil { + return err + } + + case "typeConverter": + if err := awsAwsjson11_deserializeDocumentTypeConverter(&sv.TypeConverter, value); err != nil { + return err + } + + case "upperCaseString": + if err := awsAwsjson11_deserializeDocumentUpperCaseString(&sv.UpperCaseString, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentProcessors(v *[]types.Processor, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13463,28 +15997,1288 @@ func awsAwsjson11_deserializeDocumentQueryDefinitionList(v *[]types.QueryDefinit return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.QueryDefinition + var cv []types.Processor if *v == nil { - cv = []types.QueryDefinition{} + cv = []types.Processor{} } else { cv = *v } for _, value := range shape { - var col types.QueryDefinition + var col types.Processor destAddr := &col - if err := awsAwsjson11_deserializeDocumentQueryDefinition(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentProcessor(&destAddr, value); err != nil { return err } col = *destAddr cv = append(cv, col) } - *v = cv + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentQueryCompileError(v **types.QueryCompileError, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.QueryCompileError + if *v == nil { + sv = &types.QueryCompileError{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "location": + if err := awsAwsjson11_deserializeDocumentQueryCompileErrorLocation(&sv.Location, value); err != nil { + return err + } + + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentQueryCompileErrorLocation(v **types.QueryCompileErrorLocation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.QueryCompileErrorLocation + if *v == nil { + sv = &types.QueryCompileErrorLocation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "endCharOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected QueryCharOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EndCharOffset = ptr.Int32(int32(i64)) + } + + case "startCharOffset": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected QueryCharOffset to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StartCharOffset = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentQueryDefinition(v **types.QueryDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.QueryDefinition + if *v == nil { + sv = &types.QueryDefinition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lastModified": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastModified = ptr.Int64(i64) + } + + case "logGroupNames": + if err := awsAwsjson11_deserializeDocumentLogGroupNames(&sv.LogGroupNames, value); err != nil { + return err + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryDefinitionName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "queryDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryId to be of type string, got %T instead", value) + } + sv.QueryDefinitionId = ptr.String(jtv) + } + + case "queryString": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryDefinitionString to be of type string, got %T instead", value) + } + sv.QueryString = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentQueryDefinitionList(v *[]types.QueryDefinition, 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.QueryDefinition + if *v == nil { + cv = []types.QueryDefinition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QueryDefinition + destAddr := &col + if err := awsAwsjson11_deserializeDocumentQueryDefinition(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentQueryInfo(v **types.QueryInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.QueryInfo + if *v == nil { + sv = &types.QueryInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "createTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CreateTime = ptr.Int64(i64) + } + + case "logGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value) + } + sv.LogGroupName = ptr.String(jtv) + } + + case "queryId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryId to be of type string, got %T instead", value) + } + sv.QueryId = ptr.String(jtv) + } + + case "queryString": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryString to be of type string, got %T instead", value) + } + sv.QueryString = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QueryStatus to be of type string, got %T instead", value) + } + sv.Status = types.QueryStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentQueryInfoList(v *[]types.QueryInfo, 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.QueryInfo + if *v == nil { + cv = []types.QueryInfo{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.QueryInfo + destAddr := &col + if err := awsAwsjson11_deserializeDocumentQueryInfo(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentQueryResults(v *[][]types.ResultField, 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.ResultField + if *v == nil { + cv = [][]types.ResultField{} + } else { + cv = *v + } + + for _, value := range shape { + var col []types.ResultField + if err := awsAwsjson11_deserializeDocumentResultRows(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentQueryStatistics(v **types.QueryStatistics, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.QueryStatistics + if *v == nil { + sv = &types.QueryStatistics{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "bytesScanned": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.BytesScanned = 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.BytesScanned = f64 + + default: + return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) + + } + } + + case "estimatedBytesSkipped": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedBytesSkipped = 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.EstimatedBytesSkipped = f64 + + default: + return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) + + } + } + + case "estimatedRecordsSkipped": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EstimatedRecordsSkipped = 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.EstimatedRecordsSkipped = f64 + + default: + return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) + + } + } + + case "logGroupsScanned": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LogGroupsScanned = 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.LogGroupsScanned = f64 + + default: + return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) + + } + } + + case "recordsMatched": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RecordsMatched = 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.RecordsMatched = f64 + + default: + return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) + + } + } + + case "recordsScanned": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.RecordsScanned = 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.RecordsScanned = f64 + + default: + return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRecordField(v **types.RecordField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RecordField + if *v == nil { + sv = &types.RecordField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "mandatory": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.Mandatory = ptr.Bool(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FieldHeader to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRecordFields(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 FieldHeader to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentRejectedEntityInfo(v **types.RejectedEntityInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RejectedEntityInfo + if *v == nil { + sv = &types.RejectedEntityInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EntityRejectionErrorType to be of type string, got %T instead", value) + } + sv.ErrorType = types.EntityRejectionErrorType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRejectedLogEventsInfo(v **types.RejectedLogEventsInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RejectedLogEventsInfo + if *v == nil { + sv = &types.RejectedLogEventsInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "expiredLogEventEndIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LogEventIndex to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiredLogEventEndIndex = ptr.Int32(int32(i64)) + } + + case "tooNewLogEventStartIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LogEventIndex to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TooNewLogEventStartIndex = ptr.Int32(int32(i64)) + } + + case "tooOldLogEventEndIndex": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LogEventIndex to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TooOldLogEventEndIndex = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRenameKeyEntries(v *[]types.RenameKeyEntry, 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.RenameKeyEntry + if *v == nil { + cv = []types.RenameKeyEntry{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RenameKeyEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentRenameKeyEntry(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentRenameKeyEntry(v **types.RenameKeyEntry, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RenameKeyEntry + if *v == nil { + sv = &types.RenameKeyEntry{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Key to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "overwriteIfExists": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected OverwriteIfExists to be of type *bool, got %T instead", value) + } + sv.OverwriteIfExists = jtv + } + + case "renameTo": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RenameTo to be of type string, got %T instead", value) + } + sv.RenameTo = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentRenameKeys(v **types.RenameKeys, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RenameKeys + if *v == nil { + sv = &types.RenameKeys{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "entries": + if err := awsAwsjson11_deserializeDocumentRenameKeyEntries(&sv.Entries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResourceAlreadyExistsException + if *v == nil { + sv = &types.ResourceAlreadyExistsException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceArns(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 Arn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResourcePolicies(v *[]types.ResourcePolicy, 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.ResourcePolicy + if *v == nil { + cv = []types.ResourcePolicy{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResourcePolicy + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResourcePolicy(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentResourcePolicy(v **types.ResourcePolicy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResourcePolicy + if *v == nil { + sv = &types.ResourcePolicy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "lastUpdatedTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastUpdatedTime = ptr.Int64(i64) + } + + case "policyDocument": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) + } + sv.PolicyDocument = ptr.String(jtv) + } + + case "policyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + } + sv.PolicyName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResultField(v **types.ResultField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResultField + if *v == nil { + sv = &types.ResultField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "field": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Field to be of type string, got %T instead", value) + } + sv.Field = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Value to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentResultRows(v *[]types.ResultField, 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.ResultField + if *v == nil { + cv = []types.ResultField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResultField + destAddr := &col + if err := awsAwsjson11_deserializeDocumentResultField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentS3DeliveryConfiguration(v **types.S3DeliveryConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.S3DeliveryConfiguration + if *v == nil { + sv = &types.S3DeliveryConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enableHiveCompatiblePath": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + } + sv.EnableHiveCompatiblePath = ptr.Bool(jtv) + } + + case "suffixPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DeliverySuffixPath to be of type string, got %T instead", value) + } + sv.SuffixPath = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv return nil } -func awsAwsjson11_deserializeDocumentQueryInfo(v **types.QueryInfo, value interface{}) error { +func awsAwsjson11_deserializeDocumentSearchedLogStream(v **types.SearchedLogStream, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13497,62 +17291,31 @@ func awsAwsjson11_deserializeDocumentQueryInfo(v **types.QueryInfo, value interf return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QueryInfo + var sv *types.SearchedLogStream if *v == nil { - sv = &types.QueryInfo{} + sv = &types.SearchedLogStream{} } else { sv = *v } for key, value := range shape { switch key { - case "createTime": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.CreateTime = ptr.Int64(i64) - } - - case "logGroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value) - } - sv.LogGroupName = ptr.String(jtv) - } - - case "queryId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected QueryId to be of type string, got %T instead", value) - } - sv.QueryId = ptr.String(jtv) - } - - case "queryString": + case "logStreamName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected QueryString to be of type string, got %T instead", value) + return fmt.Errorf("expected LogStreamName to be of type string, got %T instead", value) } - sv.QueryString = ptr.String(jtv) + sv.LogStreamName = ptr.String(jtv) } - case "status": + case "searchedCompletely": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected QueryStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected LogStreamSearchedCompletely to be of type *bool, got %T instead", value) } - sv.Status = types.QueryStatus(jtv) + sv.SearchedCompletely = ptr.Bool(jtv) } default: @@ -13564,7 +17327,7 @@ func awsAwsjson11_deserializeDocumentQueryInfo(v **types.QueryInfo, value interf return nil } -func awsAwsjson11_deserializeDocumentQueryInfoList(v *[]types.QueryInfo, value interface{}) error { +func awsAwsjson11_deserializeDocumentSearchedLogStreams(v *[]types.SearchedLogStream, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13577,17 +17340,17 @@ func awsAwsjson11_deserializeDocumentQueryInfoList(v *[]types.QueryInfo, value i return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.QueryInfo + var cv []types.SearchedLogStream if *v == nil { - cv = []types.QueryInfo{} + cv = []types.SearchedLogStream{} } else { cv = *v } for _, value := range shape { - var col types.QueryInfo + var col types.SearchedLogStream destAddr := &col - if err := awsAwsjson11_deserializeDocumentQueryInfo(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentSearchedLogStream(&destAddr, value); err != nil { return err } col = *destAddr @@ -13598,7 +17361,7 @@ func awsAwsjson11_deserializeDocumentQueryInfoList(v *[]types.QueryInfo, value i return nil } -func awsAwsjson11_deserializeDocumentQueryResults(v *[][]types.ResultField, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13606,31 +17369,39 @@ func awsAwsjson11_deserializeDocumentQueryResults(v *[][]types.ResultField, valu return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv [][]types.ResultField + var sv *types.ServiceQuotaExceededException if *v == nil { - cv = [][]types.ResultField{} + sv = &types.ServiceQuotaExceededException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col []types.ResultField - if err := awsAwsjson11_deserializeDocumentResultRows(&col, value); err != nil { - return err - } - cv = append(cv, col) + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentQueryStatistics(v **types.QueryStatistics, value interface{}) error { +func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13643,115 +17414,22 @@ func awsAwsjson11_deserializeDocumentQueryStatistics(v **types.QueryStatistics, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.QueryStatistics + var sv *types.ServiceUnavailableException if *v == nil { - sv = &types.QueryStatistics{} + sv = &types.ServiceUnavailableException{} } else { sv = *v } for key, value := range shape { switch key { - case "bytesScanned": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.BytesScanned = 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.BytesScanned = f64 - - default: - return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) - - } - } - - case "recordsMatched": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.RecordsMatched = 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.RecordsMatched = f64 - - default: - return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) - - } - } - - case "recordsScanned": + case "message", "Message": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.RecordsScanned = 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.RecordsScanned = f64 - - default: - return fmt.Errorf("expected StatsValue to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) } + sv.Message = ptr.String(jtv) } default: @@ -13763,7 +17441,7 @@ func awsAwsjson11_deserializeDocumentQueryStatistics(v **types.QueryStatistics, return nil } -func awsAwsjson11_deserializeDocumentRecordField(v **types.RecordField, value interface{}) error { +func awsAwsjson11_deserializeDocumentSplitString(v **types.SplitString, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13776,31 +17454,18 @@ func awsAwsjson11_deserializeDocumentRecordField(v **types.RecordField, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RecordField + var sv *types.SplitString if *v == nil { - sv = &types.RecordField{} + sv = &types.SplitString{} } else { sv = *v } for key, value := range shape { switch key { - case "mandatory": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) - } - sv.Mandatory = ptr.Bool(jtv) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldHeader to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + case "entries": + if err := awsAwsjson11_deserializeDocumentSplitStringEntries(&sv.Entries, value); err != nil { + return err } default: @@ -13812,7 +17477,7 @@ func awsAwsjson11_deserializeDocumentRecordField(v **types.RecordField, value in return nil } -func awsAwsjson11_deserializeDocumentRecordFields(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentSplitStringEntries(v *[]types.SplitStringEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13825,22 +17490,20 @@ func awsAwsjson11_deserializeDocumentRecordFields(v *[]string, value interface{} return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.SplitStringEntry if *v == nil { - cv = []string{} + cv = []types.SplitStringEntry{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FieldHeader to be of type string, got %T instead", value) - } - col = jtv + var col types.SplitStringEntry + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSplitStringEntry(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -13848,7 +17511,7 @@ func awsAwsjson11_deserializeDocumentRecordFields(v *[]string, value interface{} return nil } -func awsAwsjson11_deserializeDocumentRejectedEntityInfo(v **types.RejectedEntityInfo, value interface{}) error { +func awsAwsjson11_deserializeDocumentSplitStringEntry(v **types.SplitStringEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13861,22 +17524,31 @@ func awsAwsjson11_deserializeDocumentRejectedEntityInfo(v **types.RejectedEntity return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RejectedEntityInfo + var sv *types.SplitStringEntry if *v == nil { - sv = &types.RejectedEntityInfo{} + sv = &types.SplitStringEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "errorType": + case "delimiter": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected EntityRejectionErrorType to be of type string, got %T instead", value) + return fmt.Errorf("expected Delimiter to be of type string, got %T instead", value) } - sv.ErrorType = types.EntityRejectionErrorType(jtv) + sv.Delimiter = ptr.String(jtv) + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) } default: @@ -13888,7 +17560,7 @@ func awsAwsjson11_deserializeDocumentRejectedEntityInfo(v **types.RejectedEntity return nil } -func awsAwsjson11_deserializeDocumentRejectedLogEventsInfo(v **types.RejectedLogEventsInfo, value interface{}) error { +func awsAwsjson11_deserializeDocumentSubscriptionFilter(v **types.SubscriptionFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -13901,92 +17573,89 @@ func awsAwsjson11_deserializeDocumentRejectedLogEventsInfo(v **types.RejectedLog return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.RejectedLogEventsInfo + var sv *types.SubscriptionFilter if *v == nil { - sv = &types.RejectedLogEventsInfo{} + sv = &types.SubscriptionFilter{} } else { sv = *v } for key, value := range shape { switch key { - case "expiredLogEventEndIndex": + case "applyOnTransformedLogs": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected LogEventIndex to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected ApplyOnTransformedLogs to be of type *bool, got %T instead", value) } - sv.ExpiredLogEventEndIndex = ptr.Int32(int32(i64)) + sv.ApplyOnTransformedLogs = jtv } - case "tooNewLogEventStartIndex": + case "creationTime": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected LogEventIndex to be json.Number, got %T instead", value) + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.TooNewLogEventStartIndex = ptr.Int32(int32(i64)) + sv.CreationTime = ptr.Int64(i64) } - case "tooOldLogEventEndIndex": + case "destinationArn": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LogEventIndex to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) } - sv.TooOldLogEventEndIndex = ptr.Int32(int32(i64)) + sv.DestinationArn = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} + case "distribution": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Distribution to be of type string, got %T instead", value) + } + sv.Distribution = types.Distribution(jtv) + } -func awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(v **types.ResourceAlreadyExistsException, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case "filterName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FilterName to be of type string, got %T instead", value) + } + sv.FilterName = ptr.String(jtv) + } - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "filterPattern": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected FilterPattern to be of type string, got %T instead", value) + } + sv.FilterPattern = ptr.String(jtv) + } - var sv *types.ResourceAlreadyExistsException - if *v == nil { - sv = &types.ResourceAlreadyExistsException{} - } else { - sv = *v - } + case "logGroupName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value) + } + sv.LogGroupName = ptr.String(jtv) + } - for key, value := range shape { - switch key { - case "message", "Message": + case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.RoleArn = ptr.String(jtv) } default: @@ -13998,7 +17667,7 @@ func awsAwsjson11_deserializeDocumentResourceAlreadyExistsException(v **types.Re return nil } -func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentSubscriptionFilters(v *[]types.SubscriptionFilter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14011,22 +17680,20 @@ func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{} return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.SubscriptionFilter if *v == nil { - cv = []string{} + cv = []types.SubscriptionFilter{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Arn to be of type string, got %T instead", value) - } - col = jtv + var col types.SubscriptionFilter + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSubscriptionFilter(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -14034,7 +17701,7 @@ func awsAwsjson11_deserializeDocumentResourceArns(v *[]string, value interface{} return nil } -func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { +func awsAwsjson11_deserializeDocumentSubstituteString(v **types.SubstituteString, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14047,22 +17714,18 @@ func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.Resourc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourceNotFoundException + var sv *types.SubstituteString if *v == nil { - sv = &types.ResourceNotFoundException{} + sv = &types.SubstituteString{} } else { sv = *v } for key, value := range shape { switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "entries": + if err := awsAwsjson11_deserializeDocumentSubstituteStringEntries(&sv.Entries, value); err != nil { + return err } default: @@ -14074,7 +17737,7 @@ func awsAwsjson11_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } -func awsAwsjson11_deserializeDocumentResourcePolicies(v *[]types.ResourcePolicy, value interface{}) error { +func awsAwsjson11_deserializeDocumentSubstituteStringEntries(v *[]types.SubstituteStringEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14087,17 +17750,17 @@ func awsAwsjson11_deserializeDocumentResourcePolicies(v *[]types.ResourcePolicy, return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ResourcePolicy + var cv []types.SubstituteStringEntry if *v == nil { - cv = []types.ResourcePolicy{} + cv = []types.SubstituteStringEntry{} } else { cv = *v } for _, value := range shape { - var col types.ResourcePolicy + var col types.SubstituteStringEntry destAddr := &col - if err := awsAwsjson11_deserializeDocumentResourcePolicy(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentSubstituteStringEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -14108,7 +17771,7 @@ func awsAwsjson11_deserializeDocumentResourcePolicies(v *[]types.ResourcePolicy, return nil } -func awsAwsjson11_deserializeDocumentResourcePolicy(v **types.ResourcePolicy, value interface{}) error { +func awsAwsjson11_deserializeDocumentSubstituteStringEntry(v **types.SubstituteStringEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14121,44 +17784,40 @@ func awsAwsjson11_deserializeDocumentResourcePolicy(v **types.ResourcePolicy, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResourcePolicy + var sv *types.SubstituteStringEntry if *v == nil { - sv = &types.ResourcePolicy{} + sv = &types.SubstituteStringEntry{} } else { sv = *v } for key, value := range shape { switch key { - case "lastUpdatedTime": + case "from": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected FromKey to be of type string, got %T instead", value) } - sv.LastUpdatedTime = ptr.Int64(i64) + sv.From = ptr.String(jtv) } - case "policyDocument": + case "source": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) + return fmt.Errorf("expected Source to be of type string, got %T instead", value) } - sv.PolicyDocument = ptr.String(jtv) + sv.Source = ptr.String(jtv) } - case "policyName": + case "to": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + return fmt.Errorf("expected ToKey to be of type string, got %T instead", value) } - sv.PolicyName = ptr.String(jtv) + sv.To = ptr.String(jtv) } default: @@ -14170,7 +17829,7 @@ func awsAwsjson11_deserializeDocumentResourcePolicy(v **types.ResourcePolicy, va return nil } -func awsAwsjson11_deserializeDocumentResultField(v **types.ResultField, value interface{}) error { +func awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14183,43 +17842,30 @@ func awsAwsjson11_deserializeDocumentResultField(v **types.ResultField, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResultField + var mv map[string]string if *v == nil { - sv = &types.ResultField{} + mv = map[string]string{} } else { - sv = *v + mv = *v } for key, value := range shape { - switch key { - case "field": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Field to be of type string, got %T instead", value) - } - sv.Field = ptr.String(jtv) - } - - case "value": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Value to be of type string, got %T instead", value) - } - sv.Value = ptr.String(jtv) + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + parsedVal = jtv } + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsAwsjson11_deserializeDocumentResultRows(v *[]types.ResultField, value interface{}) error { +func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14227,33 +17873,39 @@ func awsAwsjson11_deserializeDocumentResultRows(v *[]types.ResultField, value in return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ResultField + var sv *types.ThrottlingException if *v == nil { - cv = []types.ResultField{} + sv = &types.ThrottlingException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.ResultField - destAddr := &col - if err := awsAwsjson11_deserializeDocumentResultField(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Message to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentS3DeliveryConfiguration(v **types.S3DeliveryConfiguration, value interface{}) error { +func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14266,31 +17918,31 @@ func awsAwsjson11_deserializeDocumentS3DeliveryConfiguration(v **types.S3Deliver return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.S3DeliveryConfiguration + var sv *types.TooManyTagsException if *v == nil { - sv = &types.S3DeliveryConfiguration{} + sv = &types.TooManyTagsException{} } else { sv = *v } for key, value := range shape { switch key { - case "enableHiveCompatiblePath": + case "message", "Message": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Boolean to be of type *bool, got %T instead", value) + return fmt.Errorf("expected Message to be of type string, got %T instead", value) } - sv.EnableHiveCompatiblePath = ptr.Bool(jtv) + sv.Message = ptr.String(jtv) } - case "suffixPath": + case "resourceName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DeliverySuffixPath to be of type string, got %T instead", value) + return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) } - sv.SuffixPath = ptr.String(jtv) + sv.ResourceName = ptr.String(jtv) } default: @@ -14302,7 +17954,7 @@ func awsAwsjson11_deserializeDocumentS3DeliveryConfiguration(v **types.S3Deliver return nil } -func awsAwsjson11_deserializeDocumentSearchedLogStream(v **types.SearchedLogStream, value interface{}) error { +func awsAwsjson11_deserializeDocumentTransformedLogRecord(v **types.TransformedLogRecord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14315,31 +17967,44 @@ func awsAwsjson11_deserializeDocumentSearchedLogStream(v **types.SearchedLogStre return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SearchedLogStream + var sv *types.TransformedLogRecord if *v == nil { - sv = &types.SearchedLogStream{} + sv = &types.TransformedLogRecord{} } else { sv = *v } for key, value := range shape { switch key { - case "logStreamName": + case "eventMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventMessage to be of type string, got %T instead", value) + } + sv.EventMessage = ptr.String(jtv) + } + + case "eventNumber": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected LogStreamName to be of type string, got %T instead", value) + return fmt.Errorf("expected EventNumber to be json.Number, got %T instead", value) } - sv.LogStreamName = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.EventNumber = i64 } - case "searchedCompletely": + case "transformedEventMessage": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LogStreamSearchedCompletely to be of type *bool, got %T instead", value) + return fmt.Errorf("expected TransformedEventMessage to be of type string, got %T instead", value) } - sv.SearchedCompletely = ptr.Bool(jtv) + sv.TransformedEventMessage = ptr.String(jtv) } default: @@ -14351,7 +18016,7 @@ func awsAwsjson11_deserializeDocumentSearchedLogStream(v **types.SearchedLogStre return nil } -func awsAwsjson11_deserializeDocumentSearchedLogStreams(v *[]types.SearchedLogStream, value interface{}) error { +func awsAwsjson11_deserializeDocumentTransformedLogs(v *[]types.TransformedLogRecord, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14364,17 +18029,17 @@ func awsAwsjson11_deserializeDocumentSearchedLogStreams(v *[]types.SearchedLogSt return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.SearchedLogStream + var cv []types.TransformedLogRecord if *v == nil { - cv = []types.SearchedLogStream{} + cv = []types.TransformedLogRecord{} } else { cv = *v } for _, value := range shape { - var col types.SearchedLogStream + var col types.TransformedLogRecord destAddr := &col - if err := awsAwsjson11_deserializeDocumentSearchedLogStream(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentTransformedLogRecord(&destAddr, value); err != nil { return err } col = *destAddr @@ -14385,7 +18050,7 @@ func awsAwsjson11_deserializeDocumentSearchedLogStreams(v *[]types.SearchedLogSt return nil } -func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.ServiceQuotaExceededException, value interface{}) error { +func awsAwsjson11_deserializeDocumentTrimString(v **types.TrimString, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14398,22 +18063,18 @@ func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.Ser return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceQuotaExceededException + var sv *types.TrimString if *v == nil { - sv = &types.ServiceQuotaExceededException{} + sv = &types.TrimString{} } else { sv = *v } for key, value := range shape { switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + case "withKeys": + if err := awsAwsjson11_deserializeDocumentTrimStringWithKeys(&sv.WithKeys, value); err != nil { + return err } default: @@ -14425,7 +18086,7 @@ func awsAwsjson11_deserializeDocumentServiceQuotaExceededException(v **types.Ser return nil } -func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { +func awsAwsjson11_deserializeDocumentTrimStringWithKeys(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14433,39 +18094,35 @@ func awsAwsjson11_deserializeDocumentServiceUnavailableException(v **types.Servi return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ServiceUnavailableException + var cv []string if *v == nil { - sv = &types.ServiceUnavailableException{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WithKey to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsAwsjson11_deserializeDocumentSubscriptionFilter(v **types.SubscriptionFilter, value interface{}) error { +func awsAwsjson11_deserializeDocumentTypeConverter(v **types.TypeConverter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14478,80 +18135,18 @@ func awsAwsjson11_deserializeDocumentSubscriptionFilter(v **types.SubscriptionFi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SubscriptionFilter + var sv *types.TypeConverter if *v == nil { - sv = &types.SubscriptionFilter{} + sv = &types.TypeConverter{} } else { sv = *v } for key, value := range shape { switch key { - case "creationTime": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.CreationTime = ptr.Int64(i64) - } - - case "destinationArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected DestinationArn to be of type string, got %T instead", value) - } - sv.DestinationArn = ptr.String(jtv) - } - - case "distribution": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Distribution to be of type string, got %T instead", value) - } - sv.Distribution = types.Distribution(jtv) - } - - case "filterName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FilterName to be of type string, got %T instead", value) - } - sv.FilterName = ptr.String(jtv) - } - - case "filterPattern": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected FilterPattern to be of type string, got %T instead", value) - } - sv.FilterPattern = ptr.String(jtv) - } - - case "logGroupName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value) - } - sv.LogGroupName = ptr.String(jtv) - } - - case "roleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) - } - sv.RoleArn = ptr.String(jtv) + case "entries": + if err := awsAwsjson11_deserializeDocumentTypeConverterEntries(&sv.Entries, value); err != nil { + return err } default: @@ -14563,7 +18158,7 @@ func awsAwsjson11_deserializeDocumentSubscriptionFilter(v **types.SubscriptionFi return nil } -func awsAwsjson11_deserializeDocumentSubscriptionFilters(v *[]types.SubscriptionFilter, value interface{}) error { +func awsAwsjson11_deserializeDocumentTypeConverterEntries(v *[]types.TypeConverterEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14576,17 +18171,17 @@ func awsAwsjson11_deserializeDocumentSubscriptionFilters(v *[]types.Subscription return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.SubscriptionFilter + var cv []types.TypeConverterEntry if *v == nil { - cv = []types.SubscriptionFilter{} + cv = []types.TypeConverterEntry{} } else { cv = *v } for _, value := range shape { - var col types.SubscriptionFilter + var col types.TypeConverterEntry destAddr := &col - if err := awsAwsjson11_deserializeDocumentSubscriptionFilter(&destAddr, value); err != nil { + if err := awsAwsjson11_deserializeDocumentTypeConverterEntry(&destAddr, value); err != nil { return err } col = *destAddr @@ -14597,7 +18192,7 @@ func awsAwsjson11_deserializeDocumentSubscriptionFilters(v *[]types.Subscription return nil } -func awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{}) error { +func awsAwsjson11_deserializeDocumentTypeConverterEntry(v **types.TypeConverterEntry, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14610,30 +18205,43 @@ func awsAwsjson11_deserializeDocumentTags(v *map[string]string, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var sv *types.TypeConverterEntry if *v == nil { - mv = map[string]string{} + sv = &types.TypeConverterEntry{} } else { - mv = *v + sv = *v } for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + switch key { + case "key": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Key to be of type string, got %T instead", value) + } + sv.Key = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Type to be of type string, got %T instead", value) + } + sv.Type = types.Type(jtv) } - parsedVal = jtv - } - mv[key] = parsedVal + default: + _, _ = key, value + + } } - *v = mv + *v = sv return nil } -func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { +func awsAwsjson11_deserializeDocumentUnrecognizedClientException(v **types.UnrecognizedClientException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14646,9 +18254,9 @@ func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingExc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ThrottlingException + var sv *types.UnrecognizedClientException if *v == nil { - sv = &types.ThrottlingException{} + sv = &types.UnrecognizedClientException{} } else { sv = *v } @@ -14673,7 +18281,7 @@ func awsAwsjson11_deserializeDocumentThrottlingException(v **types.ThrottlingExc return nil } -func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsException, value interface{}) error { +func awsAwsjson11_deserializeDocumentUpperCaseString(v **types.UpperCaseString, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14686,31 +18294,18 @@ func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsE return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.TooManyTagsException + var sv *types.UpperCaseString if *v == nil { - sv = &types.TooManyTagsException{} + sv = &types.UpperCaseString{} } else { sv = *v } for key, value := range shape { switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - case "resourceName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AmazonResourceName to be of type string, got %T instead", value) - } - sv.ResourceName = ptr.String(jtv) + case "withKeys": + if err := awsAwsjson11_deserializeDocumentUpperCaseStringWithKeys(&sv.WithKeys, value); err != nil { + return err } default: @@ -14722,7 +18317,7 @@ func awsAwsjson11_deserializeDocumentTooManyTagsException(v **types.TooManyTagsE return nil } -func awsAwsjson11_deserializeDocumentUnrecognizedClientException(v **types.UnrecognizedClientException, value interface{}) error { +func awsAwsjson11_deserializeDocumentUpperCaseStringWithKeys(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -14730,35 +18325,31 @@ func awsAwsjson11_deserializeDocumentUnrecognizedClientException(v **types.Unrec return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.UnrecognizedClientException + var cv []string if *v == nil { - sv = &types.UnrecognizedClientException{} + cv = []string{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Message to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) + for _, value := range shape { + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected WithKey to be of type string, got %T instead", value) } - - default: - _, _ = key, value - + col = jtv } + cv = append(cv, col) + } - *v = sv + *v = cv return nil } @@ -14918,6 +18509,37 @@ func awsAwsjson11_deserializeOpDocumentCreateLogAnomalyDetectorOutput(v **Create return nil } +func awsAwsjson11_deserializeOpDocumentDeleteIndexPolicyOutput(v **DeleteIndexPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteIndexPolicyOutput + if *v == nil { + sv = &DeleteIndexPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDeleteQueryDefinitionOutput(v **DeleteQueryDefinitionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14985,6 +18607,15 @@ func awsAwsjson11_deserializeOpDocumentDescribeAccountPoliciesOutput(v **Describ return err } + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -15264,6 +18895,96 @@ func awsAwsjson11_deserializeOpDocumentDescribeExportTasksOutput(v **DescribeExp return nil } +func awsAwsjson11_deserializeOpDocumentDescribeFieldIndexesOutput(v **DescribeFieldIndexesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeFieldIndexesOutput + if *v == nil { + sv = &DescribeFieldIndexesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldIndexes": + if err := awsAwsjson11_deserializeDocumentFieldIndexes(&sv.FieldIndexes, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentDescribeIndexPoliciesOutput(v **DescribeIndexPoliciesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeIndexPoliciesOutput + if *v == nil { + sv = &DescribeIndexPoliciesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "indexPolicies": + if err := awsAwsjson11_deserializeDocumentIndexPolicies(&sv.IndexPolicies, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentDescribeLogGroupsOutput(v **DescribeLogGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16140,6 +19861,77 @@ func awsAwsjson11_deserializeOpDocumentGetQueryResultsOutput(v **GetQueryResults return nil } +func awsAwsjson11_deserializeOpDocumentGetTransformerOutput(v **GetTransformerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetTransformerOutput + if *v == nil { + sv = &GetTransformerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "creationTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CreationTime = ptr.Int64(i64) + } + + case "lastModifiedTime": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Timestamp to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.LastModifiedTime = ptr.Int64(i64) + } + + case "logGroupIdentifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LogGroupIdentifier to be of type string, got %T instead", value) + } + sv.LogGroupIdentifier = ptr.String(jtv) + } + + case "transformerConfig": + if err := awsAwsjson11_deserializeDocumentProcessors(&sv.TransformerConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListAnomaliesOutput(v **ListAnomaliesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16230,6 +20022,51 @@ func awsAwsjson11_deserializeOpDocumentListLogAnomalyDetectorsOutput(v **ListLog return nil } +func awsAwsjson11_deserializeOpDocumentListLogGroupsForQueryOutput(v **ListLogGroupsForQueryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListLogGroupsForQueryOutput + if *v == nil { + sv = &ListLogGroupsForQueryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "logGroupIdentifiers": + if err := awsAwsjson11_deserializeDocumentLogGroupIdentifiers(&sv.LogGroupIdentifiers, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16544,6 +20381,42 @@ func awsAwsjson11_deserializeOpDocumentPutDestinationOutput(v **PutDestinationOu return nil } +func awsAwsjson11_deserializeOpDocumentPutIndexPolicyOutput(v **PutIndexPolicyOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutIndexPolicyOutput + if *v == nil { + sv = &PutIndexPolicyOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "indexPolicy": + if err := awsAwsjson11_deserializeDocumentIndexPolicy(&sv.IndexPolicy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentPutLogEventsOutput(v **PutLogEventsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -16786,6 +20659,42 @@ func awsAwsjson11_deserializeOpDocumentTestMetricFilterOutput(v **TestMetricFilt return nil } +func awsAwsjson11_deserializeOpDocumentTestTransformerOutput(v **TestTransformerOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *TestTransformerOutput + if *v == nil { + sv = &TestTransformerOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "transformedLogs": + if err := awsAwsjson11_deserializeDocumentTransformedLogs(&sv.TransformedLogs, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentUpdateDeliveryConfigurationOutput(v **UpdateDeliveryConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/cloudwatchlogs/generated.json b/service/cloudwatchlogs/generated.json index 83d30cbf630..7d2bc3c94a6 100644 --- a/service/cloudwatchlogs/generated.json +++ b/service/cloudwatchlogs/generated.json @@ -23,6 +23,7 @@ "api_op_DeleteDeliveryDestinationPolicy.go", "api_op_DeleteDeliverySource.go", "api_op_DeleteDestination.go", + "api_op_DeleteIndexPolicy.go", "api_op_DeleteLogAnomalyDetector.go", "api_op_DeleteLogGroup.go", "api_op_DeleteLogStream.go", @@ -31,6 +32,7 @@ "api_op_DeleteResourcePolicy.go", "api_op_DeleteRetentionPolicy.go", "api_op_DeleteSubscriptionFilter.go", + "api_op_DeleteTransformer.go", "api_op_DescribeAccountPolicies.go", "api_op_DescribeConfigurationTemplates.go", "api_op_DescribeDeliveries.go", @@ -38,6 +40,8 @@ "api_op_DescribeDeliverySources.go", "api_op_DescribeDestinations.go", "api_op_DescribeExportTasks.go", + "api_op_DescribeFieldIndexes.go", + "api_op_DescribeIndexPolicies.go", "api_op_DescribeLogGroups.go", "api_op_DescribeLogStreams.go", "api_op_DescribeMetricFilters.go", @@ -57,8 +61,10 @@ "api_op_GetLogGroupFields.go", "api_op_GetLogRecord.go", "api_op_GetQueryResults.go", + "api_op_GetTransformer.go", "api_op_ListAnomalies.go", "api_op_ListLogAnomalyDetectors.go", + "api_op_ListLogGroupsForQuery.go", "api_op_ListTagsForResource.go", "api_op_ListTagsLogGroup.go", "api_op_PutAccountPolicy.go", @@ -68,18 +74,21 @@ "api_op_PutDeliverySource.go", "api_op_PutDestination.go", "api_op_PutDestinationPolicy.go", + "api_op_PutIndexPolicy.go", "api_op_PutLogEvents.go", "api_op_PutMetricFilter.go", "api_op_PutQueryDefinition.go", "api_op_PutResourcePolicy.go", "api_op_PutRetentionPolicy.go", "api_op_PutSubscriptionFilter.go", + "api_op_PutTransformer.go", "api_op_StartLiveTail.go", "api_op_StartQuery.go", "api_op_StopQuery.go", "api_op_TagLogGroup.go", "api_op_TagResource.go", "api_op_TestMetricFilter.go", + "api_op_TestTransformer.go", "api_op_UntagLogGroup.go", "api_op_UntagResource.go", "api_op_UpdateAnomaly.go", diff --git a/service/cloudwatchlogs/serializers.go b/service/cloudwatchlogs/serializers.go index 1e56ba05f5e..4e04c599423 100644 --- a/service/cloudwatchlogs/serializers.go +++ b/service/cloudwatchlogs/serializers.go @@ -871,6 +871,67 @@ func (m *awsAwsjson11_serializeOpDeleteDestination) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteIndexPolicy struct { +} + +func (*awsAwsjson11_serializeOpDeleteIndexPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteIndexPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteIndexPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteIndexPolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteIndexPolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDeleteLogAnomalyDetector struct { } @@ -1359,6 +1420,67 @@ func (m *awsAwsjson11_serializeOpDeleteSubscriptionFilter) HandleSerialize(ctx c return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDeleteTransformer struct { +} + +func (*awsAwsjson11_serializeOpDeleteTransformer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDeleteTransformer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteTransformerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DeleteTransformer") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDeleteTransformerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDescribeAccountPolicies struct { } @@ -1786,6 +1908,128 @@ func (m *awsAwsjson11_serializeOpDescribeExportTasks) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpDescribeFieldIndexes struct { +} + +func (*awsAwsjson11_serializeOpDescribeFieldIndexes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeFieldIndexes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeFieldIndexesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeFieldIndexes") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeFieldIndexesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpDescribeIndexPolicies struct { +} + +func (*awsAwsjson11_serializeOpDescribeIndexPolicies) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpDescribeIndexPolicies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeIndexPoliciesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.DescribeIndexPolicies") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentDescribeIndexPoliciesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpDescribeLogGroups struct { } @@ -2945,14 +3189,14 @@ func (m *awsAwsjson11_serializeOpGetQueryResults) HandleSerialize(ctx context.Co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListAnomalies struct { +type awsAwsjson11_serializeOpGetTransformer struct { } -func (*awsAwsjson11_serializeOpListAnomalies) ID() string { +func (*awsAwsjson11_serializeOpGetTransformer) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListAnomalies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpGetTransformer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -2964,7 +3208,7 @@ func (m *awsAwsjson11_serializeOpListAnomalies) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListAnomaliesInput) + input, ok := in.Parameters.(*GetTransformerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -2985,10 +3229,10 @@ func (m *awsAwsjson11_serializeOpListAnomalies) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListAnomalies") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.GetTransformer") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListAnomaliesInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentGetTransformerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3006,14 +3250,14 @@ func (m *awsAwsjson11_serializeOpListAnomalies) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListLogAnomalyDetectors struct { +type awsAwsjson11_serializeOpListAnomalies struct { } -func (*awsAwsjson11_serializeOpListLogAnomalyDetectors) ID() string { +func (*awsAwsjson11_serializeOpListAnomalies) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListLogAnomalyDetectors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListAnomalies) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3025,7 +3269,7 @@ func (m *awsAwsjson11_serializeOpListLogAnomalyDetectors) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListLogAnomalyDetectorsInput) + input, ok := in.Parameters.(*ListAnomaliesInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3046,10 +3290,10 @@ func (m *awsAwsjson11_serializeOpListLogAnomalyDetectors) HandleSerialize(ctx co return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListLogAnomalyDetectors") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListAnomalies") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListLogAnomalyDetectorsInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListAnomaliesInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3067,14 +3311,14 @@ func (m *awsAwsjson11_serializeOpListLogAnomalyDetectors) HandleSerialize(ctx co return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListTagsForResource struct { +type awsAwsjson11_serializeOpListLogAnomalyDetectors struct { } -func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_serializeOpListLogAnomalyDetectors) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListLogAnomalyDetectors) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3086,7 +3330,7 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsForResourceInput) + input, ok := in.Parameters.(*ListLogAnomalyDetectorsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3107,10 +3351,10 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListTagsForResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListLogAnomalyDetectors") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListLogAnomalyDetectorsInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3128,14 +3372,14 @@ func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpListTagsLogGroup struct { +type awsAwsjson11_serializeOpListLogGroupsForQuery struct { } -func (*awsAwsjson11_serializeOpListTagsLogGroup) ID() string { +func (*awsAwsjson11_serializeOpListLogGroupsForQuery) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpListLogGroupsForQuery) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3147,7 +3391,7 @@ func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListTagsLogGroupInput) + input, ok := in.Parameters.(*ListLogGroupsForQueryInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3168,10 +3412,132 @@ func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListTagsLogGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListLogGroupsForQuery") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentListTagsLogGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentListLogGroupsForQueryInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListTagsForResource struct { +} + +func (*awsAwsjson11_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListTagsForResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListTagsForResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListTagsLogGroup struct { +} + +func (*awsAwsjson11_serializeOpListTagsLogGroup) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListTagsLogGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsLogGroupInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.ListTagsLogGroup") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListTagsLogGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3616,6 +3982,67 @@ func (m *awsAwsjson11_serializeOpPutDestinationPolicy) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpPutIndexPolicy struct { +} + +func (*awsAwsjson11_serializeOpPutIndexPolicy) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutIndexPolicy) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutIndexPolicyInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutIndexPolicy") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutIndexPolicyInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpPutLogEvents struct { } @@ -3982,6 +4409,67 @@ func (m *awsAwsjson11_serializeOpPutSubscriptionFilter) HandleSerialize(ctx cont return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpPutTransformer struct { +} + +func (*awsAwsjson11_serializeOpPutTransformer) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpPutTransformer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PutTransformerInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.PutTransformer") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentPutTransformerInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpStartLiveTail struct { } @@ -4348,14 +4836,14 @@ func (m *awsAwsjson11_serializeOpTestMetricFilter) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpUntagLogGroup struct { +type awsAwsjson11_serializeOpTestTransformer struct { } -func (*awsAwsjson11_serializeOpUntagLogGroup) ID() string { +func (*awsAwsjson11_serializeOpTestTransformer) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpUntagLogGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpTestTransformer) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -4367,7 +4855,7 @@ func (m *awsAwsjson11_serializeOpUntagLogGroup) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UntagLogGroupInput) + input, ok := in.Parameters.(*TestTransformerInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -4388,10 +4876,10 @@ func (m *awsAwsjson11_serializeOpUntagLogGroup) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.UntagLogGroup") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.TestTransformer") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUntagLogGroupInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentTestTransformerInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -4409,14 +4897,14 @@ func (m *awsAwsjson11_serializeOpUntagLogGroup) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpUntagResource struct { +type awsAwsjson11_serializeOpUntagLogGroup struct { } -func (*awsAwsjson11_serializeOpUntagResource) ID() string { +func (*awsAwsjson11_serializeOpUntagLogGroup) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpUntagLogGroup) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -4428,7 +4916,7 @@ func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UntagResourceInput) + input, ok := in.Parameters.(*UntagLogGroupInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -4449,10 +4937,10 @@ func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") - httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.UntagResource") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.UntagLogGroup") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson11_serializeOpDocumentUntagLogGroupInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -4470,14 +4958,75 @@ func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Cont return next.HandleSerialize(ctx, in) } -type awsAwsjson11_serializeOpUpdateAnomaly struct { +type awsAwsjson11_serializeOpUntagResource struct { } -func (*awsAwsjson11_serializeOpUpdateAnomaly) ID() string { +func (*awsAwsjson11_serializeOpUntagResource) ID() string { return "OperationSerializer" } -func (m *awsAwsjson11_serializeOpUpdateAnomaly) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson11_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := 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)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("Logs_20140328.UntagResource") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentUntagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpUpdateAnomaly struct { +} + +func (*awsAwsjson11_serializeOpUpdateAnomaly) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpUpdateAnomaly) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -4663,6 +5212,213 @@ func awsAwsjson11_serializeDocumentAccountIds(v []string, value smithyjson.Value return nil } +func awsAwsjson11_serializeDocumentAddKeyEntries(v []types.AddKeyEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentAddKeyEntry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentAddKeyEntry(v *types.AddKeyEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + if v.OverwriteIfExists { + ok := object.Key("overwriteIfExists") + ok.Boolean(v.OverwriteIfExists) + } + + if v.Value != nil { + ok := object.Key("value") + ok.String(*v.Value) + } + + return nil +} + +func awsAwsjson11_serializeDocumentAddKeys(v *types.AddKeys, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Entries != nil { + ok := object.Key("entries") + if err := awsAwsjson11_serializeDocumentAddKeyEntries(v.Entries, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentColumns(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentCopyValue(v *types.CopyValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Entries != nil { + ok := object.Key("entries") + if err := awsAwsjson11_serializeDocumentCopyValueEntries(v.Entries, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentCopyValueEntries(v []types.CopyValueEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentCopyValueEntry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentCopyValueEntry(v *types.CopyValueEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OverwriteIfExists { + ok := object.Key("overwriteIfExists") + ok.Boolean(v.OverwriteIfExists) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + if v.Target != nil { + ok := object.Key("target") + ok.String(*v.Target) + } + + return nil +} + +func awsAwsjson11_serializeDocumentCSV(v *types.CSV, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Columns != nil { + ok := object.Key("columns") + if err := awsAwsjson11_serializeDocumentColumns(v.Columns, ok); err != nil { + return err + } + } + + if v.Delimiter != nil { + ok := object.Key("delimiter") + ok.String(*v.Delimiter) + } + + if v.QuoteCharacter != nil { + ok := object.Key("quoteCharacter") + ok.String(*v.QuoteCharacter) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentDateTimeConverter(v *types.DateTimeConverter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Locale != nil { + ok := object.Key("locale") + ok.String(*v.Locale) + } + + if v.MatchPatterns != nil { + ok := object.Key("matchPatterns") + if err := awsAwsjson11_serializeDocumentMatchPatterns(v.MatchPatterns, ok); err != nil { + return err + } + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + if v.SourceTimezone != nil { + ok := object.Key("sourceTimezone") + ok.String(*v.SourceTimezone) + } + + if v.Target != nil { + ok := object.Key("target") + ok.String(*v.Target) + } + + if v.TargetFormat != nil { + ok := object.Key("targetFormat") + ok.String(*v.TargetFormat) + } + + if v.TargetTimezone != nil { + ok := object.Key("targetTimezone") + ok.String(*v.TargetTimezone) + } + + return nil +} + +func awsAwsjson11_serializeDocumentDeleteKeys(v *types.DeleteKeys, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.WithKeys != nil { + ok := object.Key("withKeys") + if err := awsAwsjson11_serializeDocumentDeleteWithKeys(v.WithKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentDeleteWithKeys(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentDeliveryDestinationConfiguration(v *types.DeliveryDestinationConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4686,6 +5442,28 @@ func awsAwsjson11_serializeDocumentDeliveryDestinationTypes(v []types.DeliveryDe return nil } +func awsAwsjson11_serializeDocumentDescribeFieldIndexesLogGroupIdentifiers(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentDescribeIndexPoliciesLogGroupIdentifiers(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentDimensions(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4740,6 +5518,23 @@ func awsAwsjson11_serializeDocumentEntityKeyAttributes(v map[string]string, valu return nil } +func awsAwsjson11_serializeDocumentGrok(v *types.Grok, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Match != nil { + ok := object.Key("match") + ok.String(*v.Match) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + func awsAwsjson11_serializeDocumentInputLogEvent(v *types.InputLogEvent, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4781,6 +5576,43 @@ func awsAwsjson11_serializeDocumentInputLogStreamNames(v []string, value smithyj return nil } +func awsAwsjson11_serializeDocumentListToMap(v *types.ListToMap, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Flatten { + ok := object.Key("flatten") + ok.Boolean(v.Flatten) + } + + if len(v.FlattenedElement) > 0 { + ok := object.Key("flattenedElement") + ok.String(string(v.FlattenedElement)) + } + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + if v.Target != nil { + ok := object.Key("target") + ok.String(*v.Target) + } + + if v.ValueKey != nil { + ok := object.Key("valueKey") + ok.String(*v.ValueKey) + } + + return nil +} + func awsAwsjson11_serializeDocumentLogGroupArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4825,18 +5657,54 @@ func awsAwsjson11_serializeDocumentLogTypes(v []string, value smithyjson.Value) return nil } -func awsAwsjson11_serializeDocumentMetricTransformation(v *types.MetricTransformation, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentLowerCaseString(v *types.LowerCaseString, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.DefaultValue != nil { - ok := object.Key("defaultValue") - switch { - case math.IsNaN(*v.DefaultValue): - ok.String("NaN") - - case math.IsInf(*v.DefaultValue, 1): - ok.String("Infinity") + if v.WithKeys != nil { + ok := object.Key("withKeys") + if err := awsAwsjson11_serializeDocumentLowerCaseStringWithKeys(v.WithKeys, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentLowerCaseStringWithKeys(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentMatchPatterns(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentMetricTransformation(v *types.MetricTransformation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DefaultValue != nil { + ok := object.Key("defaultValue") + switch { + case math.IsNaN(*v.DefaultValue): + ok.String("NaN") + + case math.IsInf(*v.DefaultValue, 1): + ok.String("Infinity") case math.IsInf(*v.DefaultValue, -1): ok.String("-Infinity") @@ -4847,50 +5715,612 @@ func awsAwsjson11_serializeDocumentMetricTransformation(v *types.MetricTransform } } - if v.Dimensions != nil { - ok := object.Key("dimensions") - if err := awsAwsjson11_serializeDocumentDimensions(v.Dimensions, ok); err != nil { - return err - } + if v.Dimensions != nil { + ok := object.Key("dimensions") + if err := awsAwsjson11_serializeDocumentDimensions(v.Dimensions, ok); err != nil { + return err + } + } + + if v.MetricName != nil { + ok := object.Key("metricName") + ok.String(*v.MetricName) + } + + if v.MetricNamespace != nil { + ok := object.Key("metricNamespace") + ok.String(*v.MetricNamespace) + } + + if v.MetricValue != nil { + ok := object.Key("metricValue") + ok.String(*v.MetricValue) + } + + if len(v.Unit) > 0 { + ok := object.Key("unit") + ok.String(string(v.Unit)) + } + + return nil +} + +func awsAwsjson11_serializeDocumentMetricTransformations(v []types.MetricTransformation, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentMetricTransformation(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentMoveKeyEntries(v []types.MoveKeyEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentMoveKeyEntry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentMoveKeyEntry(v *types.MoveKeyEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.OverwriteIfExists { + ok := object.Key("overwriteIfExists") + ok.Boolean(v.OverwriteIfExists) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + if v.Target != nil { + ok := object.Key("target") + ok.String(*v.Target) + } + + return nil +} + +func awsAwsjson11_serializeDocumentMoveKeys(v *types.MoveKeys, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Entries != nil { + ok := object.Key("entries") + if err := awsAwsjson11_serializeDocumentMoveKeyEntries(v.Entries, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentParseCloudfront(v *types.ParseCloudfront, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentParseJSON(v *types.ParseJSON, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Destination != nil { + ok := object.Key("destination") + ok.String(*v.Destination) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentParseKeyValue(v *types.ParseKeyValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Destination != nil { + ok := object.Key("destination") + ok.String(*v.Destination) + } + + if v.FieldDelimiter != nil { + ok := object.Key("fieldDelimiter") + ok.String(*v.FieldDelimiter) + } + + if v.KeyPrefix != nil { + ok := object.Key("keyPrefix") + ok.String(*v.KeyPrefix) + } + + if v.KeyValueDelimiter != nil { + ok := object.Key("keyValueDelimiter") + ok.String(*v.KeyValueDelimiter) + } + + if v.NonMatchValue != nil { + ok := object.Key("nonMatchValue") + ok.String(*v.NonMatchValue) + } + + if v.OverwriteIfExists { + ok := object.Key("overwriteIfExists") + ok.Boolean(v.OverwriteIfExists) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentParsePostgres(v *types.ParsePostgres, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentParseRoute53(v *types.ParseRoute53, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentParseVPC(v *types.ParseVPC, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentParseWAF(v *types.ParseWAF, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentProcessor(v *types.Processor, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AddKeys != nil { + ok := object.Key("addKeys") + if err := awsAwsjson11_serializeDocumentAddKeys(v.AddKeys, ok); err != nil { + return err + } + } + + if v.CopyValue != nil { + ok := object.Key("copyValue") + if err := awsAwsjson11_serializeDocumentCopyValue(v.CopyValue, ok); err != nil { + return err + } + } + + if v.Csv != nil { + ok := object.Key("csv") + if err := awsAwsjson11_serializeDocumentCSV(v.Csv, ok); err != nil { + return err + } + } + + if v.DateTimeConverter != nil { + ok := object.Key("dateTimeConverter") + if err := awsAwsjson11_serializeDocumentDateTimeConverter(v.DateTimeConverter, ok); err != nil { + return err + } + } + + if v.DeleteKeys != nil { + ok := object.Key("deleteKeys") + if err := awsAwsjson11_serializeDocumentDeleteKeys(v.DeleteKeys, ok); err != nil { + return err + } + } + + if v.Grok != nil { + ok := object.Key("grok") + if err := awsAwsjson11_serializeDocumentGrok(v.Grok, ok); err != nil { + return err + } + } + + if v.ListToMap != nil { + ok := object.Key("listToMap") + if err := awsAwsjson11_serializeDocumentListToMap(v.ListToMap, ok); err != nil { + return err + } + } + + if v.LowerCaseString != nil { + ok := object.Key("lowerCaseString") + if err := awsAwsjson11_serializeDocumentLowerCaseString(v.LowerCaseString, ok); err != nil { + return err + } + } + + if v.MoveKeys != nil { + ok := object.Key("moveKeys") + if err := awsAwsjson11_serializeDocumentMoveKeys(v.MoveKeys, ok); err != nil { + return err + } + } + + if v.ParseCloudfront != nil { + ok := object.Key("parseCloudfront") + if err := awsAwsjson11_serializeDocumentParseCloudfront(v.ParseCloudfront, ok); err != nil { + return err + } + } + + if v.ParseJSON != nil { + ok := object.Key("parseJSON") + if err := awsAwsjson11_serializeDocumentParseJSON(v.ParseJSON, ok); err != nil { + return err + } + } + + if v.ParseKeyValue != nil { + ok := object.Key("parseKeyValue") + if err := awsAwsjson11_serializeDocumentParseKeyValue(v.ParseKeyValue, ok); err != nil { + return err + } + } + + if v.ParsePostgres != nil { + ok := object.Key("parsePostgres") + if err := awsAwsjson11_serializeDocumentParsePostgres(v.ParsePostgres, ok); err != nil { + return err + } + } + + if v.ParseRoute53 != nil { + ok := object.Key("parseRoute53") + if err := awsAwsjson11_serializeDocumentParseRoute53(v.ParseRoute53, ok); err != nil { + return err + } + } + + if v.ParseVPC != nil { + ok := object.Key("parseVPC") + if err := awsAwsjson11_serializeDocumentParseVPC(v.ParseVPC, ok); err != nil { + return err + } + } + + if v.ParseWAF != nil { + ok := object.Key("parseWAF") + if err := awsAwsjson11_serializeDocumentParseWAF(v.ParseWAF, ok); err != nil { + return err + } + } + + if v.RenameKeys != nil { + ok := object.Key("renameKeys") + if err := awsAwsjson11_serializeDocumentRenameKeys(v.RenameKeys, ok); err != nil { + return err + } + } + + if v.SplitString != nil { + ok := object.Key("splitString") + if err := awsAwsjson11_serializeDocumentSplitString(v.SplitString, ok); err != nil { + return err + } + } + + if v.SubstituteString != nil { + ok := object.Key("substituteString") + if err := awsAwsjson11_serializeDocumentSubstituteString(v.SubstituteString, ok); err != nil { + return err + } + } + + if v.TrimString != nil { + ok := object.Key("trimString") + if err := awsAwsjson11_serializeDocumentTrimString(v.TrimString, ok); err != nil { + return err + } + } + + if v.TypeConverter != nil { + ok := object.Key("typeConverter") + if err := awsAwsjson11_serializeDocumentTypeConverter(v.TypeConverter, ok); err != nil { + return err + } + } + + if v.UpperCaseString != nil { + ok := object.Key("upperCaseString") + if err := awsAwsjson11_serializeDocumentUpperCaseString(v.UpperCaseString, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentProcessors(v []types.Processor, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentProcessor(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentRecordFields(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentRenameKeyEntries(v []types.RenameKeyEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentRenameKeyEntry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentRenameKeyEntry(v *types.RenameKeyEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) + } + + if v.OverwriteIfExists { + ok := object.Key("overwriteIfExists") + ok.Boolean(v.OverwriteIfExists) + } + + if v.RenameTo != nil { + ok := object.Key("renameTo") + ok.String(*v.RenameTo) + } + + return nil +} + +func awsAwsjson11_serializeDocumentRenameKeys(v *types.RenameKeys, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Entries != nil { + ok := object.Key("entries") + if err := awsAwsjson11_serializeDocumentRenameKeyEntries(v.Entries, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentResourceTypes(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentS3DeliveryConfiguration(v *types.S3DeliveryConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EnableHiveCompatiblePath != nil { + ok := object.Key("enableHiveCompatiblePath") + ok.Boolean(*v.EnableHiveCompatiblePath) + } + + if v.SuffixPath != nil { + ok := object.Key("suffixPath") + ok.String(*v.SuffixPath) + } + + return nil +} + +func awsAwsjson11_serializeDocumentSplitString(v *types.SplitString, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Entries != nil { + ok := object.Key("entries") + if err := awsAwsjson11_serializeDocumentSplitStringEntries(v.Entries, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentSplitStringEntries(v []types.SplitStringEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentSplitStringEntry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentSplitStringEntry(v *types.SplitStringEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Delimiter != nil { + ok := object.Key("delimiter") + ok.String(*v.Delimiter) + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +func awsAwsjson11_serializeDocumentStartLiveTailLogGroupIdentifiers(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + +func awsAwsjson11_serializeDocumentSubstituteString(v *types.SubstituteString, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Entries != nil { + ok := object.Key("entries") + if err := awsAwsjson11_serializeDocumentSubstituteStringEntries(v.Entries, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentSubstituteStringEntries(v []types.SubstituteStringEntry, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentSubstituteStringEntry(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentSubstituteStringEntry(v *types.SubstituteStringEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.From != nil { + ok := object.Key("from") + ok.String(*v.From) } - if v.MetricName != nil { - ok := object.Key("metricName") - ok.String(*v.MetricName) + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) } - if v.MetricNamespace != nil { - ok := object.Key("metricNamespace") - ok.String(*v.MetricNamespace) + if v.To != nil { + ok := object.Key("to") + ok.String(*v.To) } - if v.MetricValue != nil { - ok := object.Key("metricValue") - ok.String(*v.MetricValue) + return nil +} + +func awsAwsjson11_serializeDocumentSuppressionPeriod(v *types.SuppressionPeriod, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.SuppressionUnit) > 0 { + ok := object.Key("suppressionUnit") + ok.String(string(v.SuppressionUnit)) } - if len(v.Unit) > 0 { - ok := object.Key("unit") - ok.String(string(v.Unit)) + if v.Value != 0 { + ok := object.Key("value") + ok.Integer(v.Value) } return nil } -func awsAwsjson11_serializeDocumentMetricTransformations(v []types.MetricTransformation, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() - if err := awsAwsjson11_serializeDocumentMetricTransformation(&v[i], av); err != nil { - return err - } + av.String(v[i]) } return nil } -func awsAwsjson11_serializeDocumentRecordFields(v []string, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentTagList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4901,7 +6331,18 @@ func awsAwsjson11_serializeDocumentRecordFields(v []string, value smithyjson.Val return nil } -func awsAwsjson11_serializeDocumentResourceTypes(v []string, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentTags(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 awsAwsjson11_serializeDocumentTestEventMessages(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4912,24 +6353,21 @@ func awsAwsjson11_serializeDocumentResourceTypes(v []string, value smithyjson.Va return nil } -func awsAwsjson11_serializeDocumentS3DeliveryConfiguration(v *types.S3DeliveryConfiguration, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentTrimString(v *types.TrimString, value smithyjson.Value) error { object := value.Object() defer object.Close() - if v.EnableHiveCompatiblePath != nil { - ok := object.Key("enableHiveCompatiblePath") - ok.Boolean(*v.EnableHiveCompatiblePath) - } - - if v.SuffixPath != nil { - ok := object.Key("suffixPath") - ok.String(*v.SuffixPath) + if v.WithKeys != nil { + ok := object.Key("withKeys") + if err := awsAwsjson11_serializeDocumentTrimStringWithKeys(v.WithKeys, ok); err != nil { + return err + } } return nil } -func awsAwsjson11_serializeDocumentStartLiveTailLogGroupIdentifiers(v []string, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentTrimStringWithKeys(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -4940,57 +6378,65 @@ func awsAwsjson11_serializeDocumentStartLiveTailLogGroupIdentifiers(v []string, return nil } -func awsAwsjson11_serializeDocumentSuppressionPeriod(v *types.SuppressionPeriod, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentTypeConverter(v *types.TypeConverter, value smithyjson.Value) error { object := value.Object() defer object.Close() - if len(v.SuppressionUnit) > 0 { - ok := object.Key("suppressionUnit") - ok.String(string(v.SuppressionUnit)) - } - - if v.Value != 0 { - ok := object.Key("value") - ok.Integer(v.Value) + if v.Entries != nil { + ok := object.Key("entries") + if err := awsAwsjson11_serializeDocumentTypeConverterEntries(v.Entries, ok); err != nil { + return err + } } return nil } -func awsAwsjson11_serializeDocumentTagKeyList(v []string, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentTypeConverterEntries(v []types.TypeConverterEntry, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() - av.String(v[i]) + if err := awsAwsjson11_serializeDocumentTypeConverterEntry(&v[i], av); err != nil { + return err + } } return nil } -func awsAwsjson11_serializeDocumentTagList(v []string, value smithyjson.Value) error { - array := value.Array() - defer array.Close() +func awsAwsjson11_serializeDocumentTypeConverterEntry(v *types.TypeConverterEntry, value smithyjson.Value) error { + object := value.Object() + defer object.Close() - for i := range v { - av := array.Value() - av.String(v[i]) + if v.Key != nil { + ok := object.Key("key") + ok.String(*v.Key) } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + return nil } -func awsAwsjson11_serializeDocumentTags(v map[string]string, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentUpperCaseString(v *types.UpperCaseString, value smithyjson.Value) error { object := value.Object() defer object.Close() - for key := range v { - om := object.Key(key) - om.String(v[key]) + if v.WithKeys != nil { + ok := object.Key("withKeys") + if err := awsAwsjson11_serializeDocumentUpperCaseStringWithKeys(v.WithKeys, ok); err != nil { + return err + } } + return nil } -func awsAwsjson11_serializeDocumentTestEventMessages(v []string, value smithyjson.Value) error { +func awsAwsjson11_serializeDocumentUpperCaseStringWithKeys(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -5301,6 +6747,18 @@ func awsAwsjson11_serializeOpDocumentDeleteDestinationInput(v *DeleteDestination return nil } +func awsAwsjson11_serializeOpDocumentDeleteIndexPolicyInput(v *DeleteIndexPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogGroupIdentifier != nil { + ok := object.Key("logGroupIdentifier") + ok.String(*v.LogGroupIdentifier) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDeleteLogAnomalyDetectorInput(v *DeleteLogAnomalyDetectorInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5412,6 +6870,18 @@ func awsAwsjson11_serializeOpDocumentDeleteSubscriptionFilterInput(v *DeleteSubs return nil } +func awsAwsjson11_serializeOpDocumentDeleteTransformerInput(v *DeleteTransformerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogGroupIdentifier != nil { + ok := object.Key("logGroupIdentifier") + ok.String(*v.LogGroupIdentifier) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeAccountPoliciesInput(v *DescribeAccountPoliciesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5423,6 +6893,11 @@ func awsAwsjson11_serializeOpDocumentDescribeAccountPoliciesInput(v *DescribeAcc } } + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + if v.PolicyName != nil { ok := object.Key("policyName") ok.String(*v.PolicyName) @@ -5579,6 +7054,44 @@ func awsAwsjson11_serializeOpDocumentDescribeExportTasksInput(v *DescribeExportT return nil } +func awsAwsjson11_serializeOpDocumentDescribeFieldIndexesInput(v *DescribeFieldIndexesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogGroupIdentifiers != nil { + ok := object.Key("logGroupIdentifiers") + if err := awsAwsjson11_serializeDocumentDescribeFieldIndexesLogGroupIdentifiers(v.LogGroupIdentifiers, ok); err != nil { + return err + } + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentDescribeIndexPoliciesInput(v *DescribeIndexPoliciesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogGroupIdentifiers != nil { + ok := object.Key("logGroupIdentifiers") + if err := awsAwsjson11_serializeDocumentDescribeIndexPoliciesLogGroupIdentifiers(v.LogGroupIdentifiers, ok); err != nil { + return err + } + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentDescribeLogGroupsInput(v *DescribeLogGroupsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6051,6 +7564,18 @@ func awsAwsjson11_serializeOpDocumentGetQueryResultsInput(v *GetQueryResultsInpu return nil } +func awsAwsjson11_serializeOpDocumentGetTransformerInput(v *GetTransformerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogGroupIdentifier != nil { + ok := object.Key("logGroupIdentifier") + ok.String(*v.LogGroupIdentifier) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListAnomaliesInput(v *ListAnomaliesInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6100,6 +7625,28 @@ func awsAwsjson11_serializeOpDocumentListLogAnomalyDetectorsInput(v *ListLogAnom return nil } +func awsAwsjson11_serializeOpDocumentListLogGroupsForQueryInput(v *ListLogGroupsForQueryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + if v.QueryId != nil { + ok := object.Key("queryId") + ok.String(*v.QueryId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6301,6 +7848,23 @@ func awsAwsjson11_serializeOpDocumentPutDestinationPolicyInput(v *PutDestination return nil } +func awsAwsjson11_serializeOpDocumentPutIndexPolicyInput(v *PutIndexPolicyInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogGroupIdentifier != nil { + ok := object.Key("logGroupIdentifier") + ok.String(*v.LogGroupIdentifier) + } + + if v.PolicyDocument != nil { + ok := object.Key("policyDocument") + ok.String(*v.PolicyDocument) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentPutLogEventsInput(v *PutLogEventsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6341,6 +7905,11 @@ func awsAwsjson11_serializeOpDocumentPutMetricFilterInput(v *PutMetricFilterInpu object := value.Object() defer object.Close() + if v.ApplyOnTransformedLogs { + ok := object.Key("applyOnTransformedLogs") + ok.Boolean(v.ApplyOnTransformedLogs) + } + if v.FilterName != nil { ok := object.Key("filterName") ok.String(*v.FilterName) @@ -6438,6 +8007,11 @@ func awsAwsjson11_serializeOpDocumentPutSubscriptionFilterInput(v *PutSubscripti object := value.Object() defer object.Close() + if v.ApplyOnTransformedLogs { + ok := object.Key("applyOnTransformedLogs") + ok.Boolean(v.ApplyOnTransformedLogs) + } + if v.DestinationArn != nil { ok := object.Key("destinationArn") ok.String(*v.DestinationArn) @@ -6471,6 +8045,25 @@ func awsAwsjson11_serializeOpDocumentPutSubscriptionFilterInput(v *PutSubscripti return nil } +func awsAwsjson11_serializeOpDocumentPutTransformerInput(v *PutTransformerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogGroupIdentifier != nil { + ok := object.Key("logGroupIdentifier") + ok.String(*v.LogGroupIdentifier) + } + + if v.TransformerConfig != nil { + ok := object.Key("transformerConfig") + if err := awsAwsjson11_serializeDocumentProcessors(v.TransformerConfig, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentStartLiveTailInput(v *StartLiveTailInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -6619,6 +8212,27 @@ func awsAwsjson11_serializeOpDocumentTestMetricFilterInput(v *TestMetricFilterIn return nil } +func awsAwsjson11_serializeOpDocumentTestTransformerInput(v *TestTransformerInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.LogEventMessages != nil { + ok := object.Key("logEventMessages") + if err := awsAwsjson11_serializeDocumentTestEventMessages(v.LogEventMessages, ok); err != nil { + return err + } + } + + if v.TransformerConfig != nil { + ok := object.Key("transformerConfig") + if err := awsAwsjson11_serializeDocumentProcessors(v.TransformerConfig, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentUntagLogGroupInput(v *UntagLogGroupInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/cloudwatchlogs/snapshot/api_op_DeleteIndexPolicy.go.snap b/service/cloudwatchlogs/snapshot/api_op_DeleteIndexPolicy.go.snap new file mode 100644 index 00000000000..1857315e32c --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_DeleteIndexPolicy.go.snap @@ -0,0 +1,41 @@ +DeleteIndexPolicy + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot/api_op_DeleteTransformer.go.snap b/service/cloudwatchlogs/snapshot/api_op_DeleteTransformer.go.snap new file mode 100644 index 00000000000..894f9c77b93 --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_DeleteTransformer.go.snap @@ -0,0 +1,41 @@ +DeleteTransformer + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot/api_op_DescribeFieldIndexes.go.snap b/service/cloudwatchlogs/snapshot/api_op_DescribeFieldIndexes.go.snap new file mode 100644 index 00000000000..9bf47923604 --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_DescribeFieldIndexes.go.snap @@ -0,0 +1,41 @@ +DescribeFieldIndexes + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot/api_op_DescribeIndexPolicies.go.snap b/service/cloudwatchlogs/snapshot/api_op_DescribeIndexPolicies.go.snap new file mode 100644 index 00000000000..a03406046bc --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_DescribeIndexPolicies.go.snap @@ -0,0 +1,41 @@ +DescribeIndexPolicies + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot/api_op_GetTransformer.go.snap b/service/cloudwatchlogs/snapshot/api_op_GetTransformer.go.snap new file mode 100644 index 00000000000..a824832f35c --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_GetTransformer.go.snap @@ -0,0 +1,41 @@ +GetTransformer + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot/api_op_ListLogGroupsForQuery.go.snap b/service/cloudwatchlogs/snapshot/api_op_ListLogGroupsForQuery.go.snap new file mode 100644 index 00000000000..c28e3e564dd --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_ListLogGroupsForQuery.go.snap @@ -0,0 +1,41 @@ +ListLogGroupsForQuery + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot/api_op_PutIndexPolicy.go.snap b/service/cloudwatchlogs/snapshot/api_op_PutIndexPolicy.go.snap new file mode 100644 index 00000000000..9f16e29ed57 --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_PutIndexPolicy.go.snap @@ -0,0 +1,41 @@ +PutIndexPolicy + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot/api_op_PutTransformer.go.snap b/service/cloudwatchlogs/snapshot/api_op_PutTransformer.go.snap new file mode 100644 index 00000000000..2643f2e276b --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_PutTransformer.go.snap @@ -0,0 +1,41 @@ +PutTransformer + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot/api_op_TestTransformer.go.snap b/service/cloudwatchlogs/snapshot/api_op_TestTransformer.go.snap new file mode 100644 index 00000000000..cc1e2ad54c7 --- /dev/null +++ b/service/cloudwatchlogs/snapshot/api_op_TestTransformer.go.snap @@ -0,0 +1,41 @@ +TestTransformer + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/cloudwatchlogs/snapshot_test.go b/service/cloudwatchlogs/snapshot_test.go index 6551d7f33d6..0d207f570ee 100644 --- a/service/cloudwatchlogs/snapshot_test.go +++ b/service/cloudwatchlogs/snapshot_test.go @@ -230,6 +230,18 @@ func TestCheckSnapshot_DeleteDestination(t *testing.T) { } } +func TestCheckSnapshot_DeleteIndexPolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteIndexPolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteIndexPolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteLogAnomalyDetector(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteLogAnomalyDetector(context.Background(), nil, func(o *Options) { @@ -326,6 +338,18 @@ func TestCheckSnapshot_DeleteSubscriptionFilter(t *testing.T) { } } +func TestCheckSnapshot_DeleteTransformer(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteTransformer(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteTransformer") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeAccountPolicies(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeAccountPolicies(context.Background(), nil, func(o *Options) { @@ -410,6 +434,30 @@ func TestCheckSnapshot_DescribeExportTasks(t *testing.T) { } } +func TestCheckSnapshot_DescribeFieldIndexes(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeFieldIndexes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeFieldIndexes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DescribeIndexPolicies(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeIndexPolicies(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeIndexPolicies") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeLogGroups(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeLogGroups(context.Background(), nil, func(o *Options) { @@ -638,6 +686,18 @@ func TestCheckSnapshot_GetQueryResults(t *testing.T) { } } +func TestCheckSnapshot_GetTransformer(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTransformer(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetTransformer") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListAnomalies(t *testing.T) { svc := New(Options{}) _, err := svc.ListAnomalies(context.Background(), nil, func(o *Options) { @@ -662,6 +722,18 @@ func TestCheckSnapshot_ListLogAnomalyDetectors(t *testing.T) { } } +func TestCheckSnapshot_ListLogGroupsForQuery(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListLogGroupsForQuery(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListLogGroupsForQuery") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -770,6 +842,18 @@ func TestCheckSnapshot_PutDestinationPolicy(t *testing.T) { } } +func TestCheckSnapshot_PutIndexPolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutIndexPolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutIndexPolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_PutLogEvents(t *testing.T) { svc := New(Options{}) _, err := svc.PutLogEvents(context.Background(), nil, func(o *Options) { @@ -842,6 +926,18 @@ func TestCheckSnapshot_PutSubscriptionFilter(t *testing.T) { } } +func TestCheckSnapshot_PutTransformer(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutTransformer(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PutTransformer") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartLiveTail(t *testing.T) { svc := New(Options{}) _, err := svc.StartLiveTail(context.Background(), nil, func(o *Options) { @@ -914,6 +1010,18 @@ func TestCheckSnapshot_TestMetricFilter(t *testing.T) { } } +func TestCheckSnapshot_TestTransformer(t *testing.T) { + svc := New(Options{}) + _, err := svc.TestTransformer(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "TestTransformer") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UntagLogGroup(t *testing.T) { svc := New(Options{}) _, err := svc.UntagLogGroup(context.Background(), nil, func(o *Options) { @@ -1141,6 +1249,18 @@ func TestUpdateSnapshot_DeleteDestination(t *testing.T) { } } +func TestUpdateSnapshot_DeleteIndexPolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteIndexPolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteIndexPolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteLogAnomalyDetector(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteLogAnomalyDetector(context.Background(), nil, func(o *Options) { @@ -1237,6 +1357,18 @@ func TestUpdateSnapshot_DeleteSubscriptionFilter(t *testing.T) { } } +func TestUpdateSnapshot_DeleteTransformer(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteTransformer(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteTransformer") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeAccountPolicies(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeAccountPolicies(context.Background(), nil, func(o *Options) { @@ -1321,6 +1453,30 @@ func TestUpdateSnapshot_DescribeExportTasks(t *testing.T) { } } +func TestUpdateSnapshot_DescribeFieldIndexes(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeFieldIndexes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeFieldIndexes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DescribeIndexPolicies(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeIndexPolicies(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeIndexPolicies") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeLogGroups(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeLogGroups(context.Background(), nil, func(o *Options) { @@ -1549,6 +1705,18 @@ func TestUpdateSnapshot_GetQueryResults(t *testing.T) { } } +func TestUpdateSnapshot_GetTransformer(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTransformer(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetTransformer") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListAnomalies(t *testing.T) { svc := New(Options{}) _, err := svc.ListAnomalies(context.Background(), nil, func(o *Options) { @@ -1573,6 +1741,18 @@ func TestUpdateSnapshot_ListLogAnomalyDetectors(t *testing.T) { } } +func TestUpdateSnapshot_ListLogGroupsForQuery(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListLogGroupsForQuery(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListLogGroupsForQuery") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -1681,6 +1861,18 @@ func TestUpdateSnapshot_PutDestinationPolicy(t *testing.T) { } } +func TestUpdateSnapshot_PutIndexPolicy(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutIndexPolicy(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutIndexPolicy") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_PutLogEvents(t *testing.T) { svc := New(Options{}) _, err := svc.PutLogEvents(context.Background(), nil, func(o *Options) { @@ -1753,6 +1945,18 @@ func TestUpdateSnapshot_PutSubscriptionFilter(t *testing.T) { } } +func TestUpdateSnapshot_PutTransformer(t *testing.T) { + svc := New(Options{}) + _, err := svc.PutTransformer(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PutTransformer") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartLiveTail(t *testing.T) { svc := New(Options{}) _, err := svc.StartLiveTail(context.Background(), nil, func(o *Options) { @@ -1825,6 +2029,18 @@ func TestUpdateSnapshot_TestMetricFilter(t *testing.T) { } } +func TestUpdateSnapshot_TestTransformer(t *testing.T) { + svc := New(Options{}) + _, err := svc.TestTransformer(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "TestTransformer") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UntagLogGroup(t *testing.T) { svc := New(Options{}) _, err := svc.UntagLogGroup(context.Background(), nil, func(o *Options) { diff --git a/service/cloudwatchlogs/types/enums.go b/service/cloudwatchlogs/types/enums.go index 245f8740d7f..d7724c89435 100644 --- a/service/cloudwatchlogs/types/enums.go +++ b/service/cloudwatchlogs/types/enums.go @@ -175,6 +175,44 @@ func (ExportTaskStatusCode) Values() []ExportTaskStatusCode { } } +type FlattenedElement string + +// Enum values for FlattenedElement +const ( + FlattenedElementFirst FlattenedElement = "first" + FlattenedElementLast FlattenedElement = "last" +) + +// Values returns all known values for FlattenedElement. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FlattenedElement) Values() []FlattenedElement { + return []FlattenedElement{ + "first", + "last", + } +} + +type IndexSource string + +// Enum values for IndexSource +const ( + IndexSourceAccount IndexSource = "ACCOUNT" + IndexSourceLogGroup IndexSource = "LOG_GROUP" +) + +// Values returns all known values for IndexSource. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (IndexSource) Values() []IndexSource { + return []IndexSource{ + "ACCOUNT", + "LOG_GROUP", + } +} + type InheritedProperty string // Enum values for InheritedProperty @@ -261,6 +299,8 @@ type PolicyType string const ( PolicyTypeDataProtectionPolicy PolicyType = "DATA_PROTECTION_POLICY" PolicyTypeSubscriptionFilterPolicy PolicyType = "SUBSCRIPTION_FILTER_POLICY" + PolicyTypeFieldIndexPolicy PolicyType = "FIELD_INDEX_POLICY" + PolicyTypeTransformerPolicy PolicyType = "TRANSFORMER_POLICY" ) // Values returns all known values for PolicyType. Note that this can be expanded @@ -271,6 +311,8 @@ func (PolicyType) Values() []PolicyType { return []PolicyType{ "DATA_PROTECTION_POLICY", "SUBSCRIPTION_FILTER_POLICY", + "FIELD_INDEX_POLICY", + "TRANSFORMER_POLICY", } } @@ -468,3 +510,26 @@ func (SuppressionUnit) Values() []SuppressionUnit { "HOURS", } } + +type Type string + +// Enum values for Type +const ( + TypeBoolean Type = "boolean" + TypeInteger Type = "integer" + TypeDouble Type = "double" + TypeString Type = "string" +) + +// Values returns all known values for Type. Note that this can be expanded in the +// future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (Type) Values() []Type { + return []Type{ + "boolean", + "integer", + "double", + "string", + } +} diff --git a/service/cloudwatchlogs/types/types.go b/service/cloudwatchlogs/types/types.go index 5623a4d7198..cee8d0976b6 100644 --- a/service/cloudwatchlogs/types/types.go +++ b/service/cloudwatchlogs/types/types.go @@ -29,12 +29,51 @@ type AccountPolicy struct { // The scope of the account policy. Scope Scope - // The log group selection criteria for this subscription filter policy. + // The log group selection criteria that is used for this policy. SelectionCriteria *string noSmithyDocumentSerde } +// This object defines one key that will be added with the [addKeys] processor. +// +// [addKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-addKey +type AddKeyEntry struct { + + // The key of the new entry to be added to the log event + // + // This member is required. + Key *string + + // The value of the new entry to be added to the log event + // + // This member is required. + Value *string + + // Specifies whether to overwrite the value if the key already exists in the log + // event. If you omit this, the default is false . + OverwriteIfExists bool + + noSmithyDocumentSerde +} + +// This processor adds new key-value pairs to the log event. +// +// For more information about this processor including examples, see [addKeys] in the +// CloudWatch Logs User Guide. +// +// [addKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-addKeys +type AddKeys struct { + + // An array of objects, where each object contains the information about one key + // to add to the log event. + // + // This member is required. + Entries []AddKeyEntry + + noSmithyDocumentSerde +} + // This structure represents one anomaly that has been found by a logs anomaly // detector. // @@ -283,6 +322,138 @@ type ConfigurationTemplateDeliveryConfigValues struct { noSmithyDocumentSerde } +// This processor copies values within a log event. You can also use this +// processor to add metadata to log events by copying the values of the following +// metadata keys into the log events: @logGroupName , @logGroupStream , @accountId +// , @regionName . +// +// For more information about this processor including examples, see [copyValue] in the +// CloudWatch Logs User Guide. +// +// [copyValue]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-copyValue +type CopyValue struct { + + // An array of CopyValueEntry objects, where each object contains the information + // about one field value to copy. + // + // This member is required. + Entries []CopyValueEntry + + noSmithyDocumentSerde +} + +// This object defines one value to be copied with the [copyValue] processor. +// +// [copyValue]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-copoyValue +type CopyValueEntry struct { + + // The key to copy. + // + // This member is required. + Source *string + + // The key of the field to copy the value to. + // + // This member is required. + Target *string + + // Specifies whether to overwrite the value if the destination key already exists. + // If you omit this, the default is false . + OverwriteIfExists bool + + noSmithyDocumentSerde +} + +// The CSV processor parses comma-separated values (CSV) from the log events into +// columns. +// +// For more information about this processor including examples, see [csv] in the +// CloudWatch Logs User Guide. +// +// [csv]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-csv +type CSV struct { + + // An array of names to use for the columns in the transformed log event. + // + // If you omit this, default column names ( [column_1, column_2 ...] ) are used. + Columns []string + + // The character used to separate each column in the original comma-separated + // value log event. If you omit this, the processor looks for the comma , + // character as the delimiter. + Delimiter *string + + // The character used used as a text qualifier for a single column of data. If you + // omit this, the double quotation mark " character is used. + QuoteCharacter *string + + // The path to the field in the log event that has the comma separated values to + // be parsed. If you omit this value, the whole log message is processed. + Source *string + + noSmithyDocumentSerde +} + +// This processor converts a datetime string into a format that you specify. +// +// For more information about this processor including examples, see [datetimeConverter] in the +// CloudWatch Logs User Guide. +// +// [datetimeConverter]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-datetimeConverter +type DateTimeConverter struct { + + // A list of patterns to match against the source field. + // + // This member is required. + MatchPatterns []string + + // The key to apply the date conversion to. + // + // This member is required. + Source *string + + // The JSON field to store the result in. + // + // This member is required. + Target *string + + // The locale of the source field. If you omit this, the default of locale.ROOT is + // used. + Locale *string + + // The time zone of the source field. If you omit this, the default used is the + // UTC zone. + SourceTimezone *string + + // The datetime format to use for the converted data in the target field. + // + // If you omit this, the default of yyyy-MM-dd'T'HH:mm:ss.SSS'Z is used. + TargetFormat *string + + // The time zone of the target field. If you omit this, the default used is the + // UTC zone. + TargetTimezone *string + + noSmithyDocumentSerde +} + +// This processor deletes entries from a log event. These entries are key-value +// pairs. +// +// For more information about this processor including examples, see [deleteKeys] in the +// CloudWatch Logs User Guide. +// +// [deleteKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-deleteKeys +type DeleteKeys struct { + + // The list of keys to delete. + // + // This member is required. + WithKeys []string + + noSmithyDocumentSerde +} + // This structure contains information about one delivery in your account. // // A delivery is a connection between a logical delivery source and a logical @@ -484,13 +655,28 @@ type Destination struct { noSmithyDocumentSerde } -// Reserved for internal use. +// The entity associated with the log events in a PutLogEvents call. type Entity struct { - // Reserved for internal use. + // Additional attributes of the entity that are not used to specify the identity + // of the entity. A list of key-value pairs. + // + // For details about how to use the attributes, see [How to add related information to telemetry] in the CloudWatch User Guide. + // + // [How to add related information to telemetry]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/adding-your-own-related-telemetry.html Attributes map[string]string - // Reserved for internal use. + // The attributes of the entity which identify the specific entity, as a list of + // key-value pairs. Entities with the same keyAttributes are considered to be the + // same entity. + // + // There are five allowed attributes (key names): Type , ResourceType , Identifier + // Name , and Environment . + // + // For details about how to use the key attributes, see [How to add related information to telemetry] in the CloudWatch User + // Guide. + // + // [How to add related information to telemetry]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/adding-your-own-related-telemetry.html KeyAttributes map[string]string noSmithyDocumentSerde @@ -558,6 +744,32 @@ type ExportTaskStatus struct { noSmithyDocumentSerde } +// This structure describes one log event field that is used as an index in at +// least one index policy in this account. +type FieldIndex struct { + + // The string that this field index matches. + FieldIndexName *string + + // The time and date of the earliest log event that matches this field index, + // after the index policy that contains it was created. + FirstEventTime *int64 + + // The time and date of the most recent log event that matches this field index. + LastEventTime *int64 + + // The most recent time that CloudWatch Logs scanned ingested log events to search + // for this field index to improve the speed of future CloudWatch Logs Insights + // queries that search for this field index. + LastScanTime *int64 + + // If this field index appears in an index policy that applies only to a single + // log group, the ARN of that log group is displayed here. + LogGroupIdentifier *string + + noSmithyDocumentSerde +} + // Represents a matched event. type FilteredLogEvent struct { @@ -581,6 +793,54 @@ type FilteredLogEvent struct { noSmithyDocumentSerde } +// This processor uses pattern matching to parse and structure unstructured data. +// This processor can also extract fields from log messages. +// +// For more information about this processor including examples, see [grok] in the +// CloudWatch Logs User Guide. +// +// [grok]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-Grok +type Grok struct { + + // The grok pattern to match against the log event. For a list of supported grok + // patterns, see [Supported grok patterns]. + // + // [Supported grok patterns]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#Grok-Patterns + // + // This member is required. + Match *string + + // The path to the field in the log event that you want to parse. If you omit this + // value, the whole log message is parsed. + Source *string + + noSmithyDocumentSerde +} + +// This structure contains information about one field index policy in this +// account. +type IndexPolicy struct { + + // The date and time that this index policy was most recently updated. + LastUpdateTime *int64 + + // The ARN of the log group that this index policy applies to. + LogGroupIdentifier *string + + // The policy document for this index policy, in JSON format. + PolicyDocument *string + + // The name of this policy. Responses about log group-level field index policies + // don't have this field, because those policies don't have names. + PolicyName *string + + // This field indicates whether this is an account-level index policy or an index + // policy that applies only to a single log group. + Source IndexSource + + noSmithyDocumentSerde +} + // Represents a log event, which is a record of activity that was recorded by the // application or resource being monitored. type InputLogEvent struct { @@ -599,6 +859,48 @@ type InputLogEvent struct { noSmithyDocumentSerde } +// This processor takes a list of objects that contain key fields, and converts +// them into a map of target keys. +// +// For more information about this processor including examples, see [listToMap] in the +// CloudWatch Logs User Guide. +// +// [listToMap]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-listToMap +type ListToMap struct { + + // The key of the field to be extracted as keys in the generated map + // + // This member is required. + Key *string + + // The key in the log event that has a list of objects that will be converted to a + // map. + // + // This member is required. + Source *string + + // A Boolean value to indicate whether the list will be flattened into single + // items. Specify true to flatten the list. The default is false + Flatten bool + + // If you set flatten to true , use flattenedElement to specify which element, + // first or last , to keep. + // + // You must specify this parameter if flatten is true + FlattenedElement FlattenedElement + + // The key of the field that will hold the generated map + Target *string + + // If this is specified, the values that you specify in this parameter will be + // extracted from the source objects and put into the values of the generated map. + // Otherwise, original objects in the source list will be put into the values of + // the generated map. + ValueKey *string + + noSmithyDocumentSerde +} + // This object contains the information for one log event returned in a Live Tail // stream. type LiveTailSessionLogEvent struct { @@ -852,11 +1154,36 @@ type LogStream struct { noSmithyDocumentSerde } +// This processor converts a string to lowercase. +// +// For more information about this processor including examples, see [lowerCaseString] in the +// CloudWatch Logs User Guide. +// +// [lowerCaseString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-lowerCaseString +type LowerCaseString struct { + + // The array caontaining the keys of the fields to convert to lowercase. + // + // This member is required. + WithKeys []string + + noSmithyDocumentSerde +} + // Metric filters express how CloudWatch Logs would extract metric observations // from ingested log events and transform them into metric data in a CloudWatch // metric. type MetricFilter struct { + // This parameter is valid only for log groups that have an active log + // transformer. For more information about log transformers, see [PutTransformer]. + // + // If this value is true , the metric filter is applied on the transformed version + // of the log events instead of the original ingested log events. + // + // [PutTransformer]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html + ApplyOnTransformedLogs bool + // The creation time of the metric filter, expressed as the number of milliseconds // after Jan 1, 1970 00:00:00 UTC . CreationTime *int64 @@ -946,6 +1273,46 @@ type MetricTransformation struct { noSmithyDocumentSerde } +// This object defines one key that will be moved with the [moveKey] processor. +// +// [moveKey]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-moveKey +type MoveKeyEntry struct { + + // The key to move. + // + // This member is required. + Source *string + + // The key to move to. + // + // This member is required. + Target *string + + // Specifies whether to overwrite the value if the destination key already exists. + // If you omit this, the default is false . + OverwriteIfExists bool + + noSmithyDocumentSerde +} + +// This processor moves a key from one field to another. The original key is +// deleted. +// +// For more information about this processor including examples, see [moveKeys] in the +// CloudWatch Logs User Guide. +// +// [moveKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-moveKeys +type MoveKeys struct { + + // An array of objects, where each object contains the information about one key + // to move. + // + // This member is required. + Entries []MoveKeyEntry + + noSmithyDocumentSerde +} + // Represents a log event. type OutputLogEvent struct { @@ -963,6 +1330,167 @@ type OutputLogEvent struct { noSmithyDocumentSerde } +// This processor parses CloudFront vended logs, extract fields, and convert them +// into JSON format. Encoded field values are decoded. Values that are integers and +// doubles are treated as such. For more information about this processor including +// examples, see [parseCloudfront] +// +// For more information about CloudFront log format, see [Configure and use standard logs (access logs)]. +// +// If you use this processor, it must be the first processor in your transformer. +// +// [parseCloudfront]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseCloudfront +// [Configure and use standard logs (access logs)]: https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/AccessLogs.html +type ParseCloudfront struct { + + // Omit this parameter and the whole log message will be processed by this + // processor. No other value than @message is allowed for source . + Source *string + + noSmithyDocumentSerde +} + +// This processor parses log events that are in JSON format. It can extract JSON +// key-value pairs and place them under a destination that you specify. +// +// Additionally, because you must have at least one parse-type processor in a +// transformer, you can use ParseJSON as that processor for JSON-format logs, so +// that you can also apply other processors, such as mutate processors, to these +// logs. +// +// For more information about this processor including examples, see [parseJSON] in the +// CloudWatch Logs User Guide. +// +// [parseJSON]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseJSON +type ParseJSON struct { + + // The location to put the parsed key value pair into. If you omit this parameter, + // it is placed under the root node. + Destination *string + + // Path to the field in the log event that will be parsed. Use dot notation to + // access child fields. For example, store.book + Source *string + + noSmithyDocumentSerde +} + +// This processor parses a specified field in the original log event into +// key-value pairs. +// +// For more information about this processor including examples, see [parseKeyValue] in the +// CloudWatch Logs User Guide. +// +// [parseKeyValue]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseKeyValue +type ParseKeyValue struct { + + // The destination field to put the extracted key-value pairs into + Destination *string + + // The field delimiter string that is used between key-value pairs in the original + // log events. If you omit this, the ampersand & character is used. + FieldDelimiter *string + + // If you want to add a prefix to all transformed keys, specify it here. + KeyPrefix *string + + // The delimiter string to use between the key and value in each pair in the + // transformed log event. + // + // If you omit this, the equal = character is used. + KeyValueDelimiter *string + + // A value to insert into the value field in the result, when a key-value pair is + // not successfully split. + NonMatchValue *string + + // Specifies whether to overwrite the value if the destination key already exists. + // If you omit this, the default is false . + OverwriteIfExists bool + + // Path to the field in the log event that will be parsed. Use dot notation to + // access child fields. For example, store.book + Source *string + + noSmithyDocumentSerde +} + +// Use this processor to parse RDS for PostgreSQL vended logs, extract fields, and +// and convert them into a JSON format. This processor always processes the entire +// log event message. For more information about this processor including examples, +// see [parsePostGres]. +// +// For more information about RDS for PostgreSQL log format, see [RDS for PostgreSQL database log filesTCP flag sequence]. +// +// If you use this processor, it must be the first processor in your transformer. +// +// [RDS for PostgreSQL database log filesTCP flag sequence]: https://docs.aws.amazon.com/AmazonRDS/latest/UserGuide/USER_LogAccess.Concepts.PostgreSQL.html#USER_LogAccess.Concepts.PostgreSQL.Log_Format.log-line-prefix +// [parsePostGres]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parsePostGres +type ParsePostgres struct { + + // Omit this parameter and the whole log message will be processed by this + // processor. No other value than @message is allowed for source . + Source *string + + noSmithyDocumentSerde +} + +// Use this processor to parse Route 53 vended logs, extract fields, and and +// convert them into a JSON format. This processor always processes the entire log +// event message. For more information about this processor including examples, see +// [parseRoute53]. +// +// If you use this processor, it must be the first processor in your transformer. +// +// [parseRoute53]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseRoute53 +type ParseRoute53 struct { + + // Omit this parameter and the whole log message will be processed by this + // processor. No other value than @message is allowed for source . + Source *string + + noSmithyDocumentSerde +} + +// Use this processor to parse Amazon VPC vended logs, extract fields, and and +// convert them into a JSON format. This processor always processes the entire log +// event message. +// +// This processor doesn't support custom log formats, such as NAT gateway logs. +// For more information about custom log formats in Amazon VPC, see [parseVPC]For more +// information about this processor including examples, see [parseVPC]. +// +// If you use this processor, it must be the first processor in your transformer. +// +// [parseVPC]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseVPC +type ParseVPC struct { + + // Omit this parameter and the whole log message will be processed by this + // processor. No other value than @message is allowed for source . + Source *string + + noSmithyDocumentSerde +} + +// Use this processor to parse WAF vended logs, extract fields, and and convert +// them into a JSON format. This processor always processes the entire log event +// message. For more information about this processor including examples, see [parseWAF]. +// +// For more information about WAF log format, see [Log examples for web ACL traffic]. +// +// If you use this processor, it must be the first processor in your transformer. +// +// [Log examples for web ACL traffic]: https://docs.aws.amazon.com/waf/latest/developerguide/logging-examples.html +// [parseWAF]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parsePostGres +type ParseWAF struct { + + // Omit this parameter and the whole log message will be processed by this + // processor. No other value than @message is allowed for source . + Source *string + + noSmithyDocumentSerde +} + // A structure that contains information about one pattern token related to an // anomaly. // @@ -1011,6 +1539,133 @@ type Policy struct { noSmithyDocumentSerde } +// This structure contains the information about one processor in a log +// transformer. +type Processor struct { + + // Use this parameter to include the [addKeys] processor in your transformer. + // + // [addKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-addKeys + AddKeys *AddKeys + + // Use this parameter to include the [copyValue] processor in your transformer. + // + // [copyValue]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-copyValue + CopyValue *CopyValue + + // Use this parameter to include the [CSV] processor in your transformer. + // + // [CSV]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-CSV + Csv *CSV + + // Use this parameter to include the [datetimeConverter] processor in your transformer. + // + // [datetimeConverter]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-datetimeConverter + DateTimeConverter *DateTimeConverter + + // Use this parameter to include the [deleteKeys] processor in your transformer. + // + // [deleteKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-deleteKeys + DeleteKeys *DeleteKeys + + // Use this parameter to include the [grok] processor in your transformer. + // + // [grok]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-grok + Grok *Grok + + // Use this parameter to include the [listToMap] processor in your transformer. + // + // [listToMap]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-listToMap + ListToMap *ListToMap + + // Use this parameter to include the [lowerCaseString] processor in your transformer. + // + // [lowerCaseString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-lowerCaseString + LowerCaseString *LowerCaseString + + // Use this parameter to include the [moveKeys] processor in your transformer. + // + // [moveKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-moveKeys + MoveKeys *MoveKeys + + // Use this parameter to include the [parseCloudfront] processor in your transformer. + // + // If you use this processor, it must be the first processor in your transformer. + // + // [parseCloudfront]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseCloudfront + ParseCloudfront *ParseCloudfront + + // Use this parameter to include the [parseJSON] processor in your transformer. + // + // [parseJSON]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseJSON + ParseJSON *ParseJSON + + // Use this parameter to include the [parseKeyValue] processor in your transformer. + // + // [parseKeyValue]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseKeyValue + ParseKeyValue *ParseKeyValue + + // Use this parameter to include the [parsePostGres] processor in your transformer. + // + // If you use this processor, it must be the first processor in your transformer. + // + // [parsePostGres]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parsePostGres + ParsePostgres *ParsePostgres + + // Use this parameter to include the [parseRoute53] processor in your transformer. + // + // If you use this processor, it must be the first processor in your transformer. + // + // [parseRoute53]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseRoute53 + ParseRoute53 *ParseRoute53 + + // Use this parameter to include the [parseVPC] processor in your transformer. + // + // If you use this processor, it must be the first processor in your transformer. + // + // [parseVPC]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseVPC + ParseVPC *ParseVPC + + // Use this parameter to include the [parseWAF] processor in your transformer. + // + // If you use this processor, it must be the first processor in your transformer. + // + // [parseWAF]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-parseWAF + ParseWAF *ParseWAF + + // Use this parameter to include the [renameKeys] processor in your transformer. + // + // [renameKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-renameKeys + RenameKeys *RenameKeys + + // Use this parameter to include the [splitString] processor in your transformer. + // + // [splitString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-splitString + SplitString *SplitString + + // Use this parameter to include the [substituteString] processor in your transformer. + // + // [substituteString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-substituteString + SubstituteString *SubstituteString + + // Use this parameter to include the [trimString] processor in your transformer. + // + // [trimString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-trimString + TrimString *TrimString + + // Use this parameter to include the [typeConverter] processor in your transformer. + // + // [typeConverter]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-typeConverter + TypeConverter *TypeConverter + + // Use this parameter to include the [upperCaseString] processor in your transformer. + // + // [upperCaseString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-upperCaseString + UpperCaseString *UpperCaseString + + noSmithyDocumentSerde +} + // Reserved. type QueryCompileError struct { @@ -1086,11 +1741,37 @@ type QueryInfo struct { // Contains the number of log events scanned by the query, the number of log // events that matched the query criteria, and the total number of bytes in the log // events that were scanned. +// +// If the query involved log groups that have field index policies, the estimated +// number of skipped log events and the total bytes of those skipped log events are +// included. Using field indexes to skip log events in queries reduces scan volume +// and improves performance. For more information, see [Create field indexes to improve query performance and reduce scan volume]. +// +// [Create field indexes to improve query performance and reduce scan volume]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatchLogs-Field-Indexing.html type QueryStatistics struct { // The total number of bytes in the log events scanned during the query. BytesScanned float64 + // An estimate of the number of bytes in the log events that were skipped when + // processing this query, because the query contained an indexed field. Skipping + // these entries lowers query costs and improves the query performance time. For + // more information about field indexes, see [PutIndexPolicy]. + // + // [PutIndexPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html + EstimatedBytesSkipped float64 + + // An estimate of the number of log events that were skipped when processing this + // query, because the query contained an indexed field. Skipping these entries + // lowers query costs and improves the query performance time. For more information + // about field indexes, see [PutIndexPolicy]. + // + // [PutIndexPolicy]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutIndexPolicy.html + EstimatedRecordsSkipped float64 + + // The number of log groups that were scanned by this query. + LogGroupsScanned float64 + // The number of log events that matched the query string. RecordsMatched float64 @@ -1120,10 +1801,12 @@ type RecordField struct { noSmithyDocumentSerde } -// Reserved for internal use. +// If an entity is rejected when a PutLogEvents request was made, this includes +// details about the reason for the rejection. type RejectedEntityInfo struct { - // Reserved for internal use. + // The type of error that caused the rejection of the entity when calling + // PutLogEvents . // // This member is required. ErrorType EntityRejectionErrorType @@ -1146,6 +1829,45 @@ type RejectedLogEventsInfo struct { noSmithyDocumentSerde } +// This object defines one key that will be renamed with the [renameKey] processor. +// +// [renameKey]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-renameKey +type RenameKeyEntry struct { + + // The key to rename + // + // This member is required. + Key *string + + // The string to use for the new key name + // + // This member is required. + RenameTo *string + + // Specifies whether to overwrite the existing value if the destination key + // already exists. The default is false + OverwriteIfExists bool + + noSmithyDocumentSerde +} + +// Use this processor to rename keys in a log event. +// +// For more information about this processor including examples, see [renameKeys] in the +// CloudWatch Logs User Guide. +// +// [renameKeys]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-renameKeys +type RenameKeys struct { + + // An array of RenameKeyEntry objects, where each object contains the information + // about a single key to rename. + // + // This member is required. + Entries []RenameKeyEntry + + noSmithyDocumentSerde +} + // A policy enabling one or more entities to put logs to a log group in this // account. type ResourcePolicy struct { @@ -1210,6 +1932,42 @@ type SearchedLogStream struct { noSmithyDocumentSerde } +// Use this processor to split a field into an array of strings using a delimiting +// character. +// +// For more information about this processor including examples, see [splitString] in the +// CloudWatch Logs User Guide. +// +// [splitString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-splitString +type SplitString struct { + + // An array of SplitStringEntry objects, where each object contains the + // information about one field to split. + // + // This member is required. + Entries []SplitStringEntry + + noSmithyDocumentSerde +} + +// This object defines one log field that will be split with the [splitString] processor. +// +// [splitString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-splitString +type SplitStringEntry struct { + + // The separator characters to split the string entry on. + // + // This member is required. + Delimiter *string + + // The key of the field to split. + // + // This member is required. + Source *string + + noSmithyDocumentSerde +} + // This object includes the stream returned by your [StartLiveTail] request. // // The following types satisfy this interface: @@ -1244,6 +2002,15 @@ func (*StartLiveTailResponseStreamMemberSessionUpdate) isStartLiveTailResponseSt // Represents a subscription filter. type SubscriptionFilter struct { + // This parameter is valid only for log groups that have an active log + // transformer. For more information about log transformers, see [PutTransformer]. + // + // If this value is true , the subscription filter is applied on the transformed + // version of the log events instead of the original ingested log events. + // + // [PutTransformer]: https://docs.aws.amazon.com/AmazonCloudWatchLogs/latest/APIReference/API_PutTransformer.html + ApplyOnTransformedLogs bool + // The creation time of the subscription filter, expressed as the number of // milliseconds after Jan 1, 1970 00:00:00 UTC . CreationTime *int64 @@ -1273,6 +2040,52 @@ type SubscriptionFilter struct { noSmithyDocumentSerde } +// This processor matches a key’s value against a regular expression and replaces +// all matches with a replacement string. +// +// For more information about this processor including examples, see [substituteString] in the +// CloudWatch Logs User Guide. +// +// [substituteString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-substituteString +type SubstituteString struct { + + // An array of objects, where each object contains the information about one key + // to match and replace. + // + // This member is required. + Entries []SubstituteStringEntry + + noSmithyDocumentSerde +} + +// This object defines one log field key that will be replaced using the [substituteString] +// processor. +// +// [substituteString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-substituteString +type SubstituteStringEntry struct { + + // The regular expression string to be replaced. Special regex characters such as + // [ and ] must be escaped using \\ when using double quotes and with \ when using + // single quotes. For more information, see [Class Pattern]on the Oracle web site. + // + // [Class Pattern]: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/regex/Pattern.html + // + // This member is required. + From *string + + // The key to modify + // + // This member is required. + Source *string + + // The string to be substituted for each match of from + // + // This member is required. + To *string + + noSmithyDocumentSerde +} + // If you are suppressing an anomaly temporariliy, this structure defines how long // the suppression period is to be. type SuppressionPeriod struct { @@ -1287,6 +2100,93 @@ type SuppressionPeriod struct { noSmithyDocumentSerde } +// This structure contains information for one log event that has been processed +// by a log transformer. +type TransformedLogRecord struct { + + // The original log event message before it was transformed. + EventMessage *string + + // The event number. + EventNumber int64 + + // The log event message after being transformed. + TransformedEventMessage *string + + noSmithyDocumentSerde +} + +// Use this processor to remove leading and trailing whitespace. +// +// For more information about this processor including examples, see [trimString] in the +// CloudWatch Logs User Guide. +// +// [trimString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-trimString +type TrimString struct { + + // The array containing the keys of the fields to trim. + // + // This member is required. + WithKeys []string + + noSmithyDocumentSerde +} + +// Use this processor to convert a value type associated with the specified key to +// the specified type. It's a casting processor that changes the types of the +// specified fields. Values can be converted into one of the following datatypes: +// integer , double , string and boolean . +// +// For more information about this processor including examples, see [trimString] in the +// CloudWatch Logs User Guide. +// +// [trimString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-trimString +type TypeConverter struct { + + // An array of TypeConverterEntry objects, where each object contains the + // information about one field to change the type of. + // + // This member is required. + Entries []TypeConverterEntry + + noSmithyDocumentSerde +} + +// This object defines one value type that will be converted using the [typeConverter] processor. +// +// [typeConverter]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-typeConverter +type TypeConverterEntry struct { + + // The key with the value that is to be converted to a different type. + // + // This member is required. + Key *string + + // The type to convert the field value to. Valid values are integer , double , + // string and boolean . + // + // This member is required. + Type Type + + noSmithyDocumentSerde +} + +// This processor converts a string field to uppercase. +// +// For more information about this processor including examples, see [upperCaseString] in the +// CloudWatch Logs User Guide. +// +// [upperCaseString]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/logs/CloudWatch-Logs-Transformation.html#CloudWatch-Logs-Transformation-upperCaseString +type UpperCaseString struct { + + // The array of containing the keys of the field to convert to uppercase. + // + // This member is required. + WithKeys []string + + noSmithyDocumentSerde +} + type noSmithyDocumentSerde = smithydocument.NoSerde // UnknownUnionMember is returned when a union member is returned over the wire, diff --git a/service/cloudwatchlogs/validators.go b/service/cloudwatchlogs/validators.go index 788d040d01c..37df2b2a1c4 100644 --- a/service/cloudwatchlogs/validators.go +++ b/service/cloudwatchlogs/validators.go @@ -290,6 +290,26 @@ func (m *validateOpDeleteDestination) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpDeleteIndexPolicy struct { +} + +func (*validateOpDeleteIndexPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteIndexPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteIndexPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteIndexPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteLogAnomalyDetector struct { } @@ -430,6 +450,26 @@ func (m *validateOpDeleteSubscriptionFilter) HandleInitialize(ctx context.Contex return next.HandleInitialize(ctx, in) } +type validateOpDeleteTransformer struct { +} + +func (*validateOpDeleteTransformer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteTransformer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteTransformerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteTransformerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeAccountPolicies struct { } @@ -450,6 +490,46 @@ func (m *validateOpDescribeAccountPolicies) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpDescribeFieldIndexes struct { +} + +func (*validateOpDescribeFieldIndexes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeFieldIndexes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeFieldIndexesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeFieldIndexesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDescribeIndexPolicies struct { +} + +func (*validateOpDescribeIndexPolicies) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeIndexPolicies) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeIndexPoliciesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeIndexPoliciesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeSubscriptionFilters struct { } @@ -650,6 +730,46 @@ func (m *validateOpGetQueryResults) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpGetTransformer struct { +} + +func (*validateOpGetTransformer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetTransformer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetTransformerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetTransformerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListLogGroupsForQuery struct { +} + +func (*validateOpListLogGroupsForQuery) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListLogGroupsForQuery) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListLogGroupsForQueryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListLogGroupsForQueryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -830,6 +950,26 @@ func (m *validateOpPutDestinationPolicy) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpPutIndexPolicy struct { +} + +func (*validateOpPutIndexPolicy) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutIndexPolicy) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutIndexPolicyInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutIndexPolicyInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPutLogEvents struct { } @@ -930,6 +1070,26 @@ func (m *validateOpPutSubscriptionFilter) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpPutTransformer struct { +} + +func (*validateOpPutTransformer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPutTransformer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PutTransformerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPutTransformerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartLiveTail struct { } @@ -1050,6 +1210,26 @@ func (m *validateOpTestMetricFilter) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpTestTransformer struct { +} + +func (*validateOpTestTransformer) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTestTransformer) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TestTransformerInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTestTransformerInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUntagLogGroup struct { } @@ -1206,6 +1386,10 @@ func addOpDeleteDestinationValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteDestination{}, middleware.After) } +func addOpDeleteIndexPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteIndexPolicy{}, middleware.After) +} + func addOpDeleteLogAnomalyDetectorValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteLogAnomalyDetector{}, middleware.After) } @@ -1234,10 +1418,22 @@ func addOpDeleteSubscriptionFilterValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDeleteSubscriptionFilter{}, middleware.After) } +func addOpDeleteTransformerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteTransformer{}, middleware.After) +} + func addOpDescribeAccountPoliciesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeAccountPolicies{}, middleware.After) } +func addOpDescribeFieldIndexesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeFieldIndexes{}, middleware.After) +} + +func addOpDescribeIndexPoliciesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeIndexPolicies{}, middleware.After) +} + func addOpDescribeSubscriptionFiltersValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeSubscriptionFilters{}, middleware.After) } @@ -1278,6 +1474,14 @@ func addOpGetQueryResultsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetQueryResults{}, middleware.After) } +func addOpGetTransformerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetTransformer{}, middleware.After) +} + +func addOpListLogGroupsForQueryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListLogGroupsForQuery{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -1314,6 +1518,10 @@ func addOpPutDestinationPolicyValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpPutDestinationPolicy{}, middleware.After) } +func addOpPutIndexPolicyValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutIndexPolicy{}, middleware.After) +} + func addOpPutLogEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutLogEvents{}, middleware.After) } @@ -1334,6 +1542,10 @@ func addOpPutSubscriptionFilterValidationMiddleware(stack *middleware.Stack) err return stack.Initialize.Add(&validateOpPutSubscriptionFilter{}, middleware.After) } +func addOpPutTransformerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPutTransformer{}, middleware.After) +} + func addOpStartLiveTailValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartLiveTail{}, middleware.After) } @@ -1358,6 +1570,10 @@ func addOpTestMetricFilterValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTestMetricFilter{}, middleware.After) } +func addOpTestTransformerValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTestTransformer{}, middleware.After) +} + func addOpUntagLogGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagLogGroup{}, middleware.After) } @@ -1378,13 +1594,15 @@ func addOpUpdateLogAnomalyDetectorValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpUpdateLogAnomalyDetector{}, middleware.After) } -func validateDeliveryDestinationConfiguration(v *types.DeliveryDestinationConfiguration) error { +func validateAddKeyEntries(v []types.AddKeyEntry) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "DeliveryDestinationConfiguration"} - if v.DestinationResourceArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("DestinationResourceArn")) + invalidParams := smithy.InvalidParamsError{Context: "AddKeyEntries"} + for i := range v { + if err := validateAddKeyEntry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1393,16 +1611,16 @@ func validateDeliveryDestinationConfiguration(v *types.DeliveryDestinationConfig } } -func validateInputLogEvent(v *types.InputLogEvent) error { +func validateAddKeyEntry(v *types.AddKeyEntry) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "InputLogEvent"} - if v.Timestamp == nil { - invalidParams.Add(smithy.NewErrParamRequired("Timestamp")) + invalidParams := smithy.InvalidParamsError{Context: "AddKeyEntry"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) } - if v.Message == nil { - invalidParams.Add(smithy.NewErrParamRequired("Message")) + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) } if invalidParams.Len() > 0 { return invalidParams @@ -1411,14 +1629,16 @@ func validateInputLogEvent(v *types.InputLogEvent) error { } } -func validateInputLogEvents(v []types.InputLogEvent) error { +func validateAddKeys(v *types.AddKeys) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "InputLogEvents"} - for i := range v { - if err := validateInputLogEvent(&v[i]); err != nil { - invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + invalidParams := smithy.InvalidParamsError{Context: "AddKeys"} + if v.Entries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Entries")) + } else if v.Entries != nil { + if err := validateAddKeyEntries(v.Entries); err != nil { + invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) } } if invalidParams.Len() > 0 { @@ -1428,19 +1648,17 @@ func validateInputLogEvents(v []types.InputLogEvent) error { } } -func validateMetricTransformation(v *types.MetricTransformation) error { +func validateCopyValue(v *types.CopyValue) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "MetricTransformation"} - if v.MetricName == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetricName")) - } - if v.MetricNamespace == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetricNamespace")) - } - if v.MetricValue == nil { - invalidParams.Add(smithy.NewErrParamRequired("MetricValue")) + invalidParams := smithy.InvalidParamsError{Context: "CopyValue"} + if v.Entries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Entries")) + } else if v.Entries != nil { + if err := validateCopyValueEntries(v.Entries); err != nil { + invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1449,13 +1667,13 @@ func validateMetricTransformation(v *types.MetricTransformation) error { } } -func validateMetricTransformations(v []types.MetricTransformation) error { +func validateCopyValueEntries(v []types.CopyValueEntry) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "MetricTransformations"} + invalidParams := smithy.InvalidParamsError{Context: "CopyValueEntries"} for i := range v { - if err := validateMetricTransformation(&v[i]); err != nil { + if err := validateCopyValueEntry(&v[i]); err != nil { invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) } } @@ -1466,13 +1684,16 @@ func validateMetricTransformations(v []types.MetricTransformation) error { } } -func validateOpAssociateKmsKeyInput(v *AssociateKmsKeyInput) error { +func validateCopyValueEntry(v *types.CopyValueEntry) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "AssociateKmsKeyInput"} - if v.KmsKeyId == nil { - invalidParams.Add(smithy.NewErrParamRequired("KmsKeyId")) + invalidParams := smithy.InvalidParamsError{Context: "CopyValueEntry"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) } if invalidParams.Len() > 0 { return invalidParams @@ -1481,13 +1702,19 @@ func validateOpAssociateKmsKeyInput(v *AssociateKmsKeyInput) error { } } -func validateOpCancelExportTaskInput(v *CancelExportTaskInput) error { +func validateDateTimeConverter(v *types.DateTimeConverter) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "CancelExportTaskInput"} - if v.TaskId == nil { - invalidParams.Add(smithy.NewErrParamRequired("TaskId")) + invalidParams := smithy.InvalidParamsError{Context: "DateTimeConverter"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } + if v.MatchPatterns == nil { + invalidParams.Add(smithy.NewErrParamRequired("MatchPatterns")) } if invalidParams.Len() > 0 { return invalidParams @@ -1496,16 +1723,13 @@ func validateOpCancelExportTaskInput(v *CancelExportTaskInput) error { } } -func validateOpCreateDeliveryInput(v *CreateDeliveryInput) error { +func validateDeleteKeys(v *types.DeleteKeys) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "CreateDeliveryInput"} - if v.DeliverySourceName == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeliverySourceName")) - } - if v.DeliveryDestinationArn == nil { - invalidParams.Add(smithy.NewErrParamRequired("DeliveryDestinationArn")) + invalidParams := smithy.InvalidParamsError{Context: "DeleteKeys"} + if v.WithKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("WithKeys")) } if invalidParams.Len() > 0 { return invalidParams @@ -1514,22 +1738,13 @@ func validateOpCreateDeliveryInput(v *CreateDeliveryInput) error { } } -func validateOpCreateExportTaskInput(v *CreateExportTaskInput) error { +func validateDeliveryDestinationConfiguration(v *types.DeliveryDestinationConfiguration) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "CreateExportTaskInput"} - if v.LogGroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("LogGroupName")) - } - if v.From == nil { - invalidParams.Add(smithy.NewErrParamRequired("From")) - } - if v.To == nil { - invalidParams.Add(smithy.NewErrParamRequired("To")) - } - if v.Destination == nil { - invalidParams.Add(smithy.NewErrParamRequired("Destination")) + invalidParams := smithy.InvalidParamsError{Context: "DeliveryDestinationConfiguration"} + if v.DestinationResourceArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DestinationResourceArn")) } if invalidParams.Len() > 0 { return invalidParams @@ -1538,13 +1753,13 @@ func validateOpCreateExportTaskInput(v *CreateExportTaskInput) error { } } -func validateOpCreateLogAnomalyDetectorInput(v *CreateLogAnomalyDetectorInput) error { +func validateGrok(v *types.Grok) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "CreateLogAnomalyDetectorInput"} - if v.LogGroupArnList == nil { - invalidParams.Add(smithy.NewErrParamRequired("LogGroupArnList")) + invalidParams := smithy.InvalidParamsError{Context: "Grok"} + if v.Match == nil { + invalidParams.Add(smithy.NewErrParamRequired("Match")) } if invalidParams.Len() > 0 { return invalidParams @@ -1553,13 +1768,16 @@ func validateOpCreateLogAnomalyDetectorInput(v *CreateLogAnomalyDetectorInput) e } } -func validateOpCreateLogGroupInput(v *CreateLogGroupInput) error { +func validateInputLogEvent(v *types.InputLogEvent) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "CreateLogGroupInput"} - if v.LogGroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("LogGroupName")) + invalidParams := smithy.InvalidParamsError{Context: "InputLogEvent"} + if v.Timestamp == nil { + invalidParams.Add(smithy.NewErrParamRequired("Timestamp")) + } + if v.Message == nil { + invalidParams.Add(smithy.NewErrParamRequired("Message")) } if invalidParams.Len() > 0 { return invalidParams @@ -1568,16 +1786,15 @@ func validateOpCreateLogGroupInput(v *CreateLogGroupInput) error { } } -func validateOpCreateLogStreamInput(v *CreateLogStreamInput) error { +func validateInputLogEvents(v []types.InputLogEvent) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "CreateLogStreamInput"} - if v.LogGroupName == nil { - invalidParams.Add(smithy.NewErrParamRequired("LogGroupName")) - } - if v.LogStreamName == nil { - invalidParams.Add(smithy.NewErrParamRequired("LogStreamName")) + invalidParams := smithy.InvalidParamsError{Context: "InputLogEvents"} + for i := range v { + if err := validateInputLogEvent(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } } if invalidParams.Len() > 0 { return invalidParams @@ -1586,16 +1803,16 @@ func validateOpCreateLogStreamInput(v *CreateLogStreamInput) error { } } -func validateOpDeleteAccountPolicyInput(v *DeleteAccountPolicyInput) error { +func validateListToMap(v *types.ListToMap) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "DeleteAccountPolicyInput"} - if v.PolicyName == nil { - invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + invalidParams := smithy.InvalidParamsError{Context: "ListToMap"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) } - if len(v.PolicyType) == 0 { - invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) } if invalidParams.Len() > 0 { return invalidParams @@ -1604,11 +1821,604 @@ func validateOpDeleteAccountPolicyInput(v *DeleteAccountPolicyInput) error { } } -func validateOpDeleteDataProtectionPolicyInput(v *DeleteDataProtectionPolicyInput) error { +func validateLowerCaseString(v *types.LowerCaseString) error { if v == nil { return nil } - invalidParams := smithy.InvalidParamsError{Context: "DeleteDataProtectionPolicyInput"} + invalidParams := smithy.InvalidParamsError{Context: "LowerCaseString"} + if v.WithKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("WithKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMetricTransformation(v *types.MetricTransformation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MetricTransformation"} + if v.MetricName == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricName")) + } + if v.MetricNamespace == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricNamespace")) + } + if v.MetricValue == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricValue")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMetricTransformations(v []types.MetricTransformation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MetricTransformations"} + for i := range v { + if err := validateMetricTransformation(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMoveKeyEntries(v []types.MoveKeyEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MoveKeyEntries"} + for i := range v { + if err := validateMoveKeyEntry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMoveKeyEntry(v *types.MoveKeyEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MoveKeyEntry"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Target == nil { + invalidParams.Add(smithy.NewErrParamRequired("Target")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateMoveKeys(v *types.MoveKeys) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MoveKeys"} + if v.Entries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Entries")) + } else if v.Entries != nil { + if err := validateMoveKeyEntries(v.Entries); err != nil { + invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateProcessor(v *types.Processor) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Processor"} + if v.AddKeys != nil { + if err := validateAddKeys(v.AddKeys); err != nil { + invalidParams.AddNested("AddKeys", err.(smithy.InvalidParamsError)) + } + } + if v.CopyValue != nil { + if err := validateCopyValue(v.CopyValue); err != nil { + invalidParams.AddNested("CopyValue", err.(smithy.InvalidParamsError)) + } + } + if v.DateTimeConverter != nil { + if err := validateDateTimeConverter(v.DateTimeConverter); err != nil { + invalidParams.AddNested("DateTimeConverter", err.(smithy.InvalidParamsError)) + } + } + if v.DeleteKeys != nil { + if err := validateDeleteKeys(v.DeleteKeys); err != nil { + invalidParams.AddNested("DeleteKeys", err.(smithy.InvalidParamsError)) + } + } + if v.Grok != nil { + if err := validateGrok(v.Grok); err != nil { + invalidParams.AddNested("Grok", err.(smithy.InvalidParamsError)) + } + } + if v.ListToMap != nil { + if err := validateListToMap(v.ListToMap); err != nil { + invalidParams.AddNested("ListToMap", err.(smithy.InvalidParamsError)) + } + } + if v.LowerCaseString != nil { + if err := validateLowerCaseString(v.LowerCaseString); err != nil { + invalidParams.AddNested("LowerCaseString", err.(smithy.InvalidParamsError)) + } + } + if v.MoveKeys != nil { + if err := validateMoveKeys(v.MoveKeys); err != nil { + invalidParams.AddNested("MoveKeys", err.(smithy.InvalidParamsError)) + } + } + if v.RenameKeys != nil { + if err := validateRenameKeys(v.RenameKeys); err != nil { + invalidParams.AddNested("RenameKeys", err.(smithy.InvalidParamsError)) + } + } + if v.SplitString != nil { + if err := validateSplitString(v.SplitString); err != nil { + invalidParams.AddNested("SplitString", err.(smithy.InvalidParamsError)) + } + } + if v.SubstituteString != nil { + if err := validateSubstituteString(v.SubstituteString); err != nil { + invalidParams.AddNested("SubstituteString", err.(smithy.InvalidParamsError)) + } + } + if v.TrimString != nil { + if err := validateTrimString(v.TrimString); err != nil { + invalidParams.AddNested("TrimString", err.(smithy.InvalidParamsError)) + } + } + if v.TypeConverter != nil { + if err := validateTypeConverter(v.TypeConverter); err != nil { + invalidParams.AddNested("TypeConverter", err.(smithy.InvalidParamsError)) + } + } + if v.UpperCaseString != nil { + if err := validateUpperCaseString(v.UpperCaseString); err != nil { + invalidParams.AddNested("UpperCaseString", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateProcessors(v []types.Processor) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Processors"} + for i := range v { + if err := validateProcessor(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRenameKeyEntries(v []types.RenameKeyEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RenameKeyEntries"} + for i := range v { + if err := validateRenameKeyEntry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRenameKeyEntry(v *types.RenameKeyEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RenameKeyEntry"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.RenameTo == nil { + invalidParams.Add(smithy.NewErrParamRequired("RenameTo")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateRenameKeys(v *types.RenameKeys) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RenameKeys"} + if v.Entries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Entries")) + } else if v.Entries != nil { + if err := validateRenameKeyEntries(v.Entries); err != nil { + invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSplitString(v *types.SplitString) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SplitString"} + if v.Entries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Entries")) + } else if v.Entries != nil { + if err := validateSplitStringEntries(v.Entries); err != nil { + invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSplitStringEntries(v []types.SplitStringEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SplitStringEntries"} + for i := range v { + if err := validateSplitStringEntry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSplitStringEntry(v *types.SplitStringEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SplitStringEntry"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.Delimiter == nil { + invalidParams.Add(smithy.NewErrParamRequired("Delimiter")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSubstituteString(v *types.SubstituteString) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SubstituteString"} + if v.Entries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Entries")) + } else if v.Entries != nil { + if err := validateSubstituteStringEntries(v.Entries); err != nil { + invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSubstituteStringEntries(v []types.SubstituteStringEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SubstituteStringEntries"} + for i := range v { + if err := validateSubstituteStringEntry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSubstituteStringEntry(v *types.SubstituteStringEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SubstituteStringEntry"} + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.From == nil { + invalidParams.Add(smithy.NewErrParamRequired("From")) + } + if v.To == nil { + invalidParams.Add(smithy.NewErrParamRequired("To")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTrimString(v *types.TrimString) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TrimString"} + if v.WithKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("WithKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTypeConverter(v *types.TypeConverter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TypeConverter"} + if v.Entries == nil { + invalidParams.Add(smithy.NewErrParamRequired("Entries")) + } else if v.Entries != nil { + if err := validateTypeConverterEntries(v.Entries); err != nil { + invalidParams.AddNested("Entries", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTypeConverterEntries(v []types.TypeConverterEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TypeConverterEntries"} + for i := range v { + if err := validateTypeConverterEntry(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTypeConverterEntry(v *types.TypeConverterEntry) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TypeConverterEntry"} + if v.Key == nil { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if len(v.Type) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Type")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateUpperCaseString(v *types.UpperCaseString) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpperCaseString"} + if v.WithKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("WithKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpAssociateKmsKeyInput(v *AssociateKmsKeyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateKmsKeyInput"} + if v.KmsKeyId == nil { + invalidParams.Add(smithy.NewErrParamRequired("KmsKeyId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCancelExportTaskInput(v *CancelExportTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelExportTaskInput"} + if v.TaskId == nil { + invalidParams.Add(smithy.NewErrParamRequired("TaskId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateDeliveryInput(v *CreateDeliveryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateDeliveryInput"} + if v.DeliverySourceName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliverySourceName")) + } + if v.DeliveryDestinationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("DeliveryDestinationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateExportTaskInput(v *CreateExportTaskInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateExportTaskInput"} + if v.LogGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupName")) + } + if v.From == nil { + invalidParams.Add(smithy.NewErrParamRequired("From")) + } + if v.To == nil { + invalidParams.Add(smithy.NewErrParamRequired("To")) + } + if v.Destination == nil { + invalidParams.Add(smithy.NewErrParamRequired("Destination")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateLogAnomalyDetectorInput(v *CreateLogAnomalyDetectorInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLogAnomalyDetectorInput"} + if v.LogGroupArnList == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupArnList")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateLogGroupInput(v *CreateLogGroupInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLogGroupInput"} + if v.LogGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateLogStreamInput(v *CreateLogStreamInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateLogStreamInput"} + if v.LogGroupName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupName")) + } + if v.LogStreamName == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogStreamName")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteAccountPolicyInput(v *DeleteAccountPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteAccountPolicyInput"} + if v.PolicyName == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyName")) + } + if len(v.PolicyType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("PolicyType")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteDataProtectionPolicyInput(v *DeleteDataProtectionPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteDataProtectionPolicyInput"} if v.LogGroupIdentifier == nil { invalidParams.Add(smithy.NewErrParamRequired("LogGroupIdentifier")) } @@ -1694,6 +2504,21 @@ func validateOpDeleteDestinationInput(v *DeleteDestinationInput) error { } } +func validateOpDeleteIndexPolicyInput(v *DeleteIndexPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteIndexPolicyInput"} + if v.LogGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteLogAnomalyDetectorInput(v *DeleteLogAnomalyDetectorInput) error { if v == nil { return nil @@ -1808,6 +2633,21 @@ func validateOpDeleteSubscriptionFilterInput(v *DeleteSubscriptionFilterInput) e } } +func validateOpDeleteTransformerInput(v *DeleteTransformerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteTransformerInput"} + if v.LogGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeAccountPoliciesInput(v *DescribeAccountPoliciesInput) error { if v == nil { return nil @@ -1823,6 +2663,36 @@ func validateOpDescribeAccountPoliciesInput(v *DescribeAccountPoliciesInput) err } } +func validateOpDescribeFieldIndexesInput(v *DescribeFieldIndexesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeFieldIndexesInput"} + if v.LogGroupIdentifiers == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupIdentifiers")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDescribeIndexPoliciesInput(v *DescribeIndexPoliciesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeIndexPoliciesInput"} + if v.LogGroupIdentifiers == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupIdentifiers")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeSubscriptionFiltersInput(v *DescribeSubscriptionFiltersInput) error { if v == nil { return nil @@ -1973,6 +2843,36 @@ func validateOpGetQueryResultsInput(v *GetQueryResultsInput) error { } } +func validateOpGetTransformerInput(v *GetTransformerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetTransformerInput"} + if v.LogGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupIdentifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListLogGroupsForQueryInput(v *ListLogGroupsForQueryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListLogGroupsForQueryInput"} + if v.QueryId == nil { + invalidParams.Add(smithy.NewErrParamRequired("QueryId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -2142,6 +3042,24 @@ func validateOpPutDestinationPolicyInput(v *PutDestinationPolicyInput) error { } } +func validateOpPutIndexPolicyInput(v *PutIndexPolicyInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutIndexPolicyInput"} + if v.LogGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupIdentifier")) + } + if v.PolicyDocument == nil { + invalidParams.Add(smithy.NewErrParamRequired("PolicyDocument")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPutLogEventsInput(v *PutLogEventsInput) error { if v == nil { return nil @@ -2255,6 +3173,28 @@ func validateOpPutSubscriptionFilterInput(v *PutSubscriptionFilterInput) error { } } +func validateOpPutTransformerInput(v *PutTransformerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PutTransformerInput"} + if v.LogGroupIdentifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogGroupIdentifier")) + } + if v.TransformerConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("TransformerConfig")) + } else if v.TransformerConfig != nil { + if err := validateProcessors(v.TransformerConfig); err != nil { + invalidParams.AddNested("TransformerConfig", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartLiveTailInput(v *StartLiveTailInput) error { if v == nil { return nil @@ -2360,6 +3300,28 @@ func validateOpTestMetricFilterInput(v *TestMetricFilterInput) error { } } +func validateOpTestTransformerInput(v *TestTransformerInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TestTransformerInput"} + if v.TransformerConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("TransformerConfig")) + } else if v.TransformerConfig != nil { + if err := validateProcessors(v.TransformerConfig); err != nil { + invalidParams.AddNested("TransformerConfig", err.(smithy.InvalidParamsError)) + } + } + if v.LogEventMessages == nil { + invalidParams.Add(smithy.NewErrParamRequired("LogEventMessages")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUntagLogGroupInput(v *UntagLogGroupInput) error { if v == nil { return nil diff --git a/service/costexplorer/api_op_GetCommitmentPurchaseAnalysis.go b/service/costexplorer/api_op_GetCommitmentPurchaseAnalysis.go new file mode 100644 index 00000000000..a233d4a7962 --- /dev/null +++ b/service/costexplorer/api_op_GetCommitmentPurchaseAnalysis.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costexplorer + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a commitment purchase analysis result based on the AnalysisId . +func (c *Client) GetCommitmentPurchaseAnalysis(ctx context.Context, params *GetCommitmentPurchaseAnalysisInput, optFns ...func(*Options)) (*GetCommitmentPurchaseAnalysisOutput, error) { + if params == nil { + params = &GetCommitmentPurchaseAnalysisInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCommitmentPurchaseAnalysis", params, optFns, c.addOperationGetCommitmentPurchaseAnalysisMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCommitmentPurchaseAnalysisOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCommitmentPurchaseAnalysisInput struct { + + // The analysis ID that's associated with the commitment purchase analysis. + // + // This member is required. + AnalysisId *string + + noSmithyDocumentSerde +} + +type GetCommitmentPurchaseAnalysisOutput struct { + + // The analysis ID that's associated with the commitment purchase analysis. + // + // This member is required. + AnalysisId *string + + // The start time of the analysis. + // + // This member is required. + AnalysisStartedTime *string + + // The status of the analysis. + // + // This member is required. + AnalysisStatus types.AnalysisStatus + + // The configuration for the commitment purchase analysis. + // + // This member is required. + CommitmentPurchaseAnalysisConfiguration *types.CommitmentPurchaseAnalysisConfiguration + + // The estimated time for when the analysis will complete. + // + // This member is required. + EstimatedCompletionTime *string + + // The completion time of the analysis. + AnalysisCompletionTime *string + + // Details about the analysis. + AnalysisDetails *types.AnalysisDetails + + // The error code used for the analysis. + ErrorCode types.ErrorCode + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCommitmentPurchaseAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetCommitmentPurchaseAnalysis{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetCommitmentPurchaseAnalysis{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCommitmentPurchaseAnalysis"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetCommitmentPurchaseAnalysisValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCommitmentPurchaseAnalysis(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCommitmentPurchaseAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCommitmentPurchaseAnalysis", + } +} diff --git a/service/costexplorer/api_op_GetDimensionValues.go b/service/costexplorer/api_op_GetDimensionValues.go index 7485ee8a828..fd41c5b8511 100644 --- a/service/costexplorer/api_op_GetDimensionValues.go +++ b/service/costexplorer/api_op_GetDimensionValues.go @@ -62,10 +62,10 @@ type GetDimensionValuesInput struct { // Possible values are the following: // // - Amazon Web Services(Amazon Web Services): The entity that sells Amazon Web - // Servicesservices. + // Services services. // // - AISPL (Amazon Internet Services Pvt. Ltd.): The local Indian entity that's an - // acting reseller for Amazon Web Servicesservices in India. + // acting reseller for Amazon Web Services services in India. // // - Amazon Web Services Marketplace: The entity that supports the sale of // solutions that are built on Amazon Web Services by third-party software diff --git a/service/costexplorer/api_op_GetReservationUtilization.go b/service/costexplorer/api_op_GetReservationUtilization.go index afd35184b8b..c6eb56b9e0c 100644 --- a/service/costexplorer/api_op_GetReservationUtilization.go +++ b/service/costexplorer/api_op_GetReservationUtilization.go @@ -62,6 +62,12 @@ type GetReservationUtilizationInput struct { // // - SERVICE // + // If not specified, the SERVICE filter defaults to Amazon Elastic Compute Cloud - + // Compute. Supported values for SERVICE are Amazon Elastic Compute Cloud - + // Compute, Amazon Relational Database Service, Amazon ElastiCache, Amazon + // Redshift, and Amazon Elasticsearch Service. The value for the SERVICE filter + // should not exceed "1". + // // - SCOPE // // - TENANCY diff --git a/service/costexplorer/api_op_ListCommitmentPurchaseAnalyses.go b/service/costexplorer/api_op_ListCommitmentPurchaseAnalyses.go new file mode 100644 index 00000000000..336a120cbdd --- /dev/null +++ b/service/costexplorer/api_op_ListCommitmentPurchaseAnalyses.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costexplorer + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the commitment purchase analyses for your account based on the last 30 +// days. +func (c *Client) ListCommitmentPurchaseAnalyses(ctx context.Context, params *ListCommitmentPurchaseAnalysesInput, optFns ...func(*Options)) (*ListCommitmentPurchaseAnalysesOutput, error) { + if params == nil { + params = &ListCommitmentPurchaseAnalysesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCommitmentPurchaseAnalyses", params, optFns, c.addOperationListCommitmentPurchaseAnalysesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCommitmentPurchaseAnalysesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCommitmentPurchaseAnalysesInput struct { + + // The analysis IDs associated with the commitment purchase analyses. + AnalysisIds []string + + // The status of the analysis. + AnalysisStatus types.AnalysisStatus + + // The token to retrieve the next set of results. + NextPageToken *string + + // The number of analyses that you want returned in a single response object. + PageSize int32 + + noSmithyDocumentSerde +} + +type ListCommitmentPurchaseAnalysesOutput struct { + + // The list of analyses. + AnalysisSummaryList []types.AnalysisSummary + + // The token to retrieve the next set of results. + NextPageToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCommitmentPurchaseAnalysesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListCommitmentPurchaseAnalyses{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListCommitmentPurchaseAnalyses{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCommitmentPurchaseAnalyses"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCommitmentPurchaseAnalyses(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListCommitmentPurchaseAnalyses(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCommitmentPurchaseAnalyses", + } +} diff --git a/service/costexplorer/api_op_StartCommitmentPurchaseAnalysis.go b/service/costexplorer/api_op_StartCommitmentPurchaseAnalysis.go new file mode 100644 index 00000000000..0d531e5ba74 --- /dev/null +++ b/service/costexplorer/api_op_StartCommitmentPurchaseAnalysis.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package costexplorer + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/costexplorer/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Specifies the parameters of a planned commitment purchase and starts the +// generation of the analysis. This enables you to estimate the cost, coverage, and +// utilization impact of your planned commitment purchases. You can request up to +// 20 analysis runs per day. +func (c *Client) StartCommitmentPurchaseAnalysis(ctx context.Context, params *StartCommitmentPurchaseAnalysisInput, optFns ...func(*Options)) (*StartCommitmentPurchaseAnalysisOutput, error) { + if params == nil { + params = &StartCommitmentPurchaseAnalysisInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartCommitmentPurchaseAnalysis", params, optFns, c.addOperationStartCommitmentPurchaseAnalysisMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartCommitmentPurchaseAnalysisOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartCommitmentPurchaseAnalysisInput struct { + + // The configuration for the commitment purchase analysis. + // + // This member is required. + CommitmentPurchaseAnalysisConfiguration *types.CommitmentPurchaseAnalysisConfiguration + + noSmithyDocumentSerde +} + +type StartCommitmentPurchaseAnalysisOutput struct { + + // The analysis ID that's associated with the commitment purchase analysis. + // + // This member is required. + AnalysisId *string + + // The start time of the analysis. + // + // This member is required. + AnalysisStartedTime *string + + // The estimated time for when the analysis will complete. + // + // This member is required. + EstimatedCompletionTime *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartCommitmentPurchaseAnalysisMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartCommitmentPurchaseAnalysis{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartCommitmentPurchaseAnalysis{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartCommitmentPurchaseAnalysis"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartCommitmentPurchaseAnalysisValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCommitmentPurchaseAnalysis(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartCommitmentPurchaseAnalysis(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartCommitmentPurchaseAnalysis", + } +} diff --git a/service/costexplorer/deserializers.go b/service/costexplorer/deserializers.go index 60399602b68..af49fc37e95 100644 --- a/service/costexplorer/deserializers.go +++ b/service/costexplorer/deserializers.go @@ -1287,6 +1287,123 @@ func awsAwsjson11_deserializeOpErrorGetApproximateUsageRecords(response *smithyh } } +type awsAwsjson11_deserializeOpGetCommitmentPurchaseAnalysis struct { +} + +func (*awsAwsjson11_deserializeOpGetCommitmentPurchaseAnalysis) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetCommitmentPurchaseAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetCommitmentPurchaseAnalysis(response, &metadata) + } + output := &GetCommitmentPurchaseAnalysisOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetCommitmentPurchaseAnalysisOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetCommitmentPurchaseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AnalysisNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorAnalysisNotFoundException(response, errorBody) + + case strings.EqualFold("DataUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpGetCostAndUsage struct { } @@ -3174,14 +3291,14 @@ func awsAwsjson11_deserializeOpErrorGetUsageForecast(response *smithyhttp.Respon } } -type awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory struct { +type awsAwsjson11_deserializeOpListCommitmentPurchaseAnalyses struct { } -func (*awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) ID() string { +func (*awsAwsjson11_deserializeOpListCommitmentPurchaseAnalyses) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCommitmentPurchaseAnalyses) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3199,9 +3316,9 @@ func (m *awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCommitmentPurchaseAnalyses(response, &metadata) } - output := &ListCostAllocationTagBackfillHistoryOutput{} + output := &ListCommitmentPurchaseAnalysesOutput{} out.Result = output var buff [1024]byte @@ -3221,7 +3338,7 @@ func (m *awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) HandleD return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListCostAllocationTagBackfillHistoryOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCommitmentPurchaseAnalysesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3235,7 +3352,7 @@ func (m *awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) HandleD return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCommitmentPurchaseAnalyses(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3272,6 +3389,9 @@ func awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(respons errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("DataUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) + case strings.EqualFold("InvalidNextTokenException", errorCode): return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) @@ -3288,14 +3408,14 @@ func awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(respons } } -type awsAwsjson11_deserializeOpListCostAllocationTags struct { +type awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory struct { } -func (*awsAwsjson11_deserializeOpListCostAllocationTags) ID() string { +func (*awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListCostAllocationTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCostAllocationTagBackfillHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3313,9 +3433,9 @@ func (m *awsAwsjson11_deserializeOpListCostAllocationTags) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCostAllocationTags(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(response, &metadata) } - output := &ListCostAllocationTagsOutput{} + output := &ListCostAllocationTagBackfillHistoryOutput{} out.Result = output var buff [1024]byte @@ -3335,7 +3455,7 @@ func (m *awsAwsjson11_deserializeOpListCostAllocationTags) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListCostAllocationTagsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCostAllocationTagBackfillHistoryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3349,7 +3469,7 @@ func (m *awsAwsjson11_deserializeOpListCostAllocationTags) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListCostAllocationTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCostAllocationTagBackfillHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3402,14 +3522,14 @@ func awsAwsjson11_deserializeOpErrorListCostAllocationTags(response *smithyhttp. } } -type awsAwsjson11_deserializeOpListCostCategoryDefinitions struct { +type awsAwsjson11_deserializeOpListCostAllocationTags struct { } -func (*awsAwsjson11_deserializeOpListCostCategoryDefinitions) ID() string { +func (*awsAwsjson11_deserializeOpListCostAllocationTags) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListCostCategoryDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCostAllocationTags) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3427,9 +3547,9 @@ func (m *awsAwsjson11_deserializeOpListCostCategoryDefinitions) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListCostCategoryDefinitions(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCostAllocationTags(response, &metadata) } - output := &ListCostCategoryDefinitionsOutput{} + output := &ListCostAllocationTagsOutput{} out.Result = output var buff [1024]byte @@ -3449,7 +3569,7 @@ func (m *awsAwsjson11_deserializeOpListCostCategoryDefinitions) HandleDeserializ return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListCostCategoryDefinitionsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCostAllocationTagsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3463,7 +3583,7 @@ func (m *awsAwsjson11_deserializeOpListCostCategoryDefinitions) HandleDeserializ return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListCostCategoryDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCostAllocationTags(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3500,6 +3620,9 @@ func awsAwsjson11_deserializeOpErrorListCostCategoryDefinitions(response *smithy errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) @@ -3513,14 +3636,14 @@ func awsAwsjson11_deserializeOpErrorListCostCategoryDefinitions(response *smithy } } -type awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration struct { +type awsAwsjson11_deserializeOpListCostCategoryDefinitions struct { } -func (*awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration) ID() string { +func (*awsAwsjson11_deserializeOpListCostCategoryDefinitions) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListCostCategoryDefinitions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3538,9 +3661,9 @@ func (m *awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGenerat } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListSavingsPlansPurchaseRecommendationGeneration(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListCostCategoryDefinitions(response, &metadata) } - output := &ListSavingsPlansPurchaseRecommendationGenerationOutput{} + output := &ListCostCategoryDefinitionsOutput{} out.Result = output var buff [1024]byte @@ -3560,7 +3683,7 @@ func (m *awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGenerat return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListSavingsPlansPurchaseRecommendationGenerationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListCostCategoryDefinitionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3574,7 +3697,7 @@ func (m *awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGenerat return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListSavingsPlansPurchaseRecommendationGeneration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListCostCategoryDefinitions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3611,12 +3734,6 @@ func awsAwsjson11_deserializeOpErrorListSavingsPlansPurchaseRecommendationGenera errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("DataUnavailableException", errorCode): - return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) - - case strings.EqualFold("InvalidNextTokenException", errorCode): - return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) @@ -3630,14 +3747,14 @@ func awsAwsjson11_deserializeOpErrorListSavingsPlansPurchaseRecommendationGenera } } -type awsAwsjson11_deserializeOpListTagsForResource struct { +type awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration struct { } -func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { +func (*awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListSavingsPlansPurchaseRecommendationGeneration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3655,9 +3772,9 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListSavingsPlansPurchaseRecommendationGeneration(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListSavingsPlansPurchaseRecommendationGenerationOutput{} out.Result = output var buff [1024]byte @@ -3677,7 +3794,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListSavingsPlansPurchaseRecommendationGenerationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3691,7 +3808,7 @@ func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListSavingsPlansPurchaseRecommendationGeneration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3728,12 +3845,15 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("DataUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) + + case strings.EqualFold("InvalidNextTokenException", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextTokenException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3744,14 +3864,14 @@ func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -type awsAwsjson11_deserializeOpProvideAnomalyFeedback struct { +type awsAwsjson11_deserializeOpListTagsForResource struct { } -func (*awsAwsjson11_deserializeOpProvideAnomalyFeedback) ID() string { +func (*awsAwsjson11_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpProvideAnomalyFeedback) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3769,9 +3889,9 @@ func (m *awsAwsjson11_deserializeOpProvideAnomalyFeedback) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &ProvideAnomalyFeedbackOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -3791,7 +3911,7 @@ func (m *awsAwsjson11_deserializeOpProvideAnomalyFeedback) HandleDeserialize(ctx return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentProvideAnomalyFeedbackOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3805,7 +3925,7 @@ func (m *awsAwsjson11_deserializeOpProvideAnomalyFeedback) HandleDeserialize(ctx return out, metadata, err } -func awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3845,6 +3965,9 @@ func awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response *smithyhttp. case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -3855,14 +3978,14 @@ func awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response *smithyhttp. } } -type awsAwsjson11_deserializeOpStartCostAllocationTagBackfill struct { +type awsAwsjson11_deserializeOpProvideAnomalyFeedback struct { } -func (*awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) ID() string { +func (*awsAwsjson11_deserializeOpProvideAnomalyFeedback) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpProvideAnomalyFeedback) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3880,9 +4003,9 @@ func (m *awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) HandleDeseria } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response, &metadata) } - output := &StartCostAllocationTagBackfillOutput{} + output := &ProvideAnomalyFeedbackOutput{} out.Result = output var buff [1024]byte @@ -3902,7 +4025,7 @@ func (m *awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) HandleDeseria return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartCostAllocationTagBackfillOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentProvideAnomalyFeedbackOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3916,7 +4039,7 @@ func (m *awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) HandleDeseria return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorProvideAnomalyFeedback(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3953,9 +4076,6 @@ func awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response *smi errorMessage = bodyInfo.Message } switch { - case strings.EqualFold("BackfillLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorBackfillLimitExceededException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) @@ -3969,14 +4089,14 @@ func awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response *smi } } -type awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration struct { +type awsAwsjson11_deserializeOpStartCommitmentPurchaseAnalysis struct { } -func (*awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration) ID() string { +func (*awsAwsjson11_deserializeOpStartCommitmentPurchaseAnalysis) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartCommitmentPurchaseAnalysis) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3994,9 +4114,9 @@ func (m *awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGenera } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorStartSavingsPlansPurchaseRecommendationGeneration(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartCommitmentPurchaseAnalysis(response, &metadata) } - output := &StartSavingsPlansPurchaseRecommendationGenerationOutput{} + output := &StartCommitmentPurchaseAnalysisOutput{} out.Result = output var buff [1024]byte @@ -4016,7 +4136,7 @@ func (m *awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGenera return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentStartSavingsPlansPurchaseRecommendationGenerationOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartCommitmentPurchaseAnalysisOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4030,7 +4150,7 @@ func (m *awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGenera return out, metadata, err } -func awsAwsjson11_deserializeOpErrorStartSavingsPlansPurchaseRecommendationGeneration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartCommitmentPurchaseAnalysis(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4089,14 +4209,14 @@ func awsAwsjson11_deserializeOpErrorStartSavingsPlansPurchaseRecommendationGener } } -type awsAwsjson11_deserializeOpTagResource struct { +type awsAwsjson11_deserializeOpStartCostAllocationTagBackfill struct { } -func (*awsAwsjson11_deserializeOpTagResource) ID() string { +func (*awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpStartCostAllocationTagBackfill) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4114,9 +4234,9 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response, &metadata) } - output := &TagResourceOutput{} + output := &StartCostAllocationTagBackfillOutput{} out.Result = output var buff [1024]byte @@ -4136,7 +4256,7 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentStartCostAllocationTagBackfillOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4150,7 +4270,7 @@ func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorStartCostAllocationTagBackfill(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4187,15 +4307,249 @@ func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, m errorMessage = bodyInfo.Message } switch { + case strings.EqualFold("BackfillLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorBackfillLimitExceededException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("TooManyTagsException", errorCode): - return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) - + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration struct { +} + +func (*awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartSavingsPlansPurchaseRecommendationGeneration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorStartSavingsPlansPurchaseRecommendationGeneration(response, &metadata) + } + output := &StartSavingsPlansPurchaseRecommendationGenerationOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentStartSavingsPlansPurchaseRecommendationGenerationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorStartSavingsPlansPurchaseRecommendationGeneration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("DataUnavailableException", errorCode): + return awsAwsjson11_deserializeErrorDataUnavailableException(response, errorBody) + + case strings.EqualFold("GenerationExistsException", errorCode): + return awsAwsjson11_deserializeErrorGenerationExistsException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsAwsjson11_deserializeErrorServiceQuotaExceededException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpTagResource struct { +} + +func (*awsAwsjson11_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorTagResource(response, &metadata) + } + output := &TagResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentTagResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsAwsjson11_deserializeErrorTooManyTagsException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -4779,7 +5133,7 @@ func awsAwsjson11_deserializeOpErrorUpdateCostCategoryDefinition(response *smith } } -func awsAwsjson11_deserializeErrorBackfillLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorAnalysisNotFoundException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4797,8 +5151,8 @@ func awsAwsjson11_deserializeErrorBackfillLimitExceededException(response *smith return err } - output := &types.BackfillLimitExceededException{} - err := awsAwsjson11_deserializeDocumentBackfillLimitExceededException(&output, shape) + output := &types.AnalysisNotFoundException{} + err := awsAwsjson11_deserializeDocumentAnalysisNotFoundException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -4814,7 +5168,7 @@ func awsAwsjson11_deserializeErrorBackfillLimitExceededException(response *smith return output } -func awsAwsjson11_deserializeErrorBillExpirationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorBackfillLimitExceededException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4832,8 +5186,8 @@ func awsAwsjson11_deserializeErrorBillExpirationException(response *smithyhttp.R return err } - output := &types.BillExpirationException{} - err := awsAwsjson11_deserializeDocumentBillExpirationException(&output, shape) + output := &types.BackfillLimitExceededException{} + err := awsAwsjson11_deserializeDocumentBackfillLimitExceededException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -4849,7 +5203,7 @@ func awsAwsjson11_deserializeErrorBillExpirationException(response *smithyhttp.R return output } -func awsAwsjson11_deserializeErrorDataUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorBillExpirationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4867,8 +5221,8 @@ func awsAwsjson11_deserializeErrorDataUnavailableException(response *smithyhttp. return err } - output := &types.DataUnavailableException{} - err := awsAwsjson11_deserializeDocumentDataUnavailableException(&output, shape) + output := &types.BillExpirationException{} + err := awsAwsjson11_deserializeDocumentBillExpirationException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -4884,7 +5238,7 @@ func awsAwsjson11_deserializeErrorDataUnavailableException(response *smithyhttp. return output } -func awsAwsjson11_deserializeErrorGenerationExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { +func awsAwsjson11_deserializeErrorDataUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -4902,8 +5256,43 @@ func awsAwsjson11_deserializeErrorGenerationExistsException(response *smithyhttp return err } - output := &types.GenerationExistsException{} - err := awsAwsjson11_deserializeDocumentGenerationExistsException(&output, shape) + output := &types.DataUnavailableException{} + err := awsAwsjson11_deserializeDocumentDataUnavailableException(&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 awsAwsjson11_deserializeErrorGenerationExistsException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.GenerationExistsException{} + err := awsAwsjson11_deserializeDocumentGenerationExistsException(&output, shape) if err != nil { var snapshot bytes.Buffer @@ -5234,6 +5623,206 @@ func awsAwsjson11_deserializeErrorUnresolvableUsageUnitException(response *smith return output } +func awsAwsjson11_deserializeDocumentAnalysisDetails(v **types.AnalysisDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AnalysisDetails + if *v == nil { + sv = &types.AnalysisDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SavingsPlansPurchaseAnalysisDetails": + if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseAnalysisDetails(&sv.SavingsPlansPurchaseAnalysisDetails, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAnalysisNotFoundException(v **types.AnalysisNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AnalysisNotFoundException + if *v == nil { + sv = &types.AnalysisNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAnalysisSummary(v **types.AnalysisSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AnalysisSummary + if *v == nil { + sv = &types.AnalysisSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AnalysisCompletionTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.AnalysisCompletionTime = ptr.String(jtv) + } + + case "AnalysisId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnalysisId to be of type string, got %T instead", value) + } + sv.AnalysisId = ptr.String(jtv) + } + + case "AnalysisStartedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.AnalysisStartedTime = ptr.String(jtv) + } + + case "AnalysisStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnalysisStatus to be of type string, got %T instead", value) + } + sv.AnalysisStatus = types.AnalysisStatus(jtv) + } + + case "CommitmentPurchaseAnalysisConfiguration": + if err := awsAwsjson11_deserializeDocumentCommitmentPurchaseAnalysisConfiguration(&sv.CommitmentPurchaseAnalysisConfiguration, value); err != nil { + return err + } + + 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 "EstimatedCompletionTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.EstimatedCompletionTime = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentAnalysisSummaryList(v *[]types.AnalysisSummary, 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.AnalysisSummary + if *v == nil { + cv = []types.AnalysisSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AnalysisSummary + destAddr := &col + if err := awsAwsjson11_deserializeDocumentAnalysisSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentAnomalies(v *[]types.Anomaly, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -5919,6 +6508,42 @@ func awsAwsjson11_deserializeDocumentBillExpirationException(v **types.BillExpir return nil } +func awsAwsjson11_deserializeDocumentCommitmentPurchaseAnalysisConfiguration(v **types.CommitmentPurchaseAnalysisConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CommitmentPurchaseAnalysisConfiguration + if *v == nil { + sv = &types.CommitmentPurchaseAnalysisConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "SavingsPlansPurchaseAnalysisConfiguration": + if err := awsAwsjson11_deserializeDocumentSavingsPlansPurchaseAnalysisConfiguration(&sv.SavingsPlansPurchaseAnalysisConfiguration, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentCostAllocationTag(v **types.CostAllocationTag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -11764,7 +12389,7 @@ func awsAwsjson11_deserializeDocumentRootCauses(v *[]types.RootCause, value inte return nil } -func awsAwsjson11_deserializeDocumentSavingsPlansAmortizedCommitment(v **types.SavingsPlansAmortizedCommitment, value interface{}) error { +func awsAwsjson11_deserializeDocumentSavingsPlans(v **types.SavingsPlans, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11777,44 +12402,163 @@ func awsAwsjson11_deserializeDocumentSavingsPlansAmortizedCommitment(v **types.S return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SavingsPlansAmortizedCommitment + var sv *types.SavingsPlans if *v == nil { - sv = &types.SavingsPlansAmortizedCommitment{} + sv = &types.SavingsPlans{} } else { sv = *v } for key, value := range shape { switch key { - case "AmortizedRecurringCommitment": + case "InstanceFamily": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } - sv.AmortizedRecurringCommitment = ptr.String(jtv) + sv.InstanceFamily = ptr.String(jtv) } - case "AmortizedUpfrontCommitment": + case "OfferingId": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } - sv.AmortizedUpfrontCommitment = ptr.String(jtv) + sv.OfferingId = ptr.String(jtv) } - case "TotalAmortizedCommitment": + case "PaymentOption": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + return fmt.Errorf("expected PaymentOption to be of type string, got %T instead", value) } - sv.TotalAmortizedCommitment = ptr.String(jtv) + sv.PaymentOption = types.PaymentOption(jtv) } - default: - _, _ = key, value + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "SavingsPlansCommitment": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.SavingsPlansCommitment = 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.SavingsPlansCommitment = ptr.Float64(f64) + + default: + return fmt.Errorf("expected SavingsPlansCommitment to be a JSON Number, got %T instead", value) + + } + } + + case "SavingsPlansType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SupportedSavingsPlansType to be of type string, got %T instead", value) + } + sv.SavingsPlansType = types.SupportedSavingsPlansType(jtv) + } + + case "TermInYears": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TermInYears to be of type string, got %T instead", value) + } + sv.TermInYears = types.TermInYears(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSavingsPlansAmortizedCommitment(v **types.SavingsPlansAmortizedCommitment, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SavingsPlansAmortizedCommitment + if *v == nil { + sv = &types.SavingsPlansAmortizedCommitment{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AmortizedRecurringCommitment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.AmortizedRecurringCommitment = ptr.String(jtv) + } + + case "AmortizedUpfrontCommitment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.AmortizedUpfrontCommitment = ptr.String(jtv) + } + + case "TotalAmortizedCommitment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.TotalAmortizedCommitment = ptr.String(jtv) + } + + default: + _, _ = key, value } } @@ -11989,33 +12733,331 @@ func awsAwsjson11_deserializeDocumentSavingsPlansDetails(v **types.SavingsPlansD sv = *v } - for key, value := range shape { - switch key { - case "InstanceFamily": + for key, value := range shape { + switch key { + case "InstanceFamily": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.InstanceFamily = ptr.String(jtv) + } + + case "OfferingId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.OfferingId = ptr.String(jtv) + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseAnalysisConfiguration(v **types.SavingsPlansPurchaseAnalysisConfiguration, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SavingsPlansPurchaseAnalysisConfiguration + if *v == nil { + sv = &types.SavingsPlansPurchaseAnalysisConfiguration{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "AccountScope": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountScope to be of type string, got %T instead", value) + } + sv.AccountScope = types.AccountScope(jtv) + } + + case "AnalysisType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnalysisType to be of type string, got %T instead", value) + } + sv.AnalysisType = types.AnalysisType(jtv) + } + + case "LookBackTimePeriod": + if err := awsAwsjson11_deserializeDocumentDateInterval(&sv.LookBackTimePeriod, value); err != nil { + return err + } + + case "SavingsPlansToAdd": + if err := awsAwsjson11_deserializeDocumentSavingsPlansToAdd(&sv.SavingsPlansToAdd, value); err != nil { + return err + } + + case "SavingsPlansToExclude": + if err := awsAwsjson11_deserializeDocumentSavingsPlansToExclude(&sv.SavingsPlansToExclude, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentSavingsPlansPurchaseAnalysisDetails(v **types.SavingsPlansPurchaseAnalysisDetails, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SavingsPlansPurchaseAnalysisDetails + if *v == nil { + sv = &types.SavingsPlansPurchaseAnalysisDetails{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AdditionalMetadata": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.AdditionalMetadata = ptr.String(jtv) + } + + case "CurrencyCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.CurrencyCode = ptr.String(jtv) + } + + case "CurrentAverageCoverage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.CurrentAverageCoverage = ptr.String(jtv) + } + + case "CurrentAverageHourlyOnDemandSpend": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.CurrentAverageHourlyOnDemandSpend = ptr.String(jtv) + } + + case "CurrentMaximumHourlyOnDemandSpend": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.CurrentMaximumHourlyOnDemandSpend = ptr.String(jtv) + } + + case "CurrentMinimumHourlyOnDemandSpend": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.CurrentMinimumHourlyOnDemandSpend = ptr.String(jtv) + } + + case "CurrentOnDemandSpend": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.CurrentOnDemandSpend = ptr.String(jtv) + } + + case "EstimatedAverageCoverage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedAverageCoverage = ptr.String(jtv) + } + + case "EstimatedAverageUtilization": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedAverageUtilization = ptr.String(jtv) + } + + case "EstimatedCommitmentCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedCommitmentCost = ptr.String(jtv) + } + + case "EstimatedMonthlySavingsAmount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedMonthlySavingsAmount = ptr.String(jtv) + } + + case "EstimatedOnDemandCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedOnDemandCost = ptr.String(jtv) + } + + case "EstimatedOnDemandCostWithCurrentCommitment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedOnDemandCostWithCurrentCommitment = ptr.String(jtv) + } + + case "EstimatedROI": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedROI = ptr.String(jtv) + } + + case "EstimatedSavingsAmount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedSavingsAmount = ptr.String(jtv) + } + + case "EstimatedSavingsPercentage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.EstimatedSavingsPercentage = ptr.String(jtv) + } + + case "ExistingHourlyCommitment": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.ExistingHourlyCommitment = ptr.String(jtv) + } + + case "HourlyCommitmentToPurchase": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } - sv.InstanceFamily = ptr.String(jtv) + sv.HourlyCommitmentToPurchase = ptr.String(jtv) } - case "OfferingId": + case "LatestUsageTimestamp": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } - sv.OfferingId = ptr.String(jtv) + sv.LatestUsageTimestamp = ptr.String(jtv) } - case "Region": + case "LookbackPeriodInHours": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) } - sv.Region = ptr.String(jtv) + sv.LookbackPeriodInHours = ptr.String(jtv) + } + + case "MetricsOverLookbackPeriod": + if err := awsAwsjson11_deserializeDocumentMetricsOverLookbackPeriod(&sv.MetricsOverLookbackPeriod, value); err != nil { + return err + } + + case "UpfrontCost": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenericString to be of type string, got %T instead", value) + } + sv.UpfrontCost = ptr.String(jtv) } default: @@ -12564,6 +13606,76 @@ func awsAwsjson11_deserializeDocumentSavingsPlansSavings(v **types.SavingsPlansS return nil } +func awsAwsjson11_deserializeDocumentSavingsPlansToAdd(v *[]types.SavingsPlans, 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.SavingsPlans + if *v == nil { + cv = []types.SavingsPlans{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SavingsPlans + destAddr := &col + if err := awsAwsjson11_deserializeDocumentSavingsPlans(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentSavingsPlansToExclude(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 SavingsPlansId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentSavingsPlansUtilization(v **types.SavingsPlansUtilization, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -14151,6 +15263,101 @@ func awsAwsjson11_deserializeOpDocumentGetApproximateUsageRecordsOutput(v **GetA return nil } +func awsAwsjson11_deserializeOpDocumentGetCommitmentPurchaseAnalysisOutput(v **GetCommitmentPurchaseAnalysisOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetCommitmentPurchaseAnalysisOutput + if *v == nil { + sv = &GetCommitmentPurchaseAnalysisOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AnalysisCompletionTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.AnalysisCompletionTime = ptr.String(jtv) + } + + case "AnalysisDetails": + if err := awsAwsjson11_deserializeDocumentAnalysisDetails(&sv.AnalysisDetails, value); err != nil { + return err + } + + case "AnalysisId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnalysisId to be of type string, got %T instead", value) + } + sv.AnalysisId = ptr.String(jtv) + } + + case "AnalysisStartedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.AnalysisStartedTime = ptr.String(jtv) + } + + case "AnalysisStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnalysisStatus to be of type string, got %T instead", value) + } + sv.AnalysisStatus = types.AnalysisStatus(jtv) + } + + case "CommitmentPurchaseAnalysisConfiguration": + if err := awsAwsjson11_deserializeDocumentCommitmentPurchaseAnalysisConfiguration(&sv.CommitmentPurchaseAnalysisConfiguration, value); err != nil { + return err + } + + 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 "EstimatedCompletionTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.EstimatedCompletionTime = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetCostAndUsageOutput(v **GetCostAndUsageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15007,6 +16214,51 @@ func awsAwsjson11_deserializeOpDocumentGetUsageForecastOutput(v **GetUsageForeca return nil } +func awsAwsjson11_deserializeOpDocumentListCommitmentPurchaseAnalysesOutput(v **ListCommitmentPurchaseAnalysesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCommitmentPurchaseAnalysesOutput + if *v == nil { + sv = &ListCommitmentPurchaseAnalysesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AnalysisSummaryList": + if err := awsAwsjson11_deserializeDocumentAnalysisSummaryList(&sv.AnalysisSummaryList, value); err != nil { + return err + } + + case "NextPageToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextPageToken to be of type string, got %T instead", value) + } + sv.NextPageToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentListCostAllocationTagBackfillHistoryOutput(v **ListCostAllocationTagBackfillHistoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15263,6 +16515,64 @@ func awsAwsjson11_deserializeOpDocumentProvideAnomalyFeedbackOutput(v **ProvideA return nil } +func awsAwsjson11_deserializeOpDocumentStartCommitmentPurchaseAnalysisOutput(v **StartCommitmentPurchaseAnalysisOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartCommitmentPurchaseAnalysisOutput + if *v == nil { + sv = &StartCommitmentPurchaseAnalysisOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AnalysisId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AnalysisId to be of type string, got %T instead", value) + } + sv.AnalysisId = ptr.String(jtv) + } + + case "AnalysisStartedTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.AnalysisStartedTime = ptr.String(jtv) + } + + case "EstimatedCompletionTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ZonedDateTime to be of type string, got %T instead", value) + } + sv.EstimatedCompletionTime = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentStartCostAllocationTagBackfillOutput(v **StartCostAllocationTagBackfillOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/costexplorer/generated.json b/service/costexplorer/generated.json index cf013609d9e..361c803e871 100644 --- a/service/costexplorer/generated.json +++ b/service/costexplorer/generated.json @@ -19,6 +19,7 @@ "api_op_GetAnomalyMonitors.go", "api_op_GetAnomalySubscriptions.go", "api_op_GetApproximateUsageRecords.go", + "api_op_GetCommitmentPurchaseAnalysis.go", "api_op_GetCostAndUsage.go", "api_op_GetCostAndUsageWithResources.go", "api_op_GetCostCategories.go", @@ -35,12 +36,14 @@ "api_op_GetSavingsPlansUtilizationDetails.go", "api_op_GetTags.go", "api_op_GetUsageForecast.go", + "api_op_ListCommitmentPurchaseAnalyses.go", "api_op_ListCostAllocationTagBackfillHistory.go", "api_op_ListCostAllocationTags.go", "api_op_ListCostCategoryDefinitions.go", "api_op_ListSavingsPlansPurchaseRecommendationGeneration.go", "api_op_ListTagsForResource.go", "api_op_ProvideAnomalyFeedback.go", + "api_op_StartCommitmentPurchaseAnalysis.go", "api_op_StartCostAllocationTagBackfill.go", "api_op_StartSavingsPlansPurchaseRecommendationGeneration.go", "api_op_TagResource.go", diff --git a/service/costexplorer/serializers.go b/service/costexplorer/serializers.go index f2888679b9b..76357796391 100644 --- a/service/costexplorer/serializers.go +++ b/service/costexplorer/serializers.go @@ -688,6 +688,67 @@ func (m *awsAwsjson11_serializeOpGetApproximateUsageRecords) HandleSerialize(ctx return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetCommitmentPurchaseAnalysis struct { +} + +func (*awsAwsjson11_serializeOpGetCommitmentPurchaseAnalysis) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetCommitmentPurchaseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCommitmentPurchaseAnalysisInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.GetCommitmentPurchaseAnalysis") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetCommitmentPurchaseAnalysisInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetCostAndUsage struct { } @@ -1664,6 +1725,67 @@ func (m *awsAwsjson11_serializeOpGetUsageForecast) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListCommitmentPurchaseAnalyses struct { +} + +func (*awsAwsjson11_serializeOpListCommitmentPurchaseAnalyses) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListCommitmentPurchaseAnalyses) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListCommitmentPurchaseAnalysesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.ListCommitmentPurchaseAnalyses") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListCommitmentPurchaseAnalysesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListCostAllocationTagBackfillHistory struct { } @@ -2030,6 +2152,67 @@ func (m *awsAwsjson11_serializeOpProvideAnomalyFeedback) HandleSerialize(ctx con return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpStartCommitmentPurchaseAnalysis struct { +} + +func (*awsAwsjson11_serializeOpStartCommitmentPurchaseAnalysis) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStartCommitmentPurchaseAnalysis) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartCommitmentPurchaseAnalysisInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AWSInsightsIndexService.StartCommitmentPurchaseAnalysis") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStartCommitmentPurchaseAnalysisInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpStartCostAllocationTagBackfill struct { } @@ -2517,6 +2700,17 @@ func (m *awsAwsjson11_serializeOpUpdateCostCategoryDefinition) HandleSerialize(c span.End() return next.HandleSerialize(ctx, in) } +func awsAwsjson11_serializeDocumentAnalysisIds(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentAnomalyDateInterval(v *types.AnomalyDateInterval, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2654,6 +2848,20 @@ func awsAwsjson11_serializeDocumentAnomalySubscription(v *types.AnomalySubscript return nil } +func awsAwsjson11_serializeDocumentCommitmentPurchaseAnalysisConfiguration(v *types.CommitmentPurchaseAnalysisConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.SavingsPlansPurchaseAnalysisConfiguration != nil { + ok := object.Key("SavingsPlansPurchaseAnalysisConfiguration") + if err := awsAwsjson11_serializeDocumentSavingsPlansPurchaseAnalysisConfiguration(v.SavingsPlansPurchaseAnalysisConfiguration, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentCostAllocationTagKeyList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3129,6 +3337,61 @@ func awsAwsjson11_serializeDocumentRightsizingRecommendationConfiguration(v *typ return nil } +func awsAwsjson11_serializeDocumentSavingsPlans(v *types.SavingsPlans, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.InstanceFamily != nil { + ok := object.Key("InstanceFamily") + ok.String(*v.InstanceFamily) + } + + if v.OfferingId != nil { + ok := object.Key("OfferingId") + ok.String(*v.OfferingId) + } + + if len(v.PaymentOption) > 0 { + ok := object.Key("PaymentOption") + ok.String(string(v.PaymentOption)) + } + + if v.Region != nil { + ok := object.Key("Region") + ok.String(*v.Region) + } + + if v.SavingsPlansCommitment != nil { + ok := object.Key("SavingsPlansCommitment") + switch { + case math.IsNaN(*v.SavingsPlansCommitment): + ok.String("NaN") + + case math.IsInf(*v.SavingsPlansCommitment, 1): + ok.String("Infinity") + + case math.IsInf(*v.SavingsPlansCommitment, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.SavingsPlansCommitment) + + } + } + + if len(v.SavingsPlansType) > 0 { + ok := object.Key("SavingsPlansType") + ok.String(string(v.SavingsPlansType)) + } + + if len(v.TermInYears) > 0 { + ok := object.Key("TermInYears") + ok.String(string(v.TermInYears)) + } + + return nil +} + func awsAwsjson11_serializeDocumentSavingsPlansDataTypes(v []types.SavingsPlansDataType, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -3140,6 +3403,73 @@ func awsAwsjson11_serializeDocumentSavingsPlansDataTypes(v []types.SavingsPlansD return nil } +func awsAwsjson11_serializeDocumentSavingsPlansPurchaseAnalysisConfiguration(v *types.SavingsPlansPurchaseAnalysisConfiguration, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AccountId != nil { + ok := object.Key("AccountId") + ok.String(*v.AccountId) + } + + if len(v.AccountScope) > 0 { + ok := object.Key("AccountScope") + ok.String(string(v.AccountScope)) + } + + if len(v.AnalysisType) > 0 { + ok := object.Key("AnalysisType") + ok.String(string(v.AnalysisType)) + } + + if v.LookBackTimePeriod != nil { + ok := object.Key("LookBackTimePeriod") + if err := awsAwsjson11_serializeDocumentDateInterval(v.LookBackTimePeriod, ok); err != nil { + return err + } + } + + if v.SavingsPlansToAdd != nil { + ok := object.Key("SavingsPlansToAdd") + if err := awsAwsjson11_serializeDocumentSavingsPlansToAdd(v.SavingsPlansToAdd, ok); err != nil { + return err + } + } + + if v.SavingsPlansToExclude != nil { + ok := object.Key("SavingsPlansToExclude") + if err := awsAwsjson11_serializeDocumentSavingsPlansToExclude(v.SavingsPlansToExclude, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentSavingsPlansToAdd(v []types.SavingsPlans, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentSavingsPlans(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentSavingsPlansToExclude(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentServiceSpecification(v *types.ServiceSpecification, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3576,6 +3906,18 @@ func awsAwsjson11_serializeOpDocumentGetApproximateUsageRecordsInput(v *GetAppro return nil } +func awsAwsjson11_serializeOpDocumentGetCommitmentPurchaseAnalysisInput(v *GetCommitmentPurchaseAnalysisInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnalysisId != nil { + ok := object.Key("AnalysisId") + ok.String(*v.AnalysisId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetCostAndUsageInput(v *GetCostAndUsageInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4287,6 +4629,35 @@ func awsAwsjson11_serializeOpDocumentGetUsageForecastInput(v *GetUsageForecastIn return nil } +func awsAwsjson11_serializeOpDocumentListCommitmentPurchaseAnalysesInput(v *ListCommitmentPurchaseAnalysesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AnalysisIds != nil { + ok := object.Key("AnalysisIds") + if err := awsAwsjson11_serializeDocumentAnalysisIds(v.AnalysisIds, ok); err != nil { + return err + } + } + + if len(v.AnalysisStatus) > 0 { + ok := object.Key("AnalysisStatus") + ok.String(string(v.AnalysisStatus)) + } + + if v.NextPageToken != nil { + ok := object.Key("NextPageToken") + ok.String(*v.NextPageToken) + } + + if v.PageSize != 0 { + ok := object.Key("PageSize") + ok.Integer(v.PageSize) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListCostAllocationTagBackfillHistoryInput(v *ListCostAllocationTagBackfillHistoryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4418,6 +4789,20 @@ func awsAwsjson11_serializeOpDocumentProvideAnomalyFeedbackInput(v *ProvideAnoma return nil } +func awsAwsjson11_serializeOpDocumentStartCommitmentPurchaseAnalysisInput(v *StartCommitmentPurchaseAnalysisInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CommitmentPurchaseAnalysisConfiguration != nil { + ok := object.Key("CommitmentPurchaseAnalysisConfiguration") + if err := awsAwsjson11_serializeDocumentCommitmentPurchaseAnalysisConfiguration(v.CommitmentPurchaseAnalysisConfiguration, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentStartCostAllocationTagBackfillInput(v *StartCostAllocationTagBackfillInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/costexplorer/snapshot/api_op_GetCommitmentPurchaseAnalysis.go.snap b/service/costexplorer/snapshot/api_op_GetCommitmentPurchaseAnalysis.go.snap new file mode 100644 index 00000000000..9ec4dd2639f --- /dev/null +++ b/service/costexplorer/snapshot/api_op_GetCommitmentPurchaseAnalysis.go.snap @@ -0,0 +1,41 @@ +GetCommitmentPurchaseAnalysis + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/costexplorer/snapshot/api_op_ListCommitmentPurchaseAnalyses.go.snap b/service/costexplorer/snapshot/api_op_ListCommitmentPurchaseAnalyses.go.snap new file mode 100644 index 00000000000..b7f34f530dd --- /dev/null +++ b/service/costexplorer/snapshot/api_op_ListCommitmentPurchaseAnalyses.go.snap @@ -0,0 +1,40 @@ +ListCommitmentPurchaseAnalyses + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/costexplorer/snapshot/api_op_StartCommitmentPurchaseAnalysis.go.snap b/service/costexplorer/snapshot/api_op_StartCommitmentPurchaseAnalysis.go.snap new file mode 100644 index 00000000000..343ab308d4a --- /dev/null +++ b/service/costexplorer/snapshot/api_op_StartCommitmentPurchaseAnalysis.go.snap @@ -0,0 +1,41 @@ +StartCommitmentPurchaseAnalysis + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/costexplorer/snapshot_test.go b/service/costexplorer/snapshot_test.go index 0fd367f4ab3..f868d0abbdf 100644 --- a/service/costexplorer/snapshot_test.go +++ b/service/costexplorer/snapshot_test.go @@ -194,6 +194,18 @@ func TestCheckSnapshot_GetApproximateUsageRecords(t *testing.T) { } } +func TestCheckSnapshot_GetCommitmentPurchaseAnalysis(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCommitmentPurchaseAnalysis(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetCommitmentPurchaseAnalysis") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetCostAndUsage(t *testing.T) { svc := New(Options{}) _, err := svc.GetCostAndUsage(context.Background(), nil, func(o *Options) { @@ -386,6 +398,18 @@ func TestCheckSnapshot_GetUsageForecast(t *testing.T) { } } +func TestCheckSnapshot_ListCommitmentPurchaseAnalyses(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCommitmentPurchaseAnalyses(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListCommitmentPurchaseAnalyses") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListCostAllocationTagBackfillHistory(t *testing.T) { svc := New(Options{}) _, err := svc.ListCostAllocationTagBackfillHistory(context.Background(), nil, func(o *Options) { @@ -458,6 +482,18 @@ func TestCheckSnapshot_ProvideAnomalyFeedback(t *testing.T) { } } +func TestCheckSnapshot_StartCommitmentPurchaseAnalysis(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartCommitmentPurchaseAnalysis(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartCommitmentPurchaseAnalysis") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartCostAllocationTagBackfill(t *testing.T) { svc := New(Options{}) _, err := svc.StartCostAllocationTagBackfill(context.Background(), nil, func(o *Options) { @@ -685,6 +721,18 @@ func TestUpdateSnapshot_GetApproximateUsageRecords(t *testing.T) { } } +func TestUpdateSnapshot_GetCommitmentPurchaseAnalysis(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCommitmentPurchaseAnalysis(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetCommitmentPurchaseAnalysis") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetCostAndUsage(t *testing.T) { svc := New(Options{}) _, err := svc.GetCostAndUsage(context.Background(), nil, func(o *Options) { @@ -877,6 +925,18 @@ func TestUpdateSnapshot_GetUsageForecast(t *testing.T) { } } +func TestUpdateSnapshot_ListCommitmentPurchaseAnalyses(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCommitmentPurchaseAnalyses(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListCommitmentPurchaseAnalyses") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListCostAllocationTagBackfillHistory(t *testing.T) { svc := New(Options{}) _, err := svc.ListCostAllocationTagBackfillHistory(context.Background(), nil, func(o *Options) { @@ -949,6 +1009,18 @@ func TestUpdateSnapshot_ProvideAnomalyFeedback(t *testing.T) { } } +func TestUpdateSnapshot_StartCommitmentPurchaseAnalysis(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartCommitmentPurchaseAnalysis(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartCommitmentPurchaseAnalysis") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartCostAllocationTagBackfill(t *testing.T) { svc := New(Options{}) _, err := svc.StartCostAllocationTagBackfill(context.Background(), nil, func(o *Options) { diff --git a/service/costexplorer/types/enums.go b/service/costexplorer/types/enums.go index a3234df9c44..f6207c70512 100644 --- a/service/costexplorer/types/enums.go +++ b/service/costexplorer/types/enums.go @@ -21,6 +21,46 @@ func (AccountScope) Values() []AccountScope { } } +type AnalysisStatus string + +// Enum values for AnalysisStatus +const ( + AnalysisStatusSucceeded AnalysisStatus = "SUCCEEDED" + AnalysisStatusProcessing AnalysisStatus = "PROCESSING" + AnalysisStatusFailed AnalysisStatus = "FAILED" +) + +// Values returns all known values for AnalysisStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AnalysisStatus) Values() []AnalysisStatus { + return []AnalysisStatus{ + "SUCCEEDED", + "PROCESSING", + "FAILED", + } +} + +type AnalysisType string + +// Enum values for AnalysisType +const ( + AnalysisTypeMaxSavings AnalysisType = "MAX_SAVINGS" + AnalysisTypeCustomCommitment AnalysisType = "CUSTOM_COMMITMENT" +) + +// Values returns all known values for AnalysisType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AnalysisType) Values() []AnalysisType { + return []AnalysisType{ + "MAX_SAVINGS", + "CUSTOM_COMMITMENT", + } +} + type AnomalyFeedbackType string // Enum values for AnomalyFeedbackType @@ -379,6 +419,31 @@ func (Dimension) Values() []Dimension { } } +type ErrorCode string + +// Enum values for ErrorCode +const ( + ErrorCodeNoUsageFound ErrorCode = "NO_USAGE_FOUND" + ErrorCodeInternalFailure ErrorCode = "INTERNAL_FAILURE" + ErrorCodeInvalidSavingsPlansToAdd ErrorCode = "INVALID_SAVINGS_PLANS_TO_ADD" + ErrorCodeInvalidSavingsPlansToExclude ErrorCode = "INVALID_SAVINGS_PLANS_TO_EXCLUDE" + ErrorCodeInvalidAccountId ErrorCode = "INVALID_ACCOUNT_ID" +) + +// 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{ + "NO_USAGE_FOUND", + "INTERNAL_FAILURE", + "INVALID_SAVINGS_PLANS_TO_ADD", + "INVALID_SAVINGS_PLANS_TO_EXCLUDE", + "INVALID_ACCOUNT_ID", + } +} + type FindingReasonCode string // Enum values for FindingReasonCode diff --git a/service/costexplorer/types/errors.go b/service/costexplorer/types/errors.go index 52355aa0eea..61cbf95405e 100644 --- a/service/costexplorer/types/errors.go +++ b/service/costexplorer/types/errors.go @@ -7,6 +7,32 @@ import ( smithy "github.com/aws/smithy-go" ) +// The requested analysis can't be found. +type AnalysisNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AnalysisNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AnalysisNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AnalysisNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AnalysisNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *AnalysisNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // A request to backfill is already in progress. Once the previous request is // // complete, you can create another request. diff --git a/service/costexplorer/types/types.go b/service/costexplorer/types/types.go index 2199eb0e77b..298c016d1b2 100644 --- a/service/costexplorer/types/types.go +++ b/service/costexplorer/types/types.go @@ -6,6 +6,42 @@ import ( smithydocument "github.com/aws/smithy-go/document" ) +// Details about the analysis. +type AnalysisDetails struct { + + // Details about the Savings Plans purchase analysis. + SavingsPlansPurchaseAnalysisDetails *SavingsPlansPurchaseAnalysisDetails + + noSmithyDocumentSerde +} + +// A summary of the analysis. +type AnalysisSummary struct { + + // The completion time of the analysis. + AnalysisCompletionTime *string + + // The analysis ID that's associated with the commitment purchase. + AnalysisId *string + + // The start time of the analysis. + AnalysisStartedTime *string + + // The status of the analysis. + AnalysisStatus AnalysisStatus + + // The analysis configuration for the commitment purchase analysis. + CommitmentPurchaseAnalysisConfiguration *CommitmentPurchaseAnalysisConfiguration + + // The error code used for the analysis. + ErrorCode ErrorCode + + // The estimated time for when the analysis will complete. + EstimatedCompletionTime *string + + noSmithyDocumentSerde +} + // An unusual cost pattern. This consists of the detailed metadata and the current // status of the anomaly object. type Anomaly struct { @@ -37,7 +73,7 @@ type Anomaly struct { // The first day the anomaly is detected. AnomalyStartDate *string - // The dimension for the anomaly (for example, an Amazon Web Servicesservice in a + // The dimension for the anomaly (for example, an Amazon Web Services service in a // service monitor). DimensionValue *string @@ -299,6 +335,15 @@ type AnomalySubscription struct { noSmithyDocumentSerde } +// The configuration for the commitment purchase analysis. +type CommitmentPurchaseAnalysisConfiguration struct { + + // The configuration for the Savings Plans purchase analysis. + SavingsPlansPurchaseAnalysisConfiguration *SavingsPlansPurchaseAnalysisConfiguration + + noSmithyDocumentSerde +} + // The cost allocation tag structure. This includes detailed metadata for the // CostAllocationTag object. type CostAllocationTag struct { @@ -500,7 +545,8 @@ type CostCategoryRule struct { // An [Expression] object used to categorize costs. This supports dimensions, tags, and nested // expressions. Currently the only dimensions supported are LINKED_ACCOUNT , // - // SERVICE_CODE , RECORD_TYPE , LINKED_ACCOUNT_NAME , REGION , and USAGE_TYPE . + // SERVICE_CODE , RECORD_TYPE , LINKED_ACCOUNT_NAME , REGION , USAGE_TYPE , and + // BILLING_ENTITY . // // RECORD_TYPE is a dimension used for Cost Explorer APIs, and is also supported // for Cost Category expressions. This dimension uses different terms, depending on @@ -1913,7 +1959,7 @@ type RightsizingRecommendationSummary struct { noSmithyDocumentSerde } -// The combination of Amazon Web Servicesservice, linked account, linked account +// The combination of Amazon Web Services service, linked account, linked account // name, Region, and usage type where a cost anomaly is observed. The linked // account name will only be available when the account name can be identified. type RootCause struct { @@ -1927,7 +1973,7 @@ type RootCause struct { // The Amazon Web Services Region that's associated with the cost anomaly. Region *string - // The Amazon Web Servicesservice name that's associated with the cost anomaly. + // The Amazon Web Services service name that's associated with the cost anomaly. Service *string // The UsageType value that's associated with the cost anomaly. @@ -1936,6 +1982,33 @@ type RootCause struct { noSmithyDocumentSerde } +// The Savings Plans commitment details. +type SavingsPlans struct { + + // The instance family of the Savings Plans commitment. + InstanceFamily *string + + // The unique ID that's used to distinguish commitments from one another. + OfferingId *string + + // The payment option for the Savings Plans commitment. + PaymentOption PaymentOption + + // The Region associated with the Savings Plans commitment. + Region *string + + // The Savings Plans commitment. + SavingsPlansCommitment *float64 + + // The Savings Plans type. + SavingsPlansType SupportedSavingsPlansType + + // The term that you want the Savings Plans commitment for. + TermInYears TermInYears + + noSmithyDocumentSerde +} + // The amortized amount of Savings Plans purchased in a specific account during a // specific time interval. type SavingsPlansAmortizedCommitment struct { @@ -2008,6 +2081,116 @@ type SavingsPlansDetails struct { noSmithyDocumentSerde } +// The configuration for the Savings Plans purchase analysis. +type SavingsPlansPurchaseAnalysisConfiguration struct { + + // The type of analysis. + // + // This member is required. + AnalysisType AnalysisType + + // The time period associated with the analysis. + // + // This member is required. + LookBackTimePeriod *DateInterval + + // Savings Plans to include in the analysis. + // + // This member is required. + SavingsPlansToAdd []SavingsPlans + + // The account that the analysis is for. + AccountId *string + + // The account scope that you want your analysis for. + AccountScope AccountScope + + // Savings Plans to exclude from the analysis. + SavingsPlansToExclude []string + + noSmithyDocumentSerde +} + +// Details about the Savings Plans purchase analysis. +type SavingsPlansPurchaseAnalysisDetails struct { + + // Additional metadata that might be applicable to the commitment. + AdditionalMetadata *string + + // The currency code used for the analysis. + CurrencyCode *string + + // The average value of hourly coverage over the lookback period. + CurrentAverageCoverage *string + + // The average value of hourly On-Demand spend over the lookback period. + CurrentAverageHourlyOnDemandSpend *string + + // The highest value of hourly On-Demand spend over the lookback period. + CurrentMaximumHourlyOnDemandSpend *string + + // The lowest value of hourly On-Demand spend over the lookback period. + CurrentMinimumHourlyOnDemandSpend *string + + // The current total On-Demand spend over the lookback period. + CurrentOnDemandSpend *string + + // The estimated coverage of the Savings Plan. + EstimatedAverageCoverage *string + + // The estimated utilization of the Savings Plan. + EstimatedAverageUtilization *string + + // The estimated cost of the purchase commitment over the length of the lookback + // period. + EstimatedCommitmentCost *string + + // The estimated monthly savings amount based on the Savings Plan. + EstimatedMonthlySavingsAmount *string + + // The remaining On-Demand cost estimated to not be covered by the commitment, + // over the length of the lookback period. + EstimatedOnDemandCost *string + + // The estimated On-Demand cost you expect with no additional commitment, based on + // your usage of the selected time period and the Savings Plan you own. + EstimatedOnDemandCostWithCurrentCommitment *string + + // The estimated return on investment that's based on the purchase commitment and + // estimated savings. This is calculated as + // estimatedSavingsAmount/estimatedSPCost*100. + EstimatedROI *string + + // The estimated savings amount that's based on the purchase commitment over the + // length of the lookback period. + EstimatedSavingsAmount *string + + // The estimated savings percentage relative to the total cost over the cost + // calculation lookback period. + EstimatedSavingsPercentage *string + + // The existing hourly commitment for the Savings Plan type. + ExistingHourlyCommitment *string + + // The recommended or custom hourly commitment. + HourlyCommitmentToPurchase *string + + // The date and time of the last hour that went into the analysis. + LatestUsageTimestamp *string + + // The lookback period in hours that's used to generate the analysis. + LookbackPeriodInHours *string + + // The related hourly cost, coverage, and utilization metrics over the lookback + // period. + MetricsOverLookbackPeriod []RecommendationDetailHourlyMetrics + + // The upfront cost of the Savings Plan, based on the selected payment option. + UpfrontCost *string + + noSmithyDocumentSerde +} + // Contains your request parameters, Savings Plan Recommendations Summary, and // Details. type SavingsPlansPurchaseRecommendation struct { diff --git a/service/costexplorer/validators.go b/service/costexplorer/validators.go index e3fc5e2f218..e7d0a39c5d6 100644 --- a/service/costexplorer/validators.go +++ b/service/costexplorer/validators.go @@ -190,6 +190,26 @@ func (m *validateOpGetApproximateUsageRecords) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpGetCommitmentPurchaseAnalysis struct { +} + +func (*validateOpGetCommitmentPurchaseAnalysis) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCommitmentPurchaseAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCommitmentPurchaseAnalysisInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCommitmentPurchaseAnalysisInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetCostAndUsage struct { } @@ -550,6 +570,26 @@ func (m *validateOpProvideAnomalyFeedback) HandleInitialize(ctx context.Context, return next.HandleInitialize(ctx, in) } +type validateOpStartCommitmentPurchaseAnalysis struct { +} + +func (*validateOpStartCommitmentPurchaseAnalysis) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartCommitmentPurchaseAnalysis) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartCommitmentPurchaseAnalysisInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartCommitmentPurchaseAnalysisInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartCostAllocationTagBackfill struct { } @@ -726,6 +766,10 @@ func addOpGetApproximateUsageRecordsValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpGetApproximateUsageRecords{}, middleware.After) } +func addOpGetCommitmentPurchaseAnalysisValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCommitmentPurchaseAnalysis{}, middleware.After) +} + func addOpGetCostAndUsageValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetCostAndUsage{}, middleware.After) } @@ -798,6 +842,10 @@ func addOpProvideAnomalyFeedbackValidationMiddleware(stack *middleware.Stack) er return stack.Initialize.Add(&validateOpProvideAnomalyFeedback{}, middleware.After) } +func addOpStartCommitmentPurchaseAnalysisValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartCommitmentPurchaseAnalysis{}, middleware.After) +} + func addOpStartCostAllocationTagBackfillValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartCostAllocationTagBackfill{}, middleware.After) } @@ -883,6 +931,23 @@ func validateAnomalySubscription(v *types.AnomalySubscription) error { } } +func validateCommitmentPurchaseAnalysisConfiguration(v *types.CommitmentPurchaseAnalysisConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommitmentPurchaseAnalysisConfiguration"} + if v.SavingsPlansPurchaseAnalysisConfiguration != nil { + if err := validateSavingsPlansPurchaseAnalysisConfiguration(v.SavingsPlansPurchaseAnalysisConfiguration); err != nil { + invalidParams.AddNested("SavingsPlansPurchaseAnalysisConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCostAllocationTagStatusEntry(v *types.CostAllocationTagStatusEntry) error { if v == nil { return nil @@ -1064,6 +1129,31 @@ func validateRightsizingRecommendationConfiguration(v *types.RightsizingRecommen } } +func validateSavingsPlansPurchaseAnalysisConfiguration(v *types.SavingsPlansPurchaseAnalysisConfiguration) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SavingsPlansPurchaseAnalysisConfiguration"} + if len(v.AnalysisType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AnalysisType")) + } + if v.SavingsPlansToAdd == nil { + invalidParams.Add(smithy.NewErrParamRequired("SavingsPlansToAdd")) + } + if v.LookBackTimePeriod == nil { + invalidParams.Add(smithy.NewErrParamRequired("LookBackTimePeriod")) + } else if v.LookBackTimePeriod != nil { + if err := validateDateInterval(v.LookBackTimePeriod); err != nil { + invalidParams.AddNested("LookBackTimePeriod", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSortDefinition(v *types.SortDefinition) error { if v == nil { return nil @@ -1292,6 +1382,21 @@ func validateOpGetApproximateUsageRecordsInput(v *GetApproximateUsageRecordsInpu } } +func validateOpGetCommitmentPurchaseAnalysisInput(v *GetCommitmentPurchaseAnalysisInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCommitmentPurchaseAnalysisInput"} + if v.AnalysisId == nil { + invalidParams.Add(smithy.NewErrParamRequired("AnalysisId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetCostAndUsageInput(v *GetCostAndUsageInput) error { if v == nil { return nil @@ -1694,6 +1799,25 @@ func validateOpProvideAnomalyFeedbackInput(v *ProvideAnomalyFeedbackInput) error } } +func validateOpStartCommitmentPurchaseAnalysisInput(v *StartCommitmentPurchaseAnalysisInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartCommitmentPurchaseAnalysisInput"} + if v.CommitmentPurchaseAnalysisConfiguration == nil { + invalidParams.Add(smithy.NewErrParamRequired("CommitmentPurchaseAnalysisConfiguration")) + } else if v.CommitmentPurchaseAnalysisConfiguration != nil { + if err := validateCommitmentPurchaseAnalysisConfiguration(v.CommitmentPurchaseAnalysisConfiguration); err != nil { + invalidParams.AddNested("CommitmentPurchaseAnalysisConfiguration", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartCostAllocationTagBackfillInput(v *StartCostAllocationTagBackfillInput) error { if v == nil { return nil diff --git a/service/dlm/internal/endpoints/endpoints.go b/service/dlm/internal/endpoints/endpoints.go index 87cae0ad093..911295d266b 100644 --- a/service/dlm/internal/endpoints/endpoints.go +++ b/service/dlm/internal/endpoints/endpoints.go @@ -142,93 +142,273 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.af-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-northeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-northeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-northeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-south-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-southeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-southeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-southeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-4", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-southeast-4.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-5", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ap-southeast-5.api.aws", + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ca-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "ca-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.ca-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.eu-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.eu-central-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.eu-north-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.eu-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-south-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-south-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.eu-south-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.eu-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.eu-west-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.eu-west-3.api.aws", + }, endpoints.EndpointKey{ Region: "il-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "il-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.il-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "me-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.me-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.me-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.sa-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "dlm.us-west-2.api.aws", + }, }, }, { diff --git a/service/ec2/api_op_CancelCapacityReservation.go b/service/ec2/api_op_CancelCapacityReservation.go index e09acd7ed90..7d800237b27 100644 --- a/service/ec2/api_op_CancelCapacityReservation.go +++ b/service/ec2/api_op_CancelCapacityReservation.go @@ -13,6 +13,17 @@ import ( // Cancels the specified Capacity Reservation, releases the reserved capacity, and // changes the Capacity Reservation's state to cancelled . // +// You can cancel a Capacity Reservation that is in the following states: +// +// - assessing +// +// - active and there is no commitment duration or the commitment duration has +// elapsed. You can't cancel a future-dated Capacity Reservation during the +// commitment duration. +// +// If a future-dated Capacity Reservation enters the delayed state, the commitment +// duration is waived, and you can cancel it as soon as it enters the active state. +// // Instances running in the reserved capacity continue running until you stop // them. Stopped instances that target the Capacity Reservation can no longer // launch. Modify these instances to either target a different Capacity diff --git a/service/ec2/api_op_CreateCapacityReservation.go b/service/ec2/api_op_CreateCapacityReservation.go index e2a1cdb8ec2..f903c1cd8f3 100644 --- a/service/ec2/api_op_CreateCapacityReservation.go +++ b/service/ec2/api_op_CreateCapacityReservation.go @@ -12,30 +12,29 @@ import ( "time" ) -// Creates a new Capacity Reservation with the specified attributes. +// Creates a new Capacity Reservation with the specified attributes. Capacity +// Reservations enable you to reserve capacity for your Amazon EC2 instances in a +// specific Availability Zone for any duration. // -// Capacity Reservations enable you to reserve capacity for your Amazon EC2 -// instances in a specific Availability Zone for any duration. This gives you the -// flexibility to selectively add capacity reservations and still get the Regional -// RI discounts for that usage. By creating Capacity Reservations, you ensure that -// you always have access to Amazon EC2 capacity when you need it, for as long as -// you need it. For more information, see [Capacity Reservations]in the Amazon EC2 User Guide. +// You can create a Capacity Reservation at any time, and you can choose when it +// starts. You can create a Capacity Reservation for immediate use or you can +// request a Capacity Reservation for a future date. // -// Your request to create a Capacity Reservation could fail if Amazon EC2 does not -// have sufficient capacity to fulfill the request. If your request fails due to -// Amazon EC2 capacity constraints, either try again at a later time, try in a -// different Availability Zone, or request a smaller capacity reservation. If your -// application is flexible across instance types and sizes, try to create a -// Capacity Reservation with different instance attributes. +// For more information, see [Reserve compute capacity with On-Demand Capacity Reservations] in the Amazon EC2 User Guide. // -// Your request could also fail if the requested quantity exceeds your On-Demand -// Instance limit for the selected instance type. If your request fails due to -// limit constraints, increase your On-Demand Instance limit for the required -// instance type and try again. For more information about increasing your instance -// limits, see [Amazon EC2 Service Quotas]in the Amazon EC2 User Guide. +// Your request to create a Capacity Reservation could fail if: +// +// - Amazon EC2 does not have sufficient capacity. In this case, try again at a +// later time, try in a different Availability Zone, or request a smaller Capacity +// Reservation. If your workload is flexible across instance types and sizes, try +// with different instance attributes. +// +// - The requested quantity exceeds your On-Demand Instance quota. In this case, +// increase your On-Demand Instance quota for the requested instance type and try +// again. For more information, see [Amazon EC2 Service Quotas]in the Amazon EC2 User Guide. // // [Amazon EC2 Service Quotas]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-resource-limits.html -// [Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html +// [Reserve compute capacity with On-Demand Capacity Reservations]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/ec2-capacity-reservations.html func (c *Client) CreateCapacityReservation(ctx context.Context, params *CreateCapacityReservationInput, optFns ...func(*Options)) (*CreateCapacityReservationOutput, error) { if params == nil { params = &CreateCapacityReservationInput{} @@ -55,6 +54,11 @@ type CreateCapacityReservationInput struct { // The number of instances for which to reserve capacity. // + // You can request future-dated Capacity Reservations for an instance count with a + // minimum of 100 VPUs. For example, if you request a future-dated Capacity + // Reservation for m5.xlarge instances, you must request at least 25 instances (25 + // * m5.xlarge = 100 vCPUs). + // // Valid range: 1 - 1000 // // This member is required. @@ -65,8 +69,12 @@ type CreateCapacityReservationInput struct { // This member is required. InstancePlatform types.CapacityReservationInstancePlatform - // The instance type for which to reserve capacity. For more information, see [Instance types] in - // the Amazon EC2 User Guide. + // The instance type for which to reserve capacity. + // + // You can request future-dated Capacity Reservations for instance types in the C, + // M, R, I, and T instance families only. + // + // For more information, see [Instance types] in the Amazon EC2 User Guide. // // [Instance types]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/instance-types.html // @@ -85,6 +93,31 @@ type CreateCapacityReservationInput struct { // [Ensure Idempotency]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Run_Instance_Idempotency.html ClientToken *string + // Required for future-dated Capacity Reservations only. To create a Capacity + // Reservation for immediate use, omit this parameter. + // + // Specify a commitment duration, in seconds, for the future-dated Capacity + // Reservation. + // + // The commitment duration is a minimum duration for which you commit to having + // the future-dated Capacity Reservation in the active state in your account after + // it has been delivered. + // + // For more information, see [Commitment duration]. + // + // [Commitment duration]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-concepts.html#cr-commitment-duration + CommitmentDuration *int64 + + // Required for future-dated Capacity Reservations only. To create a Capacity + // Reservation for immediate use, omit this parameter. + // + // Indicates that the requested capacity will be delivered in addition to any + // running instances or reserved capacity that you have in your account at the + // requested date and time. + // + // The only supported value is incremental . + DeliveryPreference types.CapacityReservationDeliveryPreference + // Checks whether you have the required permissions for the action, without // actually making the request, and provides an error response. If you have the // required permissions, the error response is DryRunOperation . Otherwise, it is @@ -110,6 +143,9 @@ type CreateCapacityReservationInput struct { // hour from the specified time. For example, if you specify 5/31/2019, 13:30:55, // the Capacity Reservation is guaranteed to end between 13:30:55 and 14:30:55 on // 5/31/2019. + // + // If you are requesting a future-dated Capacity Reservation, you can't specify an + // end date and time that is within the commitment duration. EndDate *time.Time // Indicates the way in which the Capacity Reservation ends. A Capacity @@ -139,13 +175,20 @@ type CreateCapacityReservationInput struct { // explicitly target the Capacity Reservation. This ensures that only permitted // instances can use the reserved capacity. // + // If you are requesting a future-dated Capacity Reservation, you must specify + // targeted . + // // Default: open InstanceMatchCriteria types.InstanceMatchCriteria + // Not supported for future-dated Capacity Reservations. + // // The Amazon Resource Name (ARN) of the Outpost on which to create the Capacity // Reservation. OutpostArn *string + // Not supported for future-dated Capacity Reservations. + // // The Amazon Resource Name (ARN) of the cluster placement group in which to // create the Capacity Reservation. For more information, see [Capacity Reservations for cluster placement groups]in the Amazon EC2 // User Guide. @@ -153,6 +196,17 @@ type CreateCapacityReservationInput struct { // [Capacity Reservations for cluster placement groups]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/cr-cpg.html PlacementGroupArn *string + // Required for future-dated Capacity Reservations only. To create a Capacity + // Reservation for immediate use, omit this parameter. + // + // The date and time at which the future-dated Capacity Reservation should become + // available for use, in the ISO8601 format in the UTC time zone ( + // YYYY-MM-DDThh:mm:ss.sssZ ). + // + // You can request a future-dated Capacity Reservation between 5 and 120 days in + // advance. + StartDate *time.Time + // The tags to apply to the Capacity Reservation during launch. TagSpecifications []types.TagSpecification diff --git a/service/ec2/api_op_CreateVpcBlockPublicAccessExclusion.go b/service/ec2/api_op_CreateVpcBlockPublicAccessExclusion.go index fb0cdea7453..b0668b1d6ac 100644 --- a/service/ec2/api_op_CreateVpcBlockPublicAccessExclusion.go +++ b/service/ec2/api_op_CreateVpcBlockPublicAccessExclusion.go @@ -38,12 +38,12 @@ type CreateVpcBlockPublicAccessExclusionInput struct { // The exclusion mode for internet gateway traffic. // - // - bidirectional-access-allowed : Allow all internet traffic to and from the - // excluded VPCs and subnets. + // - allow-bidirectional : Allow all internet traffic to and from the excluded + // VPCs and subnets. // - // - egress-access-allowed : Allow outbound internet traffic from the excluded - // VPCs and subnets. Block inbound internet traffic to the excluded VPCs and - // subnets. Only applies when VPC Block Public Access is set to Bidirectional. + // - allow-egress : Allow outbound internet traffic from the excluded VPCs and + // subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only + // applies when VPC Block Public Access is set to Bidirectional. // // This member is required. InternetGatewayExclusionMode types.InternetGatewayExclusionMode diff --git a/service/ec2/api_op_DescribeCapacityBlockExtensionHistory.go b/service/ec2/api_op_DescribeCapacityBlockExtensionHistory.go new file mode 100644 index 00000000000..5b1b21ef2d1 --- /dev/null +++ b/service/ec2/api_op_DescribeCapacityBlockExtensionHistory.go @@ -0,0 +1,291 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the events for the specified Capacity Block extension during the +// specified time. +func (c *Client) DescribeCapacityBlockExtensionHistory(ctx context.Context, params *DescribeCapacityBlockExtensionHistoryInput, optFns ...func(*Options)) (*DescribeCapacityBlockExtensionHistoryOutput, error) { + if params == nil { + params = &DescribeCapacityBlockExtensionHistoryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityBlockExtensionHistory", params, optFns, c.addOperationDescribeCapacityBlockExtensionHistoryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeCapacityBlockExtensionHistoryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeCapacityBlockExtensionHistoryInput struct { + + // The IDs of Capacity Block reservations that you want to display the history for. + CapacityReservationIds []string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + // One or more filters + // + // - availability-zone - The Availability Zone of the extension. + // + // - availability-zone-id - The Availability Zone ID of the extension. + // + // - capacity-block-extension-offering-id - The ID of the extension offering. + // + // - capacity-block-extension-status - The status of the extension ( + // payment-pending | payment-failed | payment-succeeded ). + // + // - capacity-reservation-id - The reservation ID of the extension. + // + // - instance-type - The instance type of the extension. + Filters []types.Filter + + // The maximum number of items to return for this request. To get the next page of + // items, make another request with the token returned in the output. For more + // information, see [Pagination]. + // + // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination + MaxResults *int32 + + // The token to use to retrieve the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeCapacityBlockExtensionHistoryOutput struct { + + // Describes one or more of your Capacity Block extensions. The results describe + // only the Capacity Block extensions in the Amazon Web Services Region that you're + // currently using. + CapacityBlockExtensions []types.CapacityBlockExtension + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeCapacityBlockExtensionHistoryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityBlockExtensionHistory{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityBlockExtensionHistory{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityBlockExtensionHistory"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityBlockExtensionHistory(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeCapacityBlockExtensionHistoryPaginatorOptions is the paginator options +// for DescribeCapacityBlockExtensionHistory +type DescribeCapacityBlockExtensionHistoryPaginatorOptions struct { + // The maximum number of items to return for this request. To get the next page of + // items, make another request with the token returned in the output. For more + // information, see [Pagination]. + // + // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeCapacityBlockExtensionHistoryPaginator is a paginator for +// DescribeCapacityBlockExtensionHistory +type DescribeCapacityBlockExtensionHistoryPaginator struct { + options DescribeCapacityBlockExtensionHistoryPaginatorOptions + client DescribeCapacityBlockExtensionHistoryAPIClient + params *DescribeCapacityBlockExtensionHistoryInput + nextToken *string + firstPage bool +} + +// NewDescribeCapacityBlockExtensionHistoryPaginator returns a new +// DescribeCapacityBlockExtensionHistoryPaginator +func NewDescribeCapacityBlockExtensionHistoryPaginator(client DescribeCapacityBlockExtensionHistoryAPIClient, params *DescribeCapacityBlockExtensionHistoryInput, optFns ...func(*DescribeCapacityBlockExtensionHistoryPaginatorOptions)) *DescribeCapacityBlockExtensionHistoryPaginator { + if params == nil { + params = &DescribeCapacityBlockExtensionHistoryInput{} + } + + options := DescribeCapacityBlockExtensionHistoryPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeCapacityBlockExtensionHistoryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCapacityBlockExtensionHistoryPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeCapacityBlockExtensionHistory page. +func (p *DescribeCapacityBlockExtensionHistoryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityBlockExtensionHistoryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeCapacityBlockExtensionHistory(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeCapacityBlockExtensionHistoryAPIClient is a client that implements the +// DescribeCapacityBlockExtensionHistory operation. +type DescribeCapacityBlockExtensionHistoryAPIClient interface { + DescribeCapacityBlockExtensionHistory(context.Context, *DescribeCapacityBlockExtensionHistoryInput, ...func(*Options)) (*DescribeCapacityBlockExtensionHistoryOutput, error) +} + +var _ DescribeCapacityBlockExtensionHistoryAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeCapacityBlockExtensionHistory(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeCapacityBlockExtensionHistory", + } +} diff --git a/service/ec2/api_op_DescribeCapacityBlockExtensionOfferings.go b/service/ec2/api_op_DescribeCapacityBlockExtensionOfferings.go new file mode 100644 index 00000000000..401633758f2 --- /dev/null +++ b/service/ec2/api_op_DescribeCapacityBlockExtensionOfferings.go @@ -0,0 +1,283 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes Capacity Block extension offerings available for purchase in the +// Amazon Web Services Region that you're currently using. +func (c *Client) DescribeCapacityBlockExtensionOfferings(ctx context.Context, params *DescribeCapacityBlockExtensionOfferingsInput, optFns ...func(*Options)) (*DescribeCapacityBlockExtensionOfferingsOutput, error) { + if params == nil { + params = &DescribeCapacityBlockExtensionOfferingsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeCapacityBlockExtensionOfferings", params, optFns, c.addOperationDescribeCapacityBlockExtensionOfferingsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeCapacityBlockExtensionOfferingsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeCapacityBlockExtensionOfferingsInput struct { + + // The duration of the Capacity Block extension offering in hours. + // + // This member is required. + CapacityBlockExtensionDurationHours *int32 + + // The ID of the Capacity reservation to be extended. + // + // This member is required. + CapacityReservationId *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + // The maximum number of items to return for this request. To get the next page of + // items, make another request with the token returned in the output. For more + // information, see [Pagination]. + // + // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination + MaxResults *int32 + + // The token to use to retrieve the next page of results. + NextToken *string + + noSmithyDocumentSerde +} + +type DescribeCapacityBlockExtensionOfferingsOutput struct { + + // The recommended Capacity Block extension offerings for the dates specified. + CapacityBlockExtensionOfferings []types.CapacityBlockExtensionOffering + + // The token to use to retrieve the next page of results. This value is null when + // there are no more results to return. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeCapacityBlockExtensionOfferingsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpDescribeCapacityBlockExtensionOfferings{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpDescribeCapacityBlockExtensionOfferings{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeCapacityBlockExtensionOfferings"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeCapacityBlockExtensionOfferingsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeCapacityBlockExtensionOfferings(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// DescribeCapacityBlockExtensionOfferingsPaginatorOptions is the paginator +// options for DescribeCapacityBlockExtensionOfferings +type DescribeCapacityBlockExtensionOfferingsPaginatorOptions struct { + // The maximum number of items to return for this request. To get the next page of + // items, make another request with the token returned in the output. For more + // information, see [Pagination]. + // + // [Pagination]: https://docs.aws.amazon.com/AWSEC2/latest/APIReference/Query-Requests.html#api-pagination + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// DescribeCapacityBlockExtensionOfferingsPaginator is a paginator for +// DescribeCapacityBlockExtensionOfferings +type DescribeCapacityBlockExtensionOfferingsPaginator struct { + options DescribeCapacityBlockExtensionOfferingsPaginatorOptions + client DescribeCapacityBlockExtensionOfferingsAPIClient + params *DescribeCapacityBlockExtensionOfferingsInput + nextToken *string + firstPage bool +} + +// NewDescribeCapacityBlockExtensionOfferingsPaginator returns a new +// DescribeCapacityBlockExtensionOfferingsPaginator +func NewDescribeCapacityBlockExtensionOfferingsPaginator(client DescribeCapacityBlockExtensionOfferingsAPIClient, params *DescribeCapacityBlockExtensionOfferingsInput, optFns ...func(*DescribeCapacityBlockExtensionOfferingsPaginatorOptions)) *DescribeCapacityBlockExtensionOfferingsPaginator { + if params == nil { + params = &DescribeCapacityBlockExtensionOfferingsInput{} + } + + options := DescribeCapacityBlockExtensionOfferingsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &DescribeCapacityBlockExtensionOfferingsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *DescribeCapacityBlockExtensionOfferingsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next DescribeCapacityBlockExtensionOfferings page. +func (p *DescribeCapacityBlockExtensionOfferingsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*DescribeCapacityBlockExtensionOfferingsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.DescribeCapacityBlockExtensionOfferings(ctx, ¶ms, optFns...) + if err != nil { + return nil, err + } + p.firstPage = false + + prevToken := p.nextToken + p.nextToken = result.NextToken + + if p.options.StopOnDuplicateToken && + prevToken != nil && + p.nextToken != nil && + *prevToken == *p.nextToken { + p.nextToken = nil + } + + return result, nil +} + +// DescribeCapacityBlockExtensionOfferingsAPIClient is a client that implements +// the DescribeCapacityBlockExtensionOfferings operation. +type DescribeCapacityBlockExtensionOfferingsAPIClient interface { + DescribeCapacityBlockExtensionOfferings(context.Context, *DescribeCapacityBlockExtensionOfferingsInput, ...func(*Options)) (*DescribeCapacityBlockExtensionOfferingsOutput, error) +} + +var _ DescribeCapacityBlockExtensionOfferingsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opDescribeCapacityBlockExtensionOfferings(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeCapacityBlockExtensionOfferings", + } +} diff --git a/service/ec2/api_op_DescribeVpcBlockPublicAccessExclusions.go b/service/ec2/api_op_DescribeVpcBlockPublicAccessExclusions.go index ff5e76b9915..5a7a8753690 100644 --- a/service/ec2/api_op_DescribeVpcBlockPublicAccessExclusions.go +++ b/service/ec2/api_op_DescribeVpcBlockPublicAccessExclusions.go @@ -50,7 +50,7 @@ type DescribeVpcBlockPublicAccessExclusionsInput struct { // - resource-arn - The Amazon Resource Name (ARN) of a exclusion. // // - internet-gateway-exclusion-mode - The mode of a VPC BPA exclusion. Possible - // values: bidirectional-access-allowed | egress-access-allowed . + // values: allow-bidirectional | allow-egress . // // - state - The state of VPC BPA. Possible values: create-in-progress | // create-complete | update-in-progress | update-complete | delete-in-progress | diff --git a/service/ec2/api_op_DescribeVpcBlockPublicAccessOptions.go b/service/ec2/api_op_DescribeVpcBlockPublicAccessOptions.go index 520824c4f23..0a6b955d46e 100644 --- a/service/ec2/api_op_DescribeVpcBlockPublicAccessOptions.go +++ b/service/ec2/api_op_DescribeVpcBlockPublicAccessOptions.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Describe VPC Block Public Access (BPA) options. VPC Block public Access (BPA) +// Describe VPC Block Public Access (BPA) options. VPC Block Public Access (BPA) // enables you to block resources in VPCs and subnets that you own in a Region from // reaching or being reached from the internet through internet gateways and // egress-only internet gateways. To learn more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon diff --git a/service/ec2/api_op_GetCapacityReservationUsage.go b/service/ec2/api_op_GetCapacityReservationUsage.go index 9abe2178d4f..cb8c4f757c1 100644 --- a/service/ec2/api_op_GetCapacityReservationUsage.go +++ b/service/ec2/api_op_GetCapacityReservationUsage.go @@ -79,22 +79,38 @@ type GetCapacityReservationUsageOutput struct { // The current state of the Capacity Reservation. A Capacity Reservation can be in // one of the following states: // - // - active - The Capacity Reservation is active and the capacity is available - // for your use. + // - active - The capacity is available for use. // // - expired - The Capacity Reservation expired automatically at the date and - // time specified in your request. The reserved capacity is no longer available for - // your use. + // time specified in your reservation request. The reserved capacity is no longer + // available for your use. // - // - cancelled - The Capacity Reservation was cancelled. The reserved capacity is + // - cancelled - The Capacity Reservation was canceled. The reserved capacity is // no longer available for your use. // // - pending - The Capacity Reservation request was successful but the capacity // provisioning is still pending. // - // - failed - The Capacity Reservation request has failed. A request might fail - // due to invalid request parameters, capacity constraints, or instance limit - // constraints. Failed requests are retained for 60 minutes. + // - failed - The Capacity Reservation request has failed. A request can fail due + // to request parameters that are not valid, capacity constraints, or instance + // limit constraints. You can view a failed request for 60 minutes. + // + // - scheduled - (Future-dated Capacity Reservations only) The future-dated + // Capacity Reservation request was approved and the Capacity Reservation is + // scheduled for delivery on the requested start date. + // + // - assessing - (Future-dated Capacity Reservations only) Amazon EC2 is + // assessing your request for a future-dated Capacity Reservation. + // + // - delayed - (Future-dated Capacity Reservations only) Amazon EC2 encountered a + // delay in provisioning the requested future-dated Capacity Reservation. Amazon + // EC2 is unable to deliver the requested capacity by the requested start date and + // time. + // + // - unsupported - (Future-dated Capacity Reservations only) Amazon EC2 can't + // support the future-dated Capacity Reservation request due to capacity + // constraints. You can view unsupported requests for 30 days. The Capacity + // Reservation will not be delivered. State types.CapacityReservationState // The number of instances for which the Capacity Reservation reserves capacity. diff --git a/service/ec2/api_op_ModifyCapacityReservation.go b/service/ec2/api_op_ModifyCapacityReservation.go index 41fab81d025..8a90bd9fbaa 100644 --- a/service/ec2/api_op_ModifyCapacityReservation.go +++ b/service/ec2/api_op_ModifyCapacityReservation.go @@ -19,6 +19,22 @@ import ( // attributes, we recommend that you cancel the Capacity Reservation, and then // create a new one with the required attributes. For more information, see [Modify an active Capacity Reservation]. // +// The allowed modifications depend on the state of the Capacity Reservation: +// +// - assessing or scheduled state - You can modify the tags only. +// +// - pending state - You can't modify the Capacity Reservation in any way. +// +// - active state but still within the commitment duration - You can't decrease +// the instance count or set an end date that is within the commitment duration. +// All other modifications are allowed. +// +// - active state with no commitment duration or elapsed commitment duration - +// All modifications are allowed. +// +// - expired , cancelled , unsupported , or failed state - You can't modify the +// Capacity Reservation in any way. +// // [Modify an active Capacity Reservation]: https://docs.aws.amazon.com/AWSEC2/latest/UserGuide/capacity-reservations-modify.html func (c *Client) ModifyCapacityReservation(ctx context.Context, params *ModifyCapacityReservationInput, optFns ...func(*Options)) (*ModifyCapacityReservationOutput, error) { if params == nil { diff --git a/service/ec2/api_op_ModifyIpamResourceDiscovery.go b/service/ec2/api_op_ModifyIpamResourceDiscovery.go index 35c57a1a3c5..3eade00d38a 100644 --- a/service/ec2/api_op_ModifyIpamResourceDiscovery.go +++ b/service/ec2/api_op_ModifyIpamResourceDiscovery.go @@ -41,6 +41,15 @@ type ModifyIpamResourceDiscoveryInput struct { // select as operating Regions. AddOperatingRegions []types.AddIpamOperatingRegion + // Add an Organizational Unit (OU) exclusion to your IPAM. If your IPAM is + // integrated with Amazon Web Services Organizations and you add an organizational + // unit (OU) exclusion, IPAM will not manage the IP addresses in accounts in that + // OU exclusion. There is a limit on the number of exclusions you can create. For + // more information, see [Quotas for your IPAM]in the Amazon VPC IPAM User Guide. + // + // [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html + AddOrganizationalUnitExclusions []types.AddIpamOrganizationalUnitExclusion + // A resource discovery description. Description *string @@ -53,6 +62,15 @@ type ModifyIpamResourceDiscoveryInput struct { // Remove operating Regions. RemoveOperatingRegions []types.RemoveIpamOperatingRegion + // Remove an Organizational Unit (OU) exclusion to your IPAM. If your IPAM is + // integrated with Amazon Web Services Organizations and you add an organizational + // unit (OU) exclusion, IPAM will not manage the IP addresses in accounts in that + // OU exclusion. There is a limit on the number of exclusions you can create. For + // more information, see [Quotas for your IPAM]in the Amazon VPC IPAM User Guide. + // + // [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html + RemoveOrganizationalUnitExclusions []types.RemoveIpamOrganizationalUnitExclusion + noSmithyDocumentSerde } diff --git a/service/ec2/api_op_ModifyVpcBlockPublicAccessExclusion.go b/service/ec2/api_op_ModifyVpcBlockPublicAccessExclusion.go index 80fa7fee945..cc2a26f74a4 100644 --- a/service/ec2/api_op_ModifyVpcBlockPublicAccessExclusion.go +++ b/service/ec2/api_op_ModifyVpcBlockPublicAccessExclusion.go @@ -41,12 +41,12 @@ type ModifyVpcBlockPublicAccessExclusionInput struct { // The exclusion mode for internet gateway traffic. // - // - bidirectional-access-allowed : Allow all internet traffic to and from the - // excluded VPCs and subnets. + // - allow-bidirectional : Allow all internet traffic to and from the excluded + // VPCs and subnets. // - // - egress-access-allowed : Allow outbound internet traffic from the excluded - // VPCs and subnets. Block inbound internet traffic to the excluded VPCs and - // subnets. Only applies when VPC Block Public Access is set to Bidirectional. + // - allow-egress : Allow outbound internet traffic from the excluded VPCs and + // subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only + // applies when VPC Block Public Access is set to Bidirectional. // // This member is required. InternetGatewayExclusionMode types.InternetGatewayExclusionMode diff --git a/service/ec2/api_op_ModifyVpcBlockPublicAccessOptions.go b/service/ec2/api_op_ModifyVpcBlockPublicAccessOptions.go index d7a9ab4e711..2202604bd0e 100644 --- a/service/ec2/api_op_ModifyVpcBlockPublicAccessOptions.go +++ b/service/ec2/api_op_ModifyVpcBlockPublicAccessOptions.go @@ -11,7 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Modify VPC Block Public Access (BPA) options. VPC Block public Access (BPA) +// Modify VPC Block Public Access (BPA) options. VPC Block Public Access (BPA) // enables you to block resources in VPCs and subnets that you own in a Region from // reaching or being reached from the internet through internet gateways and // egress-only internet gateways. To learn more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon @@ -37,16 +37,16 @@ type ModifyVpcBlockPublicAccessOptionsInput struct { // The mode of VPC BPA. // - // - bidirectional-access-allowed : VPC BPA is not enabled and traffic is allowed - // to and from internet gateways and egress-only internet gateways in this Region. + // - off : VPC BPA is not enabled and traffic is allowed to and from internet + // gateways and egress-only internet gateways in this Region. // - // - bidirectional-access-blocked : Block all traffic to and from internet - // gateways and egress-only internet gateways in this Region (except for excluded - // VPCs and subnets). + // - block-bidirectional : Block all traffic to and from internet gateways and + // egress-only internet gateways in this Region (except for excluded VPCs and + // subnets). // - // - ingress-access-blocked : Block all internet traffic to the VPCs in this - // Region (except for VPCs or subnets which are excluded). Only traffic to and from - // NAT gateways and egress-only internet gateways is allowed because these gateways + // - block-ingress : Block all internet traffic to the VPCs in this Region + // (except for VPCs or subnets which are excluded). Only traffic to and from NAT + // gateways and egress-only internet gateways is allowed because these gateways // only allow outbound connections to be established. // // This member is required. diff --git a/service/ec2/api_op_PurchaseCapacityBlockExtension.go b/service/ec2/api_op_PurchaseCapacityBlockExtension.go new file mode 100644 index 00000000000..c907bf94877 --- /dev/null +++ b/service/ec2/api_op_PurchaseCapacityBlockExtension.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ec2 + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ec2/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Purchase the Capacity Block extension for use with your account. You must +// specify the ID of the Capacity Block extension offering you are purchasing. +func (c *Client) PurchaseCapacityBlockExtension(ctx context.Context, params *PurchaseCapacityBlockExtensionInput, optFns ...func(*Options)) (*PurchaseCapacityBlockExtensionOutput, error) { + if params == nil { + params = &PurchaseCapacityBlockExtensionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "PurchaseCapacityBlockExtension", params, optFns, c.addOperationPurchaseCapacityBlockExtensionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*PurchaseCapacityBlockExtensionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type PurchaseCapacityBlockExtensionInput struct { + + // The ID of the Capacity Block extension offering to purchase. + // + // This member is required. + CapacityBlockExtensionOfferingId *string + + // The ID of the Capacity reservation to be extended. + // + // This member is required. + CapacityReservationId *string + + // Checks whether you have the required permissions for the action, without + // actually making the request, and provides an error response. If you have the + // required permissions, the error response is DryRunOperation . Otherwise, it is + // UnauthorizedOperation . + DryRun *bool + + noSmithyDocumentSerde +} + +type PurchaseCapacityBlockExtensionOutput struct { + + // The purchased Capacity Block extensions. + CapacityBlockExtensions []types.CapacityBlockExtension + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationPurchaseCapacityBlockExtensionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsEc2query_serializeOpPurchaseCapacityBlockExtension{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsEc2query_deserializeOpPurchaseCapacityBlockExtension{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "PurchaseCapacityBlockExtension"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpPurchaseCapacityBlockExtensionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opPurchaseCapacityBlockExtension(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opPurchaseCapacityBlockExtension(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "PurchaseCapacityBlockExtension", + } +} diff --git a/service/ec2/deserializers.go b/service/ec2/deserializers.go index c284b408b07..56f51a0cd4e 100644 --- a/service/ec2/deserializers.go +++ b/service/ec2/deserializers.go @@ -21833,6 +21833,196 @@ func awsEc2query_deserializeOpErrorDescribeByoipCidrs(response *smithyhttp.Respo } } +type awsEc2query_deserializeOpDescribeCapacityBlockExtensionHistory struct { +} + +func (*awsEc2query_deserializeOpDescribeCapacityBlockExtensionHistory) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDescribeCapacityBlockExtensionHistory) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityBlockExtensionHistory(response, &metadata) + } + output := &DescribeCapacityBlockExtensionHistoryOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDescribeCapacityBlockExtensionHistoryOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorDescribeCapacityBlockExtensionHistory(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsEc2query_deserializeOpDescribeCapacityBlockExtensionOfferings struct { +} + +func (*awsEc2query_deserializeOpDescribeCapacityBlockExtensionOfferings) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpDescribeCapacityBlockExtensionOfferings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorDescribeCapacityBlockExtensionOfferings(response, &metadata) + } + output := &DescribeCapacityBlockExtensionOfferingsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentDescribeCapacityBlockExtensionOfferingsOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorDescribeCapacityBlockExtensionOfferings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpDescribeCapacityBlockOfferings struct { } @@ -54122,6 +54312,101 @@ func awsEc2query_deserializeOpErrorPurchaseCapacityBlock(response *smithyhttp.Re } } +type awsEc2query_deserializeOpPurchaseCapacityBlockExtension struct { +} + +func (*awsEc2query_deserializeOpPurchaseCapacityBlockExtension) ID() string { + return "OperationDeserializer" +} + +func (m *awsEc2query_deserializeOpPurchaseCapacityBlockExtension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsEc2query_deserializeOpErrorPurchaseCapacityBlockExtension(response, &metadata) + } + output := &PurchaseCapacityBlockExtensionOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + body := io.TeeReader(response.Body, ringBuffer) + rootDecoder := xml.NewDecoder(body) + t, err := smithyxml.FetchRootElement(rootDecoder) + if err == io.EOF { + return out, metadata, nil + } + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + decoder := smithyxml.WrapNodeDecoder(rootDecoder, t) + err = awsEc2query_deserializeOpDocumentPurchaseCapacityBlockExtensionOutput(&output, decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsEc2query_deserializeOpErrorPurchaseCapacityBlockExtension(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + errorComponents, err := ec2query.GetErrorResponseComponents(errorBody) + if err != nil { + return err + } + awsmiddleware.SetRequestIDMetadata(metadata, errorComponents.RequestID) + if len(errorComponents.Code) != 0 { + errorCode = errorComponents.Code + } + if len(errorComponents.Message) != 0 { + errorMessage = errorComponents.Message + } + errorBody.Seek(0, io.SeekStart) + switch { + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsEc2query_deserializeOpPurchaseHostReservation struct { } @@ -66316,6 +66601,579 @@ func awsEc2query_deserializeDocumentCapacityAllocationsUnwrapped(v *[]types.Capa *v = sv return nil } +func awsEc2query_deserializeDocumentCapacityBlockExtension(v **types.CapacityBlockExtension, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CapacityBlockExtension + if *v == nil { + sv = &types.CapacityBlockExtension{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("availabilityZone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZone = ptr.String(xtv) + } + + case strings.EqualFold("availabilityZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZoneId = ptr.String(xtv) + } + + case strings.EqualFold("capacityBlockExtensionDurationHours", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.CapacityBlockExtensionDurationHours = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("capacityBlockExtensionEndDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CapacityBlockExtensionEndDate = ptr.Time(t) + } + + case strings.EqualFold("capacityBlockExtensionOfferingId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CapacityBlockExtensionOfferingId = ptr.String(xtv) + } + + case strings.EqualFold("capacityBlockExtensionPurchaseDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CapacityBlockExtensionPurchaseDate = ptr.Time(t) + } + + case strings.EqualFold("capacityBlockExtensionStartDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CapacityBlockExtensionStartDate = ptr.Time(t) + } + + case strings.EqualFold("capacityBlockExtensionStatus", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CapacityBlockExtensionStatus = types.CapacityBlockExtensionStatus(xtv) + } + + case strings.EqualFold("capacityReservationId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CapacityReservationId = ptr.String(xtv) + } + + case strings.EqualFold("currencyCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CurrencyCode = ptr.String(xtv) + } + + case strings.EqualFold("instanceCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.InstanceCount = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("instanceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceType = ptr.String(xtv) + } + + case strings.EqualFold("upfrontFee", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UpfrontFee = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentCapacityBlockExtensionOffering(v **types.CapacityBlockExtensionOffering, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CapacityBlockExtensionOffering + if *v == nil { + sv = &types.CapacityBlockExtensionOffering{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("availabilityZone", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZone = ptr.String(xtv) + } + + case strings.EqualFold("availabilityZoneId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.AvailabilityZoneId = ptr.String(xtv) + } + + case strings.EqualFold("capacityBlockExtensionDurationHours", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.CapacityBlockExtensionDurationHours = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("capacityBlockExtensionEndDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CapacityBlockExtensionEndDate = ptr.Time(t) + } + + case strings.EqualFold("capacityBlockExtensionOfferingId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CapacityBlockExtensionOfferingId = ptr.String(xtv) + } + + case strings.EqualFold("capacityBlockExtensionStartDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CapacityBlockExtensionStartDate = ptr.Time(t) + } + + case strings.EqualFold("currencyCode", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.CurrencyCode = ptr.String(xtv) + } + + case strings.EqualFold("instanceCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.InstanceCount = ptr.Int32(int32(i64)) + } + + case strings.EqualFold("instanceType", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.InstanceType = ptr.String(xtv) + } + + case strings.EqualFold("startDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.StartDate = ptr.Time(t) + } + + case strings.EqualFold("tenancy", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.Tenancy = types.CapacityReservationTenancy(xtv) + } + + case strings.EqualFold("upfrontFee", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.UpfrontFee = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentCapacityBlockExtensionOfferingSet(v *[]types.CapacityBlockExtensionOffering, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.CapacityBlockExtensionOffering + if *v == nil { + sv = make([]types.CapacityBlockExtensionOffering, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.CapacityBlockExtensionOffering + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentCapacityBlockExtensionOffering(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentCapacityBlockExtensionOfferingSetUnwrapped(v *[]types.CapacityBlockExtensionOffering, decoder smithyxml.NodeDecoder) error { + var sv []types.CapacityBlockExtensionOffering + if *v == nil { + sv = make([]types.CapacityBlockExtensionOffering, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.CapacityBlockExtensionOffering + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentCapacityBlockExtensionOffering(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} +func awsEc2query_deserializeDocumentCapacityBlockExtensionSet(v *[]types.CapacityBlockExtension, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.CapacityBlockExtension + if *v == nil { + sv = make([]types.CapacityBlockExtension, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.CapacityBlockExtension + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentCapacityBlockExtension(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentCapacityBlockExtensionSetUnwrapped(v *[]types.CapacityBlockExtension, decoder smithyxml.NodeDecoder) error { + var sv []types.CapacityBlockExtension + if *v == nil { + sv = make([]types.CapacityBlockExtension, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.CapacityBlockExtension + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentCapacityBlockExtension(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentCapacityBlockOffering(v **types.CapacityBlockOffering, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -66368,6 +67226,23 @@ func awsEc2query_deserializeDocumentCapacityBlockOffering(v **types.CapacityBloc sv.CapacityBlockDurationHours = ptr.Int32(int32(i64)) } + case strings.EqualFold("capacityBlockDurationMinutes", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.CapacityBlockDurationMinutes = ptr.Int32(int32(i64)) + } + case strings.EqualFold("capacityBlockOfferingId", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -66676,6 +67551,12 @@ func awsEc2query_deserializeDocumentCapacityReservation(v **types.CapacityReserv sv.CapacityReservationId = ptr.String(xtv) } + case strings.EqualFold("commitmentInfo", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentCapacityReservationCommitmentInfo(&sv.CommitmentInfo, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("createDate", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -66693,6 +67574,19 @@ func awsEc2query_deserializeDocumentCapacityReservation(v **types.CapacityReserv sv.CreateDate = ptr.Time(t) } + case strings.EqualFold("deliveryPreference", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.DeliveryPreference = types.CapacityReservationDeliveryPreference(xtv) + } + case strings.EqualFold("ebsOptimized", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -67131,6 +68025,76 @@ func awsEc2query_deserializeDocumentCapacityReservationBillingRequestSetUnwrappe *v = sv return nil } +func awsEc2query_deserializeDocumentCapacityReservationCommitmentInfo(v **types.CapacityReservationCommitmentInfo, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.CapacityReservationCommitmentInfo + if *v == nil { + sv = &types.CapacityReservationCommitmentInfo{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("commitmentEndDate", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + t, err := smithytime.ParseDateTime(xtv) + if err != nil { + return err + } + sv.CommitmentEndDate = ptr.Time(t) + } + + case strings.EqualFold("committedInstanceCount", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + i64, err := strconv.ParseInt(xtv, 10, 64) + if err != nil { + return err + } + sv.CommittedInstanceCount = ptr.Int32(int32(i64)) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeDocumentCapacityReservationFleet(v **types.CapacityReservationFleet, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -94857,6 +95821,19 @@ func awsEc2query_deserializeDocumentIpamDiscoveredAccount(v **types.IpamDiscover sv.LastSuccessfulDiscoveryTime = ptr.Time(t) } + case strings.EqualFold("organizationalUnitId", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OrganizationalUnitId = ptr.String(xtv) + } + default: // Do nothing and ignore the unexpected tag element err = decoder.Decoder.Skip() @@ -95990,6 +96967,123 @@ func awsEc2query_deserializeDocumentIpamOperatingRegionSetUnwrapped(v *[]types.I *v = sv return nil } +func awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusion(v **types.IpamOrganizationalUnitExclusion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.IpamOrganizationalUnitExclusion + if *v == nil { + sv = &types.IpamOrganizationalUnitExclusion{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("organizationsEntityPath", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.OrganizationsEntityPath = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusionSet(v *[]types.IpamOrganizationalUnitExclusion, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv []types.IpamOrganizationalUnitExclusion + if *v == nil { + sv = make([]types.IpamOrganizationalUnitExclusion, 0) + } else { + sv = *v + } + + originalDecoder := decoder + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + switch { + case strings.EqualFold("item", t.Name.Local): + var col types.IpamOrganizationalUnitExclusion + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &col + if err := awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusion(&destAddr, nodeDecoder); err != nil { + return err + } + col = *destAddr + sv = append(sv, col) + + default: + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusionSetUnwrapped(v *[]types.IpamOrganizationalUnitExclusion, decoder smithyxml.NodeDecoder) error { + var sv []types.IpamOrganizationalUnitExclusion + if *v == nil { + sv = make([]types.IpamOrganizationalUnitExclusion, 0) + } else { + sv = *v + } + + switch { + default: + var mv types.IpamOrganizationalUnitExclusion + t := decoder.StartEl + _ = t + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + destAddr := &mv + if err := awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusion(&destAddr, nodeDecoder); err != nil { + return err + } + mv = *destAddr + sv = append(sv, mv) + } + *v = sv + return nil +} func awsEc2query_deserializeDocumentIpamPool(v **types.IpamPool, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -97625,6 +98719,12 @@ func awsEc2query_deserializeDocumentIpamResourceDiscovery(v **types.IpamResource return err } + case strings.EqualFold("organizationalUnitExclusionSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentIpamOrganizationalUnitExclusionSet(&sv.OrganizationalUnitExclusions, nodeDecoder); err != nil { + return err + } + case strings.EqualFold("ownerId", t.Name.Local): val, err := decoder.Value() if err != nil { @@ -157552,6 +158652,116 @@ func awsEc2query_deserializeOpDocumentDescribeByoipCidrsOutput(v **DescribeByoip return nil } +func awsEc2query_deserializeOpDocumentDescribeCapacityBlockExtensionHistoryOutput(v **DescribeCapacityBlockExtensionHistoryOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeCapacityBlockExtensionHistoryOutput + if *v == nil { + sv = &DescribeCapacityBlockExtensionHistoryOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("capacityBlockExtensionSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentCapacityBlockExtensionSet(&sv.CapacityBlockExtensions, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("nextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + +func awsEc2query_deserializeOpDocumentDescribeCapacityBlockExtensionOfferingsOutput(v **DescribeCapacityBlockExtensionOfferingsOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *DescribeCapacityBlockExtensionOfferingsOutput + if *v == nil { + sv = &DescribeCapacityBlockExtensionOfferingsOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("capacityBlockExtensionOfferingSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentCapacityBlockExtensionOfferingSet(&sv.CapacityBlockExtensionOfferings, nodeDecoder); err != nil { + return err + } + + case strings.EqualFold("nextToken", t.Name.Local): + val, err := decoder.Value() + if err != nil { + return err + } + if val == nil { + break + } + { + xtv := string(val) + sv.NextToken = ptr.String(xtv) + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentDescribeCapacityBlockOfferingsOutput(v **DescribeCapacityBlockOfferingsOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -175884,6 +177094,48 @@ func awsEc2query_deserializeOpDocumentProvisionPublicIpv4PoolCidrOutput(v **Prov return nil } +func awsEc2query_deserializeOpDocumentPurchaseCapacityBlockExtensionOutput(v **PurchaseCapacityBlockExtensionOutput, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *PurchaseCapacityBlockExtensionOutput + if *v == nil { + sv = &PurchaseCapacityBlockExtensionOutput{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + case strings.EqualFold("capacityBlockExtensionSet", t.Name.Local): + nodeDecoder := smithyxml.WrapNodeDecoder(decoder.Decoder, t) + if err := awsEc2query_deserializeDocumentCapacityBlockExtensionSet(&sv.CapacityBlockExtensions, nodeDecoder); err != nil { + return err + } + + default: + // Do nothing and ignore the unexpected tag element + err = decoder.Decoder.Skip() + if err != nil { + return err + } + + } + decoder = originalDecoder + } + *v = sv + return nil +} + func awsEc2query_deserializeOpDocumentPurchaseCapacityBlockOutput(v **PurchaseCapacityBlockOutput, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ec2/generated.json b/service/ec2/generated.json index e21f02f5ecb..63cdf4d29d4 100644 --- a/service/ec2/generated.json +++ b/service/ec2/generated.json @@ -247,6 +247,8 @@ "api_op_DescribeAwsNetworkPerformanceMetricSubscriptions.go", "api_op_DescribeBundleTasks.go", "api_op_DescribeByoipCidrs.go", + "api_op_DescribeCapacityBlockExtensionHistory.go", + "api_op_DescribeCapacityBlockExtensionOfferings.go", "api_op_DescribeCapacityBlockOfferings.go", "api_op_DescribeCapacityReservationBillingRequests.go", "api_op_DescribeCapacityReservationFleets.go", @@ -591,6 +593,7 @@ "api_op_ProvisionIpamPoolCidr.go", "api_op_ProvisionPublicIpv4PoolCidr.go", "api_op_PurchaseCapacityBlock.go", + "api_op_PurchaseCapacityBlockExtension.go", "api_op_PurchaseHostReservation.go", "api_op_PurchaseReservedInstancesOffering.go", "api_op_PurchaseScheduledInstances.go", diff --git a/service/ec2/serializers.go b/service/ec2/serializers.go index 9c3c4502d2e..302d22b086b 100644 --- a/service/ec2/serializers.go +++ b/service/ec2/serializers.go @@ -16538,6 +16538,146 @@ func (m *awsEc2query_serializeOpDescribeByoipCidrs) HandleSerialize(ctx context. return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpDescribeCapacityBlockExtensionHistory struct { +} + +func (*awsEc2query_serializeOpDescribeCapacityBlockExtensionHistory) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDescribeCapacityBlockExtensionHistory) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeCapacityBlockExtensionHistoryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeCapacityBlockExtensionHistory") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDescribeCapacityBlockExtensionHistoryInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsEc2query_serializeOpDescribeCapacityBlockExtensionOfferings struct { +} + +func (*awsEc2query_serializeOpDescribeCapacityBlockExtensionOfferings) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpDescribeCapacityBlockExtensionOfferings) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeCapacityBlockExtensionOfferingsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("DescribeCapacityBlockExtensionOfferings") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentDescribeCapacityBlockExtensionOfferingsInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpDescribeCapacityBlockOfferings struct { } @@ -40618,6 +40758,76 @@ func (m *awsEc2query_serializeOpPurchaseCapacityBlock) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } +type awsEc2query_serializeOpPurchaseCapacityBlockExtension struct { +} + +func (*awsEc2query_serializeOpPurchaseCapacityBlockExtension) ID() string { + return "OperationSerializer" +} + +func (m *awsEc2query_serializeOpPurchaseCapacityBlockExtension) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*PurchaseCapacityBlockExtensionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-www-form-urlencoded") + + bodyWriter := bytes.NewBuffer(nil) + bodyEncoder := query.NewEncoder(bodyWriter) + body := bodyEncoder.Object() + body.Key("Action").String("PurchaseCapacityBlockExtension") + body.Key("Version").String("2016-11-15") + + if err := awsEc2query_serializeOpDocumentPurchaseCapacityBlockExtensionInput(input, bodyEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + err = bodyEncoder.Encode() + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(bodyWriter.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsEc2query_serializeOpPurchaseHostReservation struct { } @@ -45217,6 +45427,33 @@ func awsEc2query_serializeDocumentAddIpamOperatingRegionSet(v []types.AddIpamOpe return nil } +func awsEc2query_serializeDocumentAddIpamOrganizationalUnitExclusion(v *types.AddIpamOrganizationalUnitExclusion, value query.Value) error { + object := value.Object() + _ = object + + if v.OrganizationsEntityPath != nil { + objectKey := object.Key("OrganizationsEntityPath") + objectKey.String(*v.OrganizationsEntityPath) + } + + return nil +} + +func awsEc2query_serializeDocumentAddIpamOrganizationalUnitExclusionSet(v []types.AddIpamOrganizationalUnitExclusion, value query.Value) error { + if len(v) == 0 { + return nil + } + array := value.Array("Member") + + for i := range v { + av := array.Value() + if err := awsEc2query_serializeDocumentAddIpamOrganizationalUnitExclusion(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsEc2query_serializeDocumentAddPrefixListEntries(v []types.AddPrefixListEntry, value query.Value) error { if len(v) == 0 { return nil @@ -51627,6 +51864,33 @@ func awsEc2query_serializeDocumentRemoveIpamOperatingRegionSet(v []types.RemoveI return nil } +func awsEc2query_serializeDocumentRemoveIpamOrganizationalUnitExclusion(v *types.RemoveIpamOrganizationalUnitExclusion, value query.Value) error { + object := value.Object() + _ = object + + if v.OrganizationsEntityPath != nil { + objectKey := object.Key("OrganizationsEntityPath") + objectKey.String(*v.OrganizationsEntityPath) + } + + return nil +} + +func awsEc2query_serializeDocumentRemoveIpamOrganizationalUnitExclusionSet(v []types.RemoveIpamOrganizationalUnitExclusion, value query.Value) error { + if len(v) == 0 { + return nil + } + array := value.Array("Member") + + for i := range v { + av := array.Value() + if err := awsEc2query_serializeDocumentRemoveIpamOrganizationalUnitExclusion(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsEc2query_serializeDocumentRemovePrefixListEntries(v []types.RemovePrefixListEntry, value query.Value) error { if len(v) == 0 { return nil @@ -56898,6 +57162,16 @@ func awsEc2query_serializeOpDocumentCreateCapacityReservationInput(v *CreateCapa objectKey.String(*v.ClientToken) } + if v.CommitmentDuration != nil { + objectKey := object.Key("CommitmentDuration") + objectKey.Long(*v.CommitmentDuration) + } + + if len(v.DeliveryPreference) > 0 { + objectKey := object.Key("DeliveryPreference") + objectKey.String(string(v.DeliveryPreference)) + } + if v.DryRun != nil { objectKey := object.Key("DryRun") objectKey.Boolean(*v.DryRun) @@ -56953,6 +57227,11 @@ func awsEc2query_serializeOpDocumentCreateCapacityReservationInput(v *CreateCapa objectKey.String(*v.PlacementGroupArn) } + if v.StartDate != nil { + objectKey := object.Key("StartDate") + objectKey.String(smithytime.FormatDateTime(*v.StartDate)) + } + if v.TagSpecifications != nil { objectKey := object.FlatKey("TagSpecifications") if err := awsEc2query_serializeDocumentTagSpecificationList(v.TagSpecifications, objectKey); err != nil { @@ -62458,6 +62737,74 @@ func awsEc2query_serializeOpDocumentDescribeByoipCidrsInput(v *DescribeByoipCidr return nil } +func awsEc2query_serializeOpDocumentDescribeCapacityBlockExtensionHistoryInput(v *DescribeCapacityBlockExtensionHistoryInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CapacityReservationIds != nil { + objectKey := object.FlatKey("CapacityReservationId") + if err := awsEc2query_serializeDocumentCapacityReservationIdSet(v.CapacityReservationIds, objectKey); err != nil { + return err + } + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.Filters != nil { + objectKey := object.FlatKey("Filter") + if err := awsEc2query_serializeDocumentFilterList(v.Filters, objectKey); err != nil { + return err + } + } + + if v.MaxResults != nil { + objectKey := object.Key("MaxResults") + objectKey.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + +func awsEc2query_serializeOpDocumentDescribeCapacityBlockExtensionOfferingsInput(v *DescribeCapacityBlockExtensionOfferingsInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CapacityBlockExtensionDurationHours != nil { + objectKey := object.Key("CapacityBlockExtensionDurationHours") + objectKey.Integer(*v.CapacityBlockExtensionDurationHours) + } + + if v.CapacityReservationId != nil { + objectKey := object.Key("CapacityReservationId") + objectKey.String(*v.CapacityReservationId) + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + if v.MaxResults != nil { + objectKey := object.Key("MaxResults") + objectKey.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + objectKey := object.Key("NextToken") + objectKey.String(*v.NextToken) + } + + return nil +} + func awsEc2query_serializeOpDocumentDescribeCapacityBlockOfferingsInput(v *DescribeCapacityBlockOfferingsInput, value query.Value) error { object := value.Object() _ = object @@ -71671,6 +72018,13 @@ func awsEc2query_serializeOpDocumentModifyIpamResourceDiscoveryInput(v *ModifyIp } } + if v.AddOrganizationalUnitExclusions != nil { + objectKey := object.FlatKey("AddOrganizationalUnitExclusion") + if err := awsEc2query_serializeDocumentAddIpamOrganizationalUnitExclusionSet(v.AddOrganizationalUnitExclusions, objectKey); err != nil { + return err + } + } + if v.Description != nil { objectKey := object.Key("Description") objectKey.String(*v.Description) @@ -71693,6 +72047,13 @@ func awsEc2query_serializeOpDocumentModifyIpamResourceDiscoveryInput(v *ModifyIp } } + if v.RemoveOrganizationalUnitExclusions != nil { + objectKey := object.FlatKey("RemoveOrganizationalUnitExclusion") + if err := awsEc2query_serializeDocumentRemoveIpamOrganizationalUnitExclusionSet(v.RemoveOrganizationalUnitExclusions, objectKey); err != nil { + return err + } + } + return nil } @@ -73507,6 +73868,28 @@ func awsEc2query_serializeOpDocumentProvisionPublicIpv4PoolCidrInput(v *Provisio return nil } +func awsEc2query_serializeOpDocumentPurchaseCapacityBlockExtensionInput(v *PurchaseCapacityBlockExtensionInput, value query.Value) error { + object := value.Object() + _ = object + + if v.CapacityBlockExtensionOfferingId != nil { + objectKey := object.Key("CapacityBlockExtensionOfferingId") + objectKey.String(*v.CapacityBlockExtensionOfferingId) + } + + if v.CapacityReservationId != nil { + objectKey := object.Key("CapacityReservationId") + objectKey.String(*v.CapacityReservationId) + } + + if v.DryRun != nil { + objectKey := object.Key("DryRun") + objectKey.Boolean(*v.DryRun) + } + + return nil +} + func awsEc2query_serializeOpDocumentPurchaseCapacityBlockInput(v *PurchaseCapacityBlockInput, value query.Value) error { object := value.Object() _ = object diff --git a/service/ec2/snapshot/api_op_DescribeCapacityBlockExtensionHistory.go.snap b/service/ec2/snapshot/api_op_DescribeCapacityBlockExtensionHistory.go.snap new file mode 100644 index 00000000000..ed6e8854adf --- /dev/null +++ b/service/ec2/snapshot/api_op_DescribeCapacityBlockExtensionHistory.go.snap @@ -0,0 +1,40 @@ +DescribeCapacityBlockExtensionHistory + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ec2/snapshot/api_op_DescribeCapacityBlockExtensionOfferings.go.snap b/service/ec2/snapshot/api_op_DescribeCapacityBlockExtensionOfferings.go.snap new file mode 100644 index 00000000000..a3287710ceb --- /dev/null +++ b/service/ec2/snapshot/api_op_DescribeCapacityBlockExtensionOfferings.go.snap @@ -0,0 +1,41 @@ +DescribeCapacityBlockExtensionOfferings + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ec2/snapshot/api_op_PurchaseCapacityBlockExtension.go.snap b/service/ec2/snapshot/api_op_PurchaseCapacityBlockExtension.go.snap new file mode 100644 index 00000000000..1cd77866cdf --- /dev/null +++ b/service/ec2/snapshot/api_op_PurchaseCapacityBlockExtension.go.snap @@ -0,0 +1,41 @@ +PurchaseCapacityBlockExtension + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ec2/snapshot_test.go b/service/ec2/snapshot_test.go index 16402fc5b66..e4a1c4e4c7b 100644 --- a/service/ec2/snapshot_test.go +++ b/service/ec2/snapshot_test.go @@ -2894,6 +2894,30 @@ func TestCheckSnapshot_DescribeByoipCidrs(t *testing.T) { } } +func TestCheckSnapshot_DescribeCapacityBlockExtensionHistory(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeCapacityBlockExtensionHistory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeCapacityBlockExtensionHistory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DescribeCapacityBlockExtensionOfferings(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeCapacityBlockExtensionOfferings(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeCapacityBlockExtensionOfferings") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeCapacityBlockOfferings(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeCapacityBlockOfferings(context.Background(), nil, func(o *Options) { @@ -7022,6 +7046,18 @@ func TestCheckSnapshot_PurchaseCapacityBlock(t *testing.T) { } } +func TestCheckSnapshot_PurchaseCapacityBlockExtension(t *testing.T) { + svc := New(Options{}) + _, err := svc.PurchaseCapacityBlockExtension(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "PurchaseCapacityBlockExtension") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_PurchaseHostReservation(t *testing.T) { svc := New(Options{}) _, err := svc.PurchaseHostReservation(context.Background(), nil, func(o *Options) { @@ -10609,6 +10645,30 @@ func TestUpdateSnapshot_DescribeByoipCidrs(t *testing.T) { } } +func TestUpdateSnapshot_DescribeCapacityBlockExtensionHistory(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeCapacityBlockExtensionHistory(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeCapacityBlockExtensionHistory") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DescribeCapacityBlockExtensionOfferings(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeCapacityBlockExtensionOfferings(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeCapacityBlockExtensionOfferings") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeCapacityBlockOfferings(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeCapacityBlockOfferings(context.Background(), nil, func(o *Options) { @@ -14737,6 +14797,18 @@ func TestUpdateSnapshot_PurchaseCapacityBlock(t *testing.T) { } } +func TestUpdateSnapshot_PurchaseCapacityBlockExtension(t *testing.T) { + svc := New(Options{}) + _, err := svc.PurchaseCapacityBlockExtension(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "PurchaseCapacityBlockExtension") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_PurchaseHostReservation(t *testing.T) { svc := New(Options{}) _, err := svc.PurchaseHostReservation(context.Background(), nil, func(o *Options) { diff --git a/service/ec2/types/enums.go b/service/ec2/types/enums.go index 51930fa6a91..5997b036260 100644 --- a/service/ec2/types/enums.go +++ b/service/ec2/types/enums.go @@ -905,6 +905,28 @@ func (CancelSpotInstanceRequestState) Values() []CancelSpotInstanceRequestState } } +type CapacityBlockExtensionStatus string + +// Enum values for CapacityBlockExtensionStatus +const ( + CapacityBlockExtensionStatusPaymentPending CapacityBlockExtensionStatus = "payment-pending" + CapacityBlockExtensionStatusPaymentFailed CapacityBlockExtensionStatus = "payment-failed" + CapacityBlockExtensionStatusPaymentSucceeded CapacityBlockExtensionStatus = "payment-succeeded" +) + +// Values returns all known values for CapacityBlockExtensionStatus. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (CapacityBlockExtensionStatus) Values() []CapacityBlockExtensionStatus { + return []CapacityBlockExtensionStatus{ + "payment-pending", + "payment-failed", + "payment-succeeded", + } +} + type CapacityReservationBillingRequestStatus string // Enum values for CapacityReservationBillingRequestStatus @@ -933,6 +955,26 @@ func (CapacityReservationBillingRequestStatus) Values() []CapacityReservationBil } } +type CapacityReservationDeliveryPreference string + +// Enum values for CapacityReservationDeliveryPreference +const ( + CapacityReservationDeliveryPreferenceFixed CapacityReservationDeliveryPreference = "fixed" + CapacityReservationDeliveryPreferenceIncremental CapacityReservationDeliveryPreference = "incremental" +) + +// Values returns all known values for CapacityReservationDeliveryPreference. Note +// that this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (CapacityReservationDeliveryPreference) Values() []CapacityReservationDeliveryPreference { + return []CapacityReservationDeliveryPreference{ + "fixed", + "incremental", + } +} + type CapacityReservationFleetState string // Enum values for CapacityReservationFleetState @@ -1053,6 +1095,9 @@ const ( CapacityReservationStateScheduled CapacityReservationState = "scheduled" CapacityReservationStatePaymentPending CapacityReservationState = "payment-pending" CapacityReservationStatePaymentFailed CapacityReservationState = "payment-failed" + CapacityReservationStateAssessing CapacityReservationState = "assessing" + CapacityReservationStateDelayed CapacityReservationState = "delayed" + CapacityReservationStateUnsupported CapacityReservationState = "unsupported" ) // Values returns all known values for CapacityReservationState. Note that this @@ -1069,6 +1114,9 @@ func (CapacityReservationState) Values() []CapacityReservationState { "scheduled", "payment-pending", "payment-failed", + "assessing", + "delayed", + "unsupported", } } diff --git a/service/ec2/types/types.go b/service/ec2/types/types.go index 1976730985f..4020c5cbdf6 100644 --- a/service/ec2/types/types.go +++ b/service/ec2/types/types.go @@ -190,6 +190,47 @@ type AddIpamOperatingRegion struct { noSmithyDocumentSerde } +// Add an Organizational Unit (OU) exclusion to your IPAM. If your IPAM is +// integrated with Amazon Web Services Organizations and you add an organizational +// unit (OU) exclusion, IPAM will not manage the IP addresses in accounts in that +// OU exclusion. There is a limit on the number of exclusions you can create. For +// more information, see [Quotas for your IPAM]in the Amazon VPC IPAM User Guide. +// +// [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html +type AddIpamOrganizationalUnitExclusion struct { + + // An Amazon Web Services Organizations entity path. Build the path for the OU(s) + // using Amazon Web Services Organizations IDs separated by a / . Include all child + // OUs by ending the path with /* . + // + // - Example 1 + // + // - Path to a child OU: + // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/ou-jkl0-awsddddd/ + // + // - In this example, o-a1b2c3d4e5 is the organization ID, r-f6g7h8i9j0example is + // the root ID , ou-ghi0-awsccccc is an OU ID, and ou-jkl0-awsddddd is a child OU + // ID. + // + // - IPAM will not manage the IP addresses in accounts in the child OU. + // + // - Example 2 + // + // - Path where all child OUs will be part of the exclusion: + // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/* + // + // - In this example, IPAM will not manage the IP addresses in accounts in the + // OU ( ou-ghi0-awsccccc ) or in accounts in any OUs that are children of the OU. + // + // For more information on how to construct an entity path, see [Understand the Amazon Web Services Organizations entity path] in the Amazon Web + // Services Identity and Access Management User Guide. + // + // [Understand the Amazon Web Services Organizations entity path]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_last-accessed-view-data-orgs.html#access_policies_access-advisor-viewing-orgs-entity-path + OrganizationsEntityPath *string + + noSmithyDocumentSerde +} + // Describes an additional detail for a path analysis. For more information, see [Reachability Analyzer additional detail codes]. // // [Reachability Analyzer additional detail codes]: https://docs.aws.amazon.com/vpc/latest/reachability/additional-detail-codes.html @@ -938,16 +979,16 @@ type BlockPublicAccessStates struct { // The mode of VPC BPA. // - // - bidirectional-access-allowed : VPC BPA is not enabled and traffic is allowed - // to and from internet gateways and egress-only internet gateways in this Region. + // - off : VPC BPA is not enabled and traffic is allowed to and from internet + // gateways and egress-only internet gateways in this Region. // - // - bidirectional-access-blocked : Block all traffic to and from internet - // gateways and egress-only internet gateways in this Region (except for excluded - // VPCs and subnets). + // - block-bidirectional : Block all traffic to and from internet gateways and + // egress-only internet gateways in this Region (except for excluded VPCs and + // subnets). // - // - ingress-access-blocked : Block all internet traffic to the VPCs in this - // Region (except for VPCs or subnets which are excluded). Only traffic to and from - // NAT gateways and egress-only internet gateways is allowed because these gateways + // - block-ingress : Block all internet traffic to the VPCs in this Region + // (except for VPCs or subnets which are excluded). Only traffic to and from NAT + // gateways and egress-only internet gateways is allowed because these gateways // only allow outbound connections to be established. InternetGatewayBlockMode BlockPublicAccessMode @@ -1158,15 +1199,134 @@ type CapacityAllocation struct { noSmithyDocumentSerde } +// Describes a Capacity Block extension. With an extension, you can extend the +// duration of time for an existing Capacity Block. +type CapacityBlockExtension struct { + + // The Availability Zone of the Capacity Block extension. + AvailabilityZone *string + + // The Availability Zone ID of the Capacity Block extension. + AvailabilityZoneId *string + + // The duration of the Capacity Block extension in hours. + CapacityBlockExtensionDurationHours *int32 + + // The end date of the Capacity Block extension. + CapacityBlockExtensionEndDate *time.Time + + // The ID of the Capacity Block extension offering. + CapacityBlockExtensionOfferingId *string + + // The date when the Capacity Block extension was purchased. + CapacityBlockExtensionPurchaseDate *time.Time + + // The start date of the Capacity Block extension. + CapacityBlockExtensionStartDate *time.Time + + // The status of the Capacity Block extension. A Capacity Block extension can have + // one of the following statuses: + // + // - payment-pending - The Capacity Block extension payment is processing. If + // your payment can't be processed within 12 hours, the Capacity Block extension is + // failed. + // + // - payment-failed - Payment for the Capacity Block extension request was not + // successful. + // + // - payment-succeeded - Payment for the Capacity Block extension request was + // successful. You receive an invoice that reflects the one-time upfront payment. + // In the invoice, you can associate the paid amount with the Capacity Block + // reservation ID. + CapacityBlockExtensionStatus CapacityBlockExtensionStatus + + // The reservation ID of the Capacity Block extension. + CapacityReservationId *string + + // The currency of the payment for the Capacity Block extension. + CurrencyCode *string + + // The number of instances in the Capacity Block extension. + InstanceCount *int32 + + // The instance type of the Capacity Block extension. + InstanceType *string + + // The total price to be paid up front. + UpfrontFee *string + + noSmithyDocumentSerde +} + +// The recommended Capacity Block extension that fits your search requirements. +type CapacityBlockExtensionOffering struct { + + // The Availability Zone of the Capacity Block that will be extended. + AvailabilityZone *string + + // The Availability Zone ID of the Capacity Block that will be extended. + AvailabilityZoneId *string + + // The amount of time of the Capacity Block extension offering in hours. + CapacityBlockExtensionDurationHours *int32 + + // The date and time at which the Capacity Block extension expires. When a + // Capacity Block expires, the reserved capacity is released and you can no longer + // launch instances into it. The Capacity Block's state changes to expired when it + // reaches its end date + CapacityBlockExtensionEndDate *time.Time + + // The ID of the Capacity Block extension offering. + CapacityBlockExtensionOfferingId *string + + // The date and time at which the Capacity Block extension will start. This date + // is also the same as the end date of the Capacity Block that will be extended. + CapacityBlockExtensionStartDate *time.Time + + // The currency of the payment for the Capacity Block extension offering. + CurrencyCode *string + + // The number of instances in the Capacity Block extension offering. + InstanceCount *int32 + + // The instance type of the Capacity Block that will be extended. + InstanceType *string + + // The start date of the Capacity Block that will be extended. + StartDate *time.Time + + // Indicates the tenancy of the Capacity Block extension offering. A Capacity + // Block can have one of the following tenancy settings: + // + // - default - The Capacity Block is created on hardware that is shared with + // other Amazon Web Services accounts. + // + // - dedicated - The Capacity Block is created on single-tenant hardware that is + // dedicated to a single Amazon Web Services account. + Tenancy CapacityReservationTenancy + + // The total price of the Capacity Block extension offering, to be paid up front. + UpfrontFee *string + + noSmithyDocumentSerde +} + // The recommended Capacity Block that fits your search requirements. type CapacityBlockOffering struct { // The Availability Zone of the Capacity Block offering. AvailabilityZone *string - // The amount of time of the Capacity Block reservation in hours. + // The number of hours (in addition to capacityBlockDurationMinutes ) for the + // duration of the Capacity Block reservation. For example, if a Capacity Block + // starts at 04:55 and ends at 11:30, the hours field would be 6. CapacityBlockDurationHours *int32 + // The number of minutes (in addition to capacityBlockDurationHours ) for the + // duration of the Capacity Block reservation. For example, if a Capacity Block + // starts at 08:55 and ends at 11:30, the minutes field would be 35. + CapacityBlockDurationMinutes *int32 + // The ID of the Capacity Block offering. CapacityBlockOfferingId *string @@ -1221,9 +1381,18 @@ type CapacityReservation struct { // The ID of the Capacity Reservation. CapacityReservationId *string + // Information about your commitment for a future-dated Capacity Reservation. + CommitmentInfo *CapacityReservationCommitmentInfo + // The date and time at which the Capacity Reservation was created. CreateDate *time.Time + // The delivery method for a future-dated Capacity Reservation. incremental + // indicates that the requested capacity is delivered in addition to any running + // instances and reserved capacity that you have in your account at the requested + // date and time. + DeliveryPreference CapacityReservationDeliveryPreference + // Indicates whether the Capacity Reservation supports EBS-optimized instances. // This optimization provides dedicated throughput to Amazon EBS and an optimized // configuration stack to provide optimal I/O performance. This optimization isn't @@ -1294,22 +1463,38 @@ type CapacityReservation struct { // The current state of the Capacity Reservation. A Capacity Reservation can be in // one of the following states: // - // - active - The Capacity Reservation is active and the capacity is available - // for your use. + // - active - The capacity is available for use. // // - expired - The Capacity Reservation expired automatically at the date and - // time specified in your request. The reserved capacity is no longer available for - // your use. + // time specified in your reservation request. The reserved capacity is no longer + // available for your use. // - // - cancelled - The Capacity Reservation was cancelled. The reserved capacity is + // - cancelled - The Capacity Reservation was canceled. The reserved capacity is // no longer available for your use. // // - pending - The Capacity Reservation request was successful but the capacity // provisioning is still pending. // - // - failed - The Capacity Reservation request has failed. A request might fail - // due to invalid request parameters, capacity constraints, or instance limit - // constraints. Failed requests are retained for 60 minutes. + // - failed - The Capacity Reservation request has failed. A request can fail due + // to request parameters that are not valid, capacity constraints, or instance + // limit constraints. You can view a failed request for 60 minutes. + // + // - scheduled - (Future-dated Capacity Reservations only) The future-dated + // Capacity Reservation request was approved and the Capacity Reservation is + // scheduled for delivery on the requested start date. + // + // - assessing - (Future-dated Capacity Reservations only) Amazon EC2 is + // assessing your request for a future-dated Capacity Reservation. + // + // - delayed - (Future-dated Capacity Reservations only) Amazon EC2 encountered a + // delay in provisioning the requested future-dated Capacity Reservation. Amazon + // EC2 is unable to deliver the requested capacity by the requested start date and + // time. + // + // - unsupported - (Future-dated Capacity Reservations only) Amazon EC2 can't + // support the future-dated Capacity Reservation request due to capacity + // constraints. You can view unsupported requests for 30 days. The Capacity + // Reservation will not be delivered. State CapacityReservationState // Any tags assigned to the Capacity Reservation. @@ -1366,6 +1551,21 @@ type CapacityReservationBillingRequest struct { noSmithyDocumentSerde } +// Information about your commitment for a future-dated Capacity Reservation. +type CapacityReservationCommitmentInfo struct { + + // The date and time at which the commitment duration expires, in the ISO8601 + // format in the UTC time zone ( YYYY-MM-DDThh:mm:ss.sssZ ). You can't decrease the + // instance count or cancel the Capacity Reservation before this date and time. + CommitmentEndDate *time.Time + + // The instance capacity that you committed to when you requested the future-dated + // Capacity Reservation. + CommittedInstanceCount *int32 + + noSmithyDocumentSerde +} + // Information about a Capacity Reservation Fleet. type CapacityReservationFleet struct { @@ -8739,6 +8939,9 @@ type IpamDiscoveredAccount struct { // The last successful resource discovery time. LastSuccessfulDiscoveryTime *time.Time + // The ID of an Organizational Unit in Amazon Web Services Organizations. + OrganizationalUnitId *string + noSmithyDocumentSerde } @@ -8969,6 +9172,21 @@ type IpamOperatingRegion struct { noSmithyDocumentSerde } +// If your IPAM is integrated with Amazon Web Services Organizations and you add +// an organizational unit (OU) exclusion, IPAM will not manage the IP addresses in +// accounts in that OU exclusion. +type IpamOrganizationalUnitExclusion struct { + + // An Amazon Web Services Organizations entity path. For more information on the + // entity path, see [Understand the Amazon Web Services Organizations entity path]in the Amazon Web Services Identity and Access Management User + // Guide. + // + // [Understand the Amazon Web Services Organizations entity path]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_last-accessed-view-data-orgs.html#access_policies_access-advisor-viewing-orgs-entity-path + OrganizationsEntityPath *string + + noSmithyDocumentSerde +} + // In IPAM, a pool is a collection of contiguous IP addresses CIDRs. Pools enable // you to organize your IP addresses according to your routing and security needs. // For example, if you have separate routing and security needs for development and @@ -9350,6 +9568,11 @@ type IpamResourceDiscovery struct { // select as operating Regions. OperatingRegions []IpamOperatingRegion + // If your IPAM is integrated with Amazon Web Services Organizations and you add + // an organizational unit (OU) exclusion, IPAM will not manage the IP addresses in + // accounts in that OU exclusion. + OrganizationalUnitExclusions []IpamOrganizationalUnitExclusion + // The ID of the owner. OwnerId *string @@ -14017,6 +14240,47 @@ type RemoveIpamOperatingRegion struct { noSmithyDocumentSerde } +// Remove an Organizational Unit (OU) exclusion to your IPAM. If your IPAM is +// integrated with Amazon Web Services Organizations and you add an organizational +// unit (OU) exclusion, IPAM will not manage the IP addresses in accounts in that +// OU exclusion. There is a limit on the number of exclusions you can create. For +// more information, see [Quotas for your IPAM]in the Amazon VPC IPAM User Guide. +// +// [Quotas for your IPAM]: https://docs.aws.amazon.com/vpc/latest/ipam/quotas-ipam.html +type RemoveIpamOrganizationalUnitExclusion struct { + + // An Amazon Web Services Organizations entity path. Build the path for the OU(s) + // using Amazon Web Services Organizations IDs separated by a / . Include all child + // OUs by ending the path with /* . + // + // - Example 1 + // + // - Path to a child OU: + // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/ou-jkl0-awsddddd/ + // + // - In this example, o-a1b2c3d4e5 is the organization ID, r-f6g7h8i9j0example is + // the root ID , ou-ghi0-awsccccc is an OU ID, and ou-jkl0-awsddddd is a child OU + // ID. + // + // - IPAM will not manage the IP addresses in accounts in the child OU. + // + // - Example 2 + // + // - Path where all child OUs will be part of the exclusion: + // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/* + // + // - In this example, IPAM will not manage the IP addresses in accounts in the + // OU ( ou-ghi0-awsccccc ) or in accounts in any OUs that are children of the OU. + // + // For more information on how to construct an entity path, see [Understand the Amazon Web Services Organizations entity path] in the Amazon Web + // Services Identity and Access Management User Guide. + // + // [Understand the Amazon Web Services Organizations entity path]: https://docs.aws.amazon.com/IAM/latest/UserGuide/access_policies_last-accessed-view-data-orgs.html#access_policies_access-advisor-viewing-orgs-entity-path + OrganizationsEntityPath *string + + noSmithyDocumentSerde +} + // An entry for a prefix list. type RemovePrefixListEntry struct { @@ -20206,12 +20470,12 @@ type VpcBlockPublicAccessExclusion struct { // The exclusion mode for internet gateway traffic. // - // - bidirectional-access-allowed : Allow all internet traffic to and from the - // excluded VPCs and subnets. + // - allow-bidirectional : Allow all internet traffic to and from the excluded + // VPCs and subnets. // - // - egress-access-allowed : Allow outbound internet traffic from the excluded - // VPCs and subnets. Block inbound internet traffic to the excluded VPCs and - // subnets. Only applies when VPC Block Public Access is set to Bidirectional. + // - allow-egress : Allow outbound internet traffic from the excluded VPCs and + // subnets. Block inbound internet traffic to the excluded VPCs and subnets. Only + // applies when VPC Block Public Access is set to Bidirectional. InternetGatewayExclusionMode InternetGatewayExclusionMode // When the exclusion was last updated. @@ -20235,7 +20499,7 @@ type VpcBlockPublicAccessExclusion struct { noSmithyDocumentSerde } -// VPC Block public Access (BPA) enables you to block resources in VPCs and +// VPC Block Public Access (BPA) enables you to block resources in VPCs and // subnets that you own in a Region from reaching or being reached from the // internet through internet gateways and egress-only internet gateways. To learn // more about VPC BPA, see [Block public access to VPCs and subnets]in the Amazon VPC User Guide. @@ -20251,16 +20515,16 @@ type VpcBlockPublicAccessOptions struct { // The current mode of VPC BPA. // - // - bidirectional-access-allowed : VPC BPA is not enabled and traffic is allowed - // to and from internet gateways and egress-only internet gateways in this Region. + // - off : VPC BPA is not enabled and traffic is allowed to and from internet + // gateways and egress-only internet gateways in this Region. // - // - bidirectional-access-blocked : Block all traffic to and from internet - // gateways and egress-only internet gateways in this Region (except for excluded - // VPCs and subnets). + // - block-bidirectional : Block all traffic to and from internet gateways and + // egress-only internet gateways in this Region (except for excluded VPCs and + // subnets). // - // - ingress-access-blocked : Block all internet traffic to the VPCs in this - // Region (except for VPCs or subnets which are excluded). Only traffic to and from - // NAT gateways and egress-only internet gateways is allowed because these gateways + // - block-ingress : Block all internet traffic to the VPCs in this Region + // (except for VPCs or subnets which are excluded). Only traffic to and from NAT + // gateways and egress-only internet gateways is allowed because these gateways // only allow outbound connections to be established. InternetGatewayBlockMode InternetGatewayBlockMode diff --git a/service/ec2/validators.go b/service/ec2/validators.go index 09bd28f284c..28a4f85d7c7 100644 --- a/service/ec2/validators.go +++ b/service/ec2/validators.go @@ -4090,6 +4090,26 @@ func (m *validateOpDescribeByoipCidrs) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDescribeCapacityBlockExtensionOfferings struct { +} + +func (*validateOpDescribeCapacityBlockExtensionOfferings) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeCapacityBlockExtensionOfferings) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeCapacityBlockExtensionOfferingsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeCapacityBlockExtensionOfferingsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeCapacityBlockOfferings struct { } @@ -7910,6 +7930,26 @@ func (m *validateOpProvisionPublicIpv4PoolCidr) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpPurchaseCapacityBlockExtension struct { +} + +func (*validateOpPurchaseCapacityBlockExtension) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpPurchaseCapacityBlockExtension) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*PurchaseCapacityBlockExtensionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpPurchaseCapacityBlockExtensionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpPurchaseCapacityBlock struct { } @@ -9886,6 +9926,10 @@ func addOpDescribeByoipCidrsValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDescribeByoipCidrs{}, middleware.After) } +func addOpDescribeCapacityBlockExtensionOfferingsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeCapacityBlockExtensionOfferings{}, middleware.After) +} + func addOpDescribeCapacityBlockOfferingsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeCapacityBlockOfferings{}, middleware.After) } @@ -10650,6 +10694,10 @@ func addOpProvisionPublicIpv4PoolCidrValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpProvisionPublicIpv4PoolCidr{}, middleware.After) } +func addOpPurchaseCapacityBlockExtensionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpPurchaseCapacityBlockExtension{}, middleware.After) +} + func addOpPurchaseCapacityBlockValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPurchaseCapacityBlock{}, middleware.After) } @@ -15198,6 +15246,24 @@ func validateOpDescribeByoipCidrsInput(v *DescribeByoipCidrsInput) error { } } +func validateOpDescribeCapacityBlockExtensionOfferingsInput(v *DescribeCapacityBlockExtensionOfferingsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeCapacityBlockExtensionOfferingsInput"} + if v.CapacityBlockExtensionDurationHours == nil { + invalidParams.Add(smithy.NewErrParamRequired("CapacityBlockExtensionDurationHours")) + } + if v.CapacityReservationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeCapacityBlockOfferingsInput(v *DescribeCapacityBlockOfferingsInput) error { if v == nil { return nil @@ -18397,6 +18463,24 @@ func validateOpProvisionPublicIpv4PoolCidrInput(v *ProvisionPublicIpv4PoolCidrIn } } +func validateOpPurchaseCapacityBlockExtensionInput(v *PurchaseCapacityBlockExtensionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PurchaseCapacityBlockExtensionInput"} + if v.CapacityBlockExtensionOfferingId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CapacityBlockExtensionOfferingId")) + } + if v.CapacityReservationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CapacityReservationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpPurchaseCapacityBlockInput(v *PurchaseCapacityBlockInput) error { if v == nil { return nil diff --git a/service/elasticache/api_op_AddTagsToResource.go b/service/elasticache/api_op_AddTagsToResource.go index 83de6ad7018..36e986e40a9 100644 --- a/service/elasticache/api_op_AddTagsToResource.go +++ b/service/elasticache/api_op_AddTagsToResource.go @@ -25,8 +25,8 @@ import ( // // For more information, see [Using Cost Allocation Tags in Amazon ElastiCache] in the ElastiCache User Guide. // -// [Using Cost Allocation Tags in Amazon ElastiCache]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Tagging.html -// [Resource-level permissions]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/IAM.ResourceLevelPermissions.html +// [Using Cost Allocation Tags in Amazon ElastiCache]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Tagging.html +// [Resource-level permissions]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/IAM.ResourceLevelPermissions.html func (c *Client) AddTagsToResource(ctx context.Context, params *AddTagsToResourceInput, optFns ...func(*Options)) (*AddTagsToResourceOutput, error) { if params == nil { params = &AddTagsToResourceInput{} diff --git a/service/elasticache/api_op_BatchApplyUpdateAction.go b/service/elasticache/api_op_BatchApplyUpdateAction.go index ab6e10b1d43..ee64f283f9e 100644 --- a/service/elasticache/api_op_BatchApplyUpdateAction.go +++ b/service/elasticache/api_op_BatchApplyUpdateAction.go @@ -14,7 +14,7 @@ import ( // Apply the service update. For more information on service updates and applying // them, see [Applying Service Updates]. // -// [Applying Service Updates]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/applying-updates.html +// [Applying Service Updates]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/applying-updates.html func (c *Client) BatchApplyUpdateAction(ctx context.Context, params *BatchApplyUpdateActionInput, optFns ...func(*Options)) (*BatchApplyUpdateActionOutput, error) { if params == nil { params = &BatchApplyUpdateActionInput{} diff --git a/service/elasticache/api_op_BatchStopUpdateAction.go b/service/elasticache/api_op_BatchStopUpdateAction.go index dad75ead538..000be8ea1c3 100644 --- a/service/elasticache/api_op_BatchStopUpdateAction.go +++ b/service/elasticache/api_op_BatchStopUpdateAction.go @@ -14,7 +14,7 @@ import ( // Stop the service update. For more information on service updates and stopping // them, see [Stopping Service Updates]. // -// [Stopping Service Updates]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/stopping-self-service-updates.html +// [Stopping Service Updates]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/stopping-self-service-updates.html func (c *Client) BatchStopUpdateAction(ctx context.Context, params *BatchStopUpdateActionInput, optFns ...func(*Options)) (*BatchStopUpdateActionOutput, error) { if params == nil { params = &BatchStopUpdateActionInput{} diff --git a/service/elasticache/api_op_CopySnapshot.go b/service/elasticache/api_op_CopySnapshot.go index 1002665dc7b..381802bd5b7 100644 --- a/service/elasticache/api_op_CopySnapshot.go +++ b/service/elasticache/api_op_CopySnapshot.go @@ -76,11 +76,11 @@ import ( // // ElastiCache User Guide. // -// [Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-exporting.html#backups-exporting-grant-access -// [Exporting Snapshots]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-exporting.html -// [Authentication & Access Control]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/IAM.html +// [Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/backups-exporting.html#backups-exporting-grant-access +// [Exporting Snapshots]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/backups-exporting.html +// [Authentication & Access Control]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/IAM.html // -// [Step 1: Create an Amazon S3 Bucket]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-exporting.html#backups-exporting-create-s3-bucket +// [Step 1: Create an Amazon S3 Bucket]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/backups-exporting.html#backups-exporting-create-s3-bucket func (c *Client) CopySnapshot(ctx context.Context, params *CopySnapshotInput, optFns ...func(*Options)) (*CopySnapshotOutput, error) { if params == nil { params = &CopySnapshotInput{} @@ -127,8 +127,8 @@ type CopySnapshotInput struct { // // For more information, see [Exporting a Snapshot] in the Amazon ElastiCache User Guide. // - // [Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-exporting.html#backups-exporting-grant-access - // [Exporting a Snapshot]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/backups-exporting.html + // [Step 2: Grant ElastiCache Access to Your Amazon S3 Bucket]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/backups-exporting.html#backups-exporting-grant-access + // [Exporting a Snapshot]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/backups-exporting.html TargetBucket *string noSmithyDocumentSerde diff --git a/service/elasticache/api_op_CreateCacheCluster.go b/service/elasticache/api_op_CreateCacheCluster.go index eece1a7d7c3..a2bb815995a 100644 --- a/service/elasticache/api_op_CreateCacheCluster.go +++ b/service/elasticache/api_op_CreateCacheCluster.go @@ -176,7 +176,7 @@ type CreateCacheClusterInput struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // - // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion + // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion CacheNodeType *string // The name of the parameter group to associate with this cluster. If this @@ -199,7 +199,7 @@ type CreateCacheClusterInput struct { // If you're going to launch your cluster in an Amazon VPC, you need to create a // subnet group before you start creating a cluster. For more information, see [Subnets and Subnet Groups]. // - // [Subnets and Subnet Groups]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SubnetGroups.html + // [Subnets and Subnet Groups]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SubnetGroups.html CacheSubnetGroupName *string // The name of the cache engine to be used for this cluster. @@ -215,7 +215,7 @@ type CreateCacheClusterInput struct { // version, you must delete the existing cluster or replication group and create it // anew with the earlier engine version. // - // [Selecting a Cache Engine and Version]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SelectEngine.html#VersionManagement + // [Selecting a Cache Engine and Version]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SelectEngine.html#VersionManagement EngineVersion *string // The network type you choose when modifying a cluster, either ipv4 | ipv6 . IPv6 diff --git a/service/elasticache/api_op_CreateCacheParameterGroup.go b/service/elasticache/api_op_CreateCacheParameterGroup.go index fda4ad1efb0..2b083aff6e4 100644 --- a/service/elasticache/api_op_CreateCacheParameterGroup.go +++ b/service/elasticache/api_op_CreateCacheParameterGroup.go @@ -28,7 +28,7 @@ import ( // - in the ElastiCache User Guide. // // [ModifyCacheParameterGroup]: https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyCacheParameterGroup.html -// [Parameters and Parameter Groups]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ParameterGroups.html +// [Parameters and Parameter Groups]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ParameterGroups.html func (c *Client) CreateCacheParameterGroup(ctx context.Context, params *CreateCacheParameterGroupInput, optFns ...func(*Options)) (*CreateCacheParameterGroupOutput, error) { if params == nil { params = &CreateCacheParameterGroupInput{} diff --git a/service/elasticache/api_op_CreateGlobalReplicationGroup.go b/service/elasticache/api_op_CreateGlobalReplicationGroup.go index d315a2f9cb1..210e79d877f 100644 --- a/service/elasticache/api_op_CreateGlobalReplicationGroup.go +++ b/service/elasticache/api_op_CreateGlobalReplicationGroup.go @@ -21,7 +21,7 @@ import ( // - The PrimaryReplicationGroupId represents the name of the primary cluster // that accepts writes and will replicate updates to the secondary cluster. // -// [Replication Across Regions Using Global Datastore]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastore.html +// [Replication Across Regions Using Global Datastore]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Redis-Global-Datastore.html func (c *Client) CreateGlobalReplicationGroup(ctx context.Context, params *CreateGlobalReplicationGroupInput, optFns ...func(*Options)) (*CreateGlobalReplicationGroupOutput, error) { if params == nil { params = &CreateGlobalReplicationGroupInput{} @@ -49,7 +49,7 @@ type CreateGlobalReplicationGroupInput struct { // For a full list of Amazon Regions and their respective Global datastore iD // prefixes, see [Using the Amazon CLI with Global datastores]. // - // [Using the Amazon CLI with Global datastores]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Redis-Global-Datastores-CLI.html + // [Using the Amazon CLI with Global datastores]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Redis-Global-Datastores-CLI.html // // This member is required. GlobalReplicationGroupIdSuffix *string diff --git a/service/elasticache/api_op_CreateReplicationGroup.go b/service/elasticache/api_op_CreateReplicationGroup.go index 9d8b4e00389..90970b46afc 100644 --- a/service/elasticache/api_op_CreateReplicationGroup.go +++ b/service/elasticache/api_op_CreateReplicationGroup.go @@ -48,8 +48,8 @@ import ( // // This operation is valid for Valkey and Redis OSS only. // -// [Scaling self-designed clusters]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Scaling.html -// [Creating a Subnet Group]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SubnetGroups.Creating.html +// [Scaling self-designed clusters]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Scaling.html +// [Creating a Subnet Group]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SubnetGroups.Creating.html // [Amazon Service Limits]: https://docs.aws.amazon.com/general/latest/gr/aws_service_limits.html func (c *Client) CreateReplicationGroup(ctx context.Context, params *CreateReplicationGroupInput, optFns ...func(*Options)) (*CreateReplicationGroupOutput, error) { if params == nil { @@ -233,7 +233,7 @@ type CreateReplicationGroupInput struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // - // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion + // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion CacheNodeType *string // The name of the parameter group to associate with this replication group. If @@ -259,7 +259,7 @@ type CreateReplicationGroupInput struct { // If you're going to launch your cluster in an Amazon VPC, you need to create a // subnet group before you start creating a cluster. For more information, see [Subnets and Subnet Groups]. // - // [Subnets and Subnet Groups]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SubnetGroups.html + // [Subnets and Subnet Groups]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SubnetGroups.html CacheSubnetGroupName *string // Enabled or Disabled. To modify cluster mode from Disabled to Enabled, you must @@ -274,7 +274,7 @@ type CreateReplicationGroupInput struct { // using the r6gd node type. This parameter must be set to true when using r6gd // nodes. For more information, see [Data tiering]. // - // [Data tiering]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/data-tiering.html + // [Data tiering]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/data-tiering.html DataTieringEnabled *bool // The name of the cache engine to be used for the clusters in this replication @@ -290,7 +290,7 @@ type CreateReplicationGroupInput struct { // to use an earlier engine version, you must delete the existing cluster or // replication group and create it anew with the earlier engine version. // - // [Selecting a Cache Engine and Version]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SelectEngine.html#VersionManagement + // [Selecting a Cache Engine and Version]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SelectEngine.html#VersionManagement EngineVersion *string // The name of the Global datastore @@ -313,7 +313,7 @@ type CreateReplicationGroupInput struct { // A flag indicating if you have Multi-AZ enabled to enhance fault tolerance. For // more information, see [Minimizing Downtime: Multi-AZ]. // - // [Minimizing Downtime: Multi-AZ]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/AutoFailover.html + // [Minimizing Downtime: Multi-AZ]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/AutoFailover.html MultiAZEnabled *bool // Must be either ipv4 | ipv6 | dual_stack . IPv6 is supported for workloads using diff --git a/service/elasticache/api_op_CreateUser.go b/service/elasticache/api_op_CreateUser.go index 5d0d62360d8..cdea7c6d1b7 100644 --- a/service/elasticache/api_op_CreateUser.go +++ b/service/elasticache/api_op_CreateUser.go @@ -14,7 +14,7 @@ import ( // For Valkey engine version 7.2 onwards and Redis OSS 6.0 and onwards: Creates a // user. For more information, see [Using Role Based Access Control (RBAC)]. // -// [Using Role Based Access Control (RBAC)]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.RBAC.html +// [Using Role Based Access Control (RBAC)]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.RBAC.html func (c *Client) CreateUser(ctx context.Context, params *CreateUserInput, optFns ...func(*Options)) (*CreateUserOutput, error) { if params == nil { params = &CreateUserInput{} diff --git a/service/elasticache/api_op_CreateUserGroup.go b/service/elasticache/api_op_CreateUserGroup.go index b53abdd0b6b..909c5d7e00a 100644 --- a/service/elasticache/api_op_CreateUserGroup.go +++ b/service/elasticache/api_op_CreateUserGroup.go @@ -14,7 +14,7 @@ import ( // For Valkey engine version 7.2 onwards and Redis OSS 6.0 onwards: Creates a user // group. For more information, see [Using Role Based Access Control (RBAC)] // -// [Using Role Based Access Control (RBAC)]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.RBAC.html +// [Using Role Based Access Control (RBAC)]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.RBAC.html func (c *Client) CreateUserGroup(ctx context.Context, params *CreateUserGroupInput, optFns ...func(*Options)) (*CreateUserGroupOutput, error) { if params == nil { params = &CreateUserGroupInput{} diff --git a/service/elasticache/api_op_DeleteUser.go b/service/elasticache/api_op_DeleteUser.go index abc1c8d1c32..46757d2fb09 100644 --- a/service/elasticache/api_op_DeleteUser.go +++ b/service/elasticache/api_op_DeleteUser.go @@ -15,7 +15,7 @@ import ( // user. The user will be removed from all user groups and in turn removed from all // replication groups. For more information, see [Using Role Based Access Control (RBAC)]. // -// [Using Role Based Access Control (RBAC)]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.RBAC.html +// [Using Role Based Access Control (RBAC)]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.RBAC.html func (c *Client) DeleteUser(ctx context.Context, params *DeleteUserInput, optFns ...func(*Options)) (*DeleteUserOutput, error) { if params == nil { params = &DeleteUserInput{} diff --git a/service/elasticache/api_op_DeleteUserGroup.go b/service/elasticache/api_op_DeleteUserGroup.go index 6ec21bb8e9b..7c883c0fbd7 100644 --- a/service/elasticache/api_op_DeleteUserGroup.go +++ b/service/elasticache/api_op_DeleteUserGroup.go @@ -15,7 +15,7 @@ import ( // group. The user group must first be disassociated from the replication group // before it can be deleted. For more information, see [Using Role Based Access Control (RBAC)]. // -// [Using Role Based Access Control (RBAC)]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.RBAC.html +// [Using Role Based Access Control (RBAC)]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.RBAC.html func (c *Client) DeleteUserGroup(ctx context.Context, params *DeleteUserGroupInput, optFns ...func(*Options)) (*DeleteUserGroupOutput, error) { if params == nil { params = &DeleteUserGroupInput{} diff --git a/service/elasticache/api_op_DescribeReservedCacheNodes.go b/service/elasticache/api_op_DescribeReservedCacheNodes.go index bb5cc2c7e33..0dfb6b3f22d 100644 --- a/service/elasticache/api_op_DescribeReservedCacheNodes.go +++ b/service/elasticache/api_op_DescribeReservedCacheNodes.go @@ -129,7 +129,7 @@ type DescribeReservedCacheNodesInput struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // - // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion + // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion CacheNodeType *string // The duration filter value, specified in years or seconds. Use this parameter to diff --git a/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go b/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go index 920f9047085..a029a609bee 100644 --- a/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go +++ b/service/elasticache/api_op_DescribeReservedCacheNodesOfferings.go @@ -128,7 +128,7 @@ type DescribeReservedCacheNodesOfferingsInput struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // - // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion + // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion CacheNodeType *string // Duration filter value, specified in years or seconds. Use this parameter to diff --git a/service/elasticache/api_op_ListTagsForResource.go b/service/elasticache/api_op_ListTagsForResource.go index 22bff8c3dc6..fcb4a5d875f 100644 --- a/service/elasticache/api_op_ListTagsForResource.go +++ b/service/elasticache/api_op_ListTagsForResource.go @@ -22,7 +22,7 @@ import ( // If the cluster is not in the available state, ListTagsForResource returns an // error. // -// [Resource-level permissions]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/IAM.ResourceLevelPermissions.html +// [Resource-level permissions]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/IAM.ResourceLevelPermissions.html func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { if params == nil { params = &ListTagsForResourceInput{} diff --git a/service/elasticache/api_op_ModifyCacheCluster.go b/service/elasticache/api_op_ModifyCacheCluster.go index 9fb0671c286..92049e8f27d 100644 --- a/service/elasticache/api_op_ModifyCacheCluster.go +++ b/service/elasticache/api_op_ModifyCacheCluster.go @@ -92,7 +92,7 @@ type ModifyCacheClusterInput struct { // // For more information, see [Authenticating Users with AUTH] // - // [Authenticating Users with AUTH]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth.html + // [Authenticating Users with AUTH]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth.html AuthTokenUpdateStrategy types.AuthTokenUpdateStrategyType // If you are running Valkey 7.2 or Redis OSS engine version 6.0 or later, set @@ -141,7 +141,7 @@ type ModifyCacheClusterInput struct { // version, you must delete the existing cluster and create it anew with the // earlier engine version. // - // [Selecting a Cache Engine and Version]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SelectEngine.html#VersionManagement + // [Selecting a Cache Engine and Version]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SelectEngine.html#VersionManagement EngineVersion *string // The network type you choose when modifying a cluster, either ipv4 | ipv6 . IPv6 @@ -225,7 +225,7 @@ type ModifyCacheClusterInput struct { // are performed immediately. If the new create request is Apply Immediately - No, // all creates are pending. // - // [Cache Node Considerations for Memcached]: https://docs.aws.amazon.com/AmazonElastiCache/latest/mem-ug/CacheNodes.SupportedTypes.html + // [Cache Node Considerations for Memcached]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html NewAvailabilityZones []string // The Amazon Resource Name (ARN) of the Amazon SNS topic to which notifications diff --git a/service/elasticache/api_op_ModifyReplicationGroup.go b/service/elasticache/api_op_ModifyReplicationGroup.go index a57fbced93c..720153e1864 100644 --- a/service/elasticache/api_op_ModifyReplicationGroup.go +++ b/service/elasticache/api_op_ModifyReplicationGroup.go @@ -23,7 +23,7 @@ import ( // This operation is valid for Valkey or Redis OSS only. // // [ModifyReplicationGroupShardConfiguration]: https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_ModifyReplicationGroupShardConfiguration.html -// [Scaling for Valkey or Redis OSS (cluster mode enabled)]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/scaling-redis-cluster-mode-enabled.html +// [Scaling for Valkey or Redis OSS (cluster mode enabled)]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/scaling-redis-cluster-mode-enabled.html func (c *Client) ModifyReplicationGroup(ctx context.Context, params *ModifyReplicationGroupInput, optFns ...func(*Options)) (*ModifyReplicationGroupOutput, error) { if params == nil { params = &ModifyReplicationGroupInput{} @@ -85,7 +85,7 @@ type ModifyReplicationGroupInput struct { // // For more information, see [Authenticating Users with AUTH] // - // [Authenticating Users with AUTH]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/auth.html + // [Authenticating Users with AUTH]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/auth.html AuthTokenUpdateStrategy types.AuthTokenUpdateStrategyType // If you are running Valkey or Redis OSS engine version 6.0 or later, set this @@ -138,7 +138,7 @@ type ModifyReplicationGroupInput struct { // version, you must delete the existing replication group and create it anew with // the earlier engine version. // - // [Selecting a Cache Engine and Version]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/SelectEngine.html#VersionManagement + // [Selecting a Cache Engine and Version]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/SelectEngine.html#VersionManagement EngineVersion *string // The network type you choose when modifying a cluster, either ipv4 | ipv6 . IPv6 diff --git a/service/elasticache/api_op_ModifyUser.go b/service/elasticache/api_op_ModifyUser.go index 77e458d4a72..64d9d401d47 100644 --- a/service/elasticache/api_op_ModifyUser.go +++ b/service/elasticache/api_op_ModifyUser.go @@ -43,6 +43,9 @@ type ModifyUserInput struct { // Specifies how to authenticate the user. AuthenticationMode *types.AuthenticationMode + // The engine for a specific user. + Engine *string + // Indicates no password is required for the user. NoPasswordRequired *bool diff --git a/service/elasticache/api_op_ModifyUserGroup.go b/service/elasticache/api_op_ModifyUserGroup.go index bc12ac9d94a..37cabc209c1 100644 --- a/service/elasticache/api_op_ModifyUserGroup.go +++ b/service/elasticache/api_op_ModifyUserGroup.go @@ -34,6 +34,9 @@ type ModifyUserGroupInput struct { // This member is required. UserGroupId *string + // The engine for a user group. + Engine *string + // The list of user IDs to add to the user group. UserIdsToAdd []string diff --git a/service/elasticache/api_op_PurchaseReservedCacheNodesOffering.go b/service/elasticache/api_op_PurchaseReservedCacheNodesOffering.go index 720963d0f3c..b0a6fbd4d52 100644 --- a/service/elasticache/api_op_PurchaseReservedCacheNodesOffering.go +++ b/service/elasticache/api_op_PurchaseReservedCacheNodesOffering.go @@ -14,7 +14,7 @@ import ( // Allows you to purchase a reserved cache node offering. Reserved nodes are not // eligible for cancellation and are non-refundable. For more information, see [Managing Costs with Reserved Nodes]. // -// [Managing Costs with Reserved Nodes]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/reserved-nodes.html +// [Managing Costs with Reserved Nodes]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/reserved-nodes.html func (c *Client) PurchaseReservedCacheNodesOffering(ctx context.Context, params *PurchaseReservedCacheNodesOfferingInput, optFns ...func(*Options)) (*PurchaseReservedCacheNodesOfferingOutput, error) { if params == nil { params = &PurchaseReservedCacheNodesOfferingInput{} diff --git a/service/elasticache/api_op_RebootCacheCluster.go b/service/elasticache/api_op_RebootCacheCluster.go index 7726f96a53d..d4a80afe6c8 100644 --- a/service/elasticache/api_op_RebootCacheCluster.go +++ b/service/elasticache/api_op_RebootCacheCluster.go @@ -29,7 +29,7 @@ import ( // mode enabled) cluster reboot for the changes to be applied, see [Rebooting a Cluster]for an // alternate process. // -// [Rebooting a Cluster]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/nodes.rebooting.html +// [Rebooting a Cluster]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/nodes.rebooting.html func (c *Client) RebootCacheCluster(ctx context.Context, params *RebootCacheClusterInput, optFns ...func(*Options)) (*RebootCacheClusterOutput, error) { if params == nil { params = &RebootCacheClusterInput{} diff --git a/service/elasticache/api_op_RemoveTagsFromResource.go b/service/elasticache/api_op_RemoveTagsFromResource.go index 7ea0f2fb267..c299cc4a1dc 100644 --- a/service/elasticache/api_op_RemoveTagsFromResource.go +++ b/service/elasticache/api_op_RemoveTagsFromResource.go @@ -18,7 +18,7 @@ import ( // those actions will be replicated to all nodes in the replication group. For more // information, see [Resource-level permissions]. // -// [Resource-level permissions]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/IAM.ResourceLevelPermissions.html +// [Resource-level permissions]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/IAM.ResourceLevelPermissions.html func (c *Client) RemoveTagsFromResource(ctx context.Context, params *RemoveTagsFromResourceInput, optFns ...func(*Options)) (*RemoveTagsFromResourceOutput, error) { if params == nil { params = &RemoveTagsFromResourceInput{} diff --git a/service/elasticache/api_op_TestFailover.go b/service/elasticache/api_op_TestFailover.go index fce2c23c291..fd494ab1b5e 100644 --- a/service/elasticache/api_op_TestFailover.go +++ b/service/elasticache/api_op_TestFailover.go @@ -61,8 +61,8 @@ import ( // Also see, [Testing Multi-AZ] in the ElastiCache User Guide. // // [DescribeEvents]: https://docs.aws.amazon.com/AmazonElastiCache/latest/APIReference/API_DescribeEvents.html -// [Testing Multi-AZ]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/AutoFailover.html#auto-failover-test -// [Viewing ElastiCache Events]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ECEvents.Viewing.html +// [Testing Multi-AZ]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/AutoFailover.html#auto-failover-test +// [Viewing ElastiCache Events]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ECEvents.Viewing.html func (c *Client) TestFailover(ctx context.Context, params *TestFailoverInput, optFns ...func(*Options)) (*TestFailoverOutput, error) { if params == nil { params = &TestFailoverInput{} diff --git a/service/elasticache/serializers.go b/service/elasticache/serializers.go index 3d15c1b742b..639f3ac5e98 100644 --- a/service/elasticache/serializers.go +++ b/service/elasticache/serializers.go @@ -8357,6 +8357,11 @@ func awsAwsquery_serializeOpDocumentModifyUserGroupInput(v *ModifyUserGroupInput object := value.Object() _ = object + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + if v.UserGroupId != nil { objectKey := object.Key("UserGroupId") objectKey.String(*v.UserGroupId) @@ -8400,6 +8405,11 @@ func awsAwsquery_serializeOpDocumentModifyUserInput(v *ModifyUserInput, value qu } } + if v.Engine != nil { + objectKey := object.Key("Engine") + objectKey.String(*v.Engine) + } + if v.NoPasswordRequired != nil { objectKey := object.Key("NoPasswordRequired") objectKey.Boolean(*v.NoPasswordRequired) diff --git a/service/elasticache/types/errors.go b/service/elasticache/types/errors.go index 26d6cccf622..e35349b0f67 100644 --- a/service/elasticache/types/errors.go +++ b/service/elasticache/types/errors.go @@ -615,7 +615,7 @@ func (e *GlobalReplicationGroupNotFoundFault) ErrorFault() smithy.ErrorFault { // The requested cache node type is not available in the specified Availability // Zone. For more information, see [InsufficientCacheClusterCapacity]in the ElastiCache User Guide. // -// [InsufficientCacheClusterCapacity]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/ErrorMessages.html#ErrorMessages.INSUFFICIENT_CACHE_CLUSTER_CAPACITY +// [InsufficientCacheClusterCapacity]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/ErrorMessages.html#ErrorMessages.INSUFFICIENT_CACHE_CLUSTER_CAPACITY type InsufficientCacheClusterCapacityFault struct { Message *string diff --git a/service/elasticache/types/types.go b/service/elasticache/types/types.go index 3fe3f410722..52c84dc8a18 100644 --- a/service/elasticache/types/types.go +++ b/service/elasticache/types/types.go @@ -182,7 +182,7 @@ type CacheCluster struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // - // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion + // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion CacheNodeType *string // A list of cache nodes that are members of the cluster. @@ -453,7 +453,7 @@ type CacheEngineVersion struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // -// [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion +// [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion type CacheNode struct { // The date and time when the cache node was created. @@ -502,7 +502,7 @@ type CacheNodeTypeSpecificParameter struct { // a reboot for the change to be applied. You can force a reboot or wait until the // next maintenance window's reboot. For more information, see [Rebooting a Cluster]. // - // [Rebooting a Cluster]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.Rebooting.html + // [Rebooting a Cluster]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.Rebooting.html ChangeType ChangeType // The valid data type for the parameter. @@ -737,7 +737,7 @@ type ConfigureShard struct { // find a Valkey or Redis OSS (cluster mode enabled)'s node group's (shard's) id, // see [Finding a Shard's Id]. // - // [Finding a Shard's Id]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/shard-find-id.html + // [Finding a Shard's Id]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/shard-find-id.html // // This member is required. NodeGroupId *string @@ -1271,7 +1271,7 @@ type Parameter struct { // a reboot for the change to be applied. You can force a reboot or wait until the // next maintenance window's reboot. For more information, see [Rebooting a Cluster]. // - // [Rebooting a Cluster]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/Clusters.Rebooting.html + // [Rebooting a Cluster]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/Clusters.Rebooting.html ChangeType ChangeType // The valid data type for the parameter. @@ -1486,7 +1486,7 @@ type ReplicationGroup struct { // using the r6gd node type. This parameter must be set to true when using r6gd // nodes. For more information, see [Data tiering]. // - // [Data tiering]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/data-tiering.html + // [Data tiering]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/data-tiering.html DataTiering DataTieringStatus // The user supplied description of the replication group. @@ -1523,7 +1523,7 @@ type ReplicationGroup struct { // A flag indicating if you have Multi-AZ enabled to enhance fault tolerance. For // more information, see [Minimizing Downtime: Multi-AZ] // - // [Minimizing Downtime: Multi-AZ]: http://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/AutoFailover.html + // [Minimizing Downtime: Multi-AZ]: http://docs.aws.amazon.com/AmazonElastiCache/latest/dg/AutoFailover.html MultiAZ MultiAZStatus // Must be either ipv4 | ipv6 | dual_stack . IPv6 is supported for workloads using @@ -1739,7 +1739,7 @@ type ReservedCacheNode struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // - // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion + // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion CacheNodeType *string // The duration of the reservation in seconds. @@ -1881,7 +1881,7 @@ type ReservedCacheNodesOffering struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // - // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion + // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion CacheNodeType *string // The duration of the offering. in seconds. @@ -2104,7 +2104,7 @@ type ServiceUpdate struct { // The recommendend date to apply the service update in order to ensure // compliance. For information on compliance, see [Self-Service Security Updates for Compliance]. // - // [Self-Service Security Updates for Compliance]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/elasticache-compliance.html#elasticache-compliance-self-service + // [Self-Service Security Updates for Compliance]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/elasticache-compliance.html#elasticache-compliance-self-service ServiceUpdateRecommendedApplyByDate *time.Time // The date when the service update is initially available @@ -2250,7 +2250,7 @@ type Snapshot struct { // - The configuration variables appendonly and appendfsync are not supported on // Valkey, or on Redis OSS version 2.8.22 and later. // - // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion + // [Supported Node Types]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/CacheNodes.SupportedTypes.html#CacheNodes.SupportedTypesByRegion CacheNodeType *string // The cache parameter group that is associated with the source cluster. @@ -2263,7 +2263,7 @@ type Snapshot struct { // using the r6gd node type. This parameter must be set to true when using r6gd // nodes. For more information, see [Data tiering]. // - // [Data tiering]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/data-tiering.html + // [Data tiering]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/data-tiering.html DataTiering DataTieringStatus // The name of the cache engine ( memcached or redis ) used by the source cluster. @@ -2481,7 +2481,7 @@ type UpdateAction struct { // The recommended date to apply the service update to ensure compliance. For // information on compliance, see [Self-Service Security Updates for Compliance]. // - // [Self-Service Security Updates for Compliance]: https://docs.aws.amazon.com/AmazonElastiCache/latest/red-ug/elasticache-compliance.html#elasticache-compliance-self-service + // [Self-Service Security Updates for Compliance]: https://docs.aws.amazon.com/AmazonElastiCache/latest/dg/elasticache-compliance.html#elasticache-compliance-self-service ServiceUpdateRecommendedApplyByDate *time.Time // The date the update is first available diff --git a/service/elasticloadbalancingv2/types/types.go b/service/elasticloadbalancingv2/types/types.go index 00b547620fe..0b9e1e2da8f 100644 --- a/service/elasticloadbalancingv2/types/types.go +++ b/service/elasticloadbalancingv2/types/types.go @@ -495,6 +495,75 @@ type ListenerAttribute struct { // // - tcp.idle_timeout.seconds - The tcp idle timeout value, in seconds. The valid // range is 60-6000 seconds. The default is 350 seconds. + // + // The following attributes are only supported by Application Load Balancers. + // + // - routing.http.request.x_amzn_mtls_clientcert_serial_number.header_name - + // Enables you to modify the header name of the + // X-Amzn-Mtls-Clientcert-Serial-Number HTTP request header. + // + // - routing.http.request.x_amzn_mtls_clientcert_issuer.header_name - Enables you + // to modify the header name of the X-Amzn-Mtls-Clientcert-Issuer HTTP request + // header. + // + // - routing.http.request.x_amzn_mtls_clientcert_subject.header_name - Enables + // you to modify the header name of the X-Amzn-Mtls-Clientcert-Subject HTTP request + // header. + // + // - routing.http.request.x_amzn_mtls_clientcert_validity.header_name - Enables + // you to modify the header name of the X-Amzn-Mtls-Clientcert-Validity HTTP + // request header. + // + // - routing.http.request.x_amzn_mtls_clientcert_leaf.header_name - Enables you + // to modify the header name of the X-Amzn-Mtls-Clientcert-Leaf HTTP request + // header. + // + // - routing.http.request.x_amzn_mtls_clientcert.header_name - Enables you to + // modify the header name of the X-Amzn-Mtls-Clientcert HTTP request header. + // + // - routing.http.request.x_amzn_tls_version.header_name - Enables you to modify + // the header name of the X-Amzn-Tls-Version HTTP request header. + // + // - routing.http.request.x_amzn_tls_cipher_suite.header_name - Enables you to + // modify the header name of the X-Amzn-Tls-Cipher-Suite HTTP request header. + // + // - routing.http.response.server.enabled - Enables you to allow or remove the + // HTTP response server header. + // + // - routing.http.response.strict_transport_security.header_value - Informs + // browsers that the site should only be accessed using HTTPS, and that any future + // attempts to access it using HTTP should automatically be converted to HTTPS. + // + // - routing.http.response.access_control_allow_origin.header_value - Specifies + // which origins are allowed to access the server. + // + // - routing.http.response.access_control_allow_methods.header_value - Returns + // which HTTP methods are allowed when accessing the server from a different + // origin. + // + // - routing.http.response.access_control_allow_headers.header_value - Specifies + // which headers can be used during the request. + // + // - routing.http.response.access_control_allow_credentials.header_value - + // Indicates whether the browser should include credentials such as cookies or + // authentication when making requests. + // + // - routing.http.response.access_control_expose_headers.header_value - Returns + // which headers the browser can expose to the requesting client. + // + // - routing.http.response.access_control_max_age.header_value - Specifies how + // long the results of a preflight request can be cached, in seconds. + // + // - routing.http.response.content_security_policy.header_value - Specifies + // restrictions enforced by the browser to help minimize the risk of certain types + // of security threats. + // + // - routing.http.response.x_content_type_options.header_value - Indicates + // whether the MIME types advertised in the Content-Type headers should be followed + // and not be changed. + // + // - routing.http.response.x_frame_options.header_value - Indicates whether the + // browser is allowed to render a page in a frame, iframe, embed or object. Key *string // The value of the attribute. @@ -627,6 +696,9 @@ type LoadBalancerAttribute struct { // internal load balancers, preventing unintended access to your internal load // balancer through an internet gateway. // + // - zonal_shift.config.enabled - Indicates whether zonal shift is enabled. The + // possible values are true and false . The default is false . + // // The following attributes are supported by only Application Load Balancers: // // - idle_timeout.timeout_seconds - The idle timeout value, in seconds. The valid @@ -706,9 +778,6 @@ type LoadBalancerAttribute struct { // availability_zone_affinity with 100 percent zonal affinity, // partial_availability_zone_affinity with 85 percent zonal affinity, and // any_availability_zone with 0 percent zonal affinity. - // - // - zonal_shift.config.enabled - Indicates whether zonal shift is enabled. The - // possible values are true and false . The default is false . Key *string // The value of the attribute. diff --git a/service/health/api_op_DescribeAffectedAccountsForOrganization.go b/service/health/api_op_DescribeAffectedAccountsForOrganization.go index bcf15f28077..7fd6db06a04 100644 --- a/service/health/api_op_DescribeAffectedAccountsForOrganization.go +++ b/service/health/api_op_DescribeAffectedAccountsForOrganization.go @@ -71,8 +71,8 @@ type DescribeAffectedAccountsForOrganizationOutput struct { // A JSON set of elements of the affected accounts. AffectedAccounts []string - // This parameter specifies if the Health event is a public Amazon Web Service - // event or an account-specific event. + // This parameter specifies if the Health event is a public Amazon Web Services + // service event or an account-specific event. // // - If the eventScopeCode value is PUBLIC , then the affectedAccounts value is // always empty. diff --git a/service/health/api_op_DescribeAffectedEntities.go b/service/health/api_op_DescribeAffectedEntities.go index 903871c3c5a..bff49e4b8cb 100644 --- a/service/health/api_op_DescribeAffectedEntities.go +++ b/service/health/api_op_DescribeAffectedEntities.go @@ -14,9 +14,9 @@ import ( // Returns a list of entities that have been affected by the specified events, // based on the specified filter criteria. Entities can refer to individual // customer resources, groups of customer resources, or any other construct, -// depending on the Amazon Web Service. Events that have impact beyond that of the -// affected entities, or where the extent of impact is unknown, include at least -// one entity indicating this. +// depending on the Amazon Web Services service. Events that have impact beyond +// that of the affected entities, or where the extent of impact is unknown, include +// at least one entity indicating this. // // At least one event ARN is required. // diff --git a/service/health/api_op_DescribeAffectedEntitiesForOrganization.go b/service/health/api_op_DescribeAffectedEntitiesForOrganization.go index 2fa47c67915..c03dc34e8cf 100644 --- a/service/health/api_op_DescribeAffectedEntitiesForOrganization.go +++ b/service/health/api_op_DescribeAffectedEntitiesForOrganization.go @@ -14,7 +14,8 @@ import ( // Returns a list of entities that have been affected by one or more events for // one or more accounts in your organization in Organizations, based on the filter // criteria. Entities can refer to individual customer resources, groups of -// customer resources, or any other construct, depending on the Amazon Web Service. +// customer resources, or any other construct, depending on the Amazon Web Services +// service. // // At least one event Amazon Resource Name (ARN) and account ID are required. // diff --git a/service/health/api_op_DescribeEventTypes.go b/service/health/api_op_DescribeEventTypes.go index a8023a81eb1..f04c969dda6 100644 --- a/service/health/api_op_DescribeEventTypes.go +++ b/service/health/api_op_DescribeEventTypes.go @@ -13,8 +13,8 @@ import ( // Returns the event types that meet the specified filter criteria. You can use // this API operation to find information about the Health event, such as the -// category, Amazon Web Service, and event code. The metadata for each event -// appears in the [EventType]object. +// category, Amazon Web Services service, and event code. The metadata for each +// event appears in the [EventType]object. // // If you don't specify a filter criteria, the API operation returns all event // types, in no particular order. diff --git a/service/health/deserializers.go b/service/health/deserializers.go index bcc6d95acf2..ab8139863e3 100644 --- a/service/health/deserializers.go +++ b/service/health/deserializers.go @@ -1819,6 +1819,11 @@ func awsAwsjson11_deserializeDocumentAffectedEntity(v **types.AffectedEntity, va sv.EntityArn = ptr.String(jtv) } + case "entityMetadata": + if err := awsAwsjson11_deserializeDocumentEntityMetadata(&sv.EntityMetadata, value); err != nil { + return err + } + case "entityUrl": if value != nil { jtv, ok := value.(string) @@ -2221,6 +2226,42 @@ func awsAwsjson11_deserializeDocumentEntityList(v *[]types.AffectedEntity, value return nil } +func awsAwsjson11_deserializeDocumentEntityMetadata(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 entityMetadataValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson11_deserializeDocumentEntityStatuses(v *map[string]int32, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/health/doc.go b/service/health/doc.go index 88a451b8f71..6c92e51462b 100644 --- a/service/health/doc.go +++ b/service/health/doc.go @@ -7,7 +7,7 @@ // // The Health API provides access to the Health information that appears in the [Health Dashboard]. // You can use the API operations to get information about events that might affect -// your Amazon Web Services and resources. +// your Amazon Web Services services and resources. // // You must have a Business, Enterprise On-Ramp, or Enterprise Support plan from [Amazon Web Services Support] // to use the Health API. If you call the Health API from an Amazon Web Services diff --git a/service/health/endpoints.go b/service/health/endpoints.go index 1f86161ac0a..911a7f3b620 100644 --- a/service/health/endpoints.go +++ b/service/health/endpoints.go @@ -386,7 +386,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://health-fips.") diff --git a/service/health/types/types.go b/service/health/types/types.go index fbc3eba8fc4..e1f76fff9c4 100644 --- a/service/health/types/types.go +++ b/service/health/types/types.go @@ -36,6 +36,9 @@ type AffectedEntity struct { // arn:aws:health:us-east-1:111222333444:entity/AVh5GGT7ul1arKr1sE1K EntityArn *string + // Additional metadata about the affected entity. + EntityMetadata map[string]string + // The URL of the affected entity. EntityUrl *string @@ -202,8 +205,8 @@ type Event struct { // The date and time that the event ended. EndTime *time.Time - // This parameter specifies if the Health event is a public Amazon Web Service - // event or an account-specific event. + // This parameter specifies if the Health event is a public Amazon Web Services + // service event or an account-specific event. // // - If the eventScopeCode value is PUBLIC , then the affectedAccounts value is // always empty. @@ -233,7 +236,8 @@ type Event struct { // The Amazon Web Services Region name of the event. Region *string - // The Amazon Web Service that is affected by the event. For example, EC2 , RDS . + // The Amazon Web Services service that is affected by the event. For example, EC2 + // , RDS . Service *string // The date and time that the event began. @@ -381,7 +385,8 @@ type EventFilter struct { // A list of Amazon Web Services Regions. Regions []string - // The Amazon Web Services associated with the event. For example, EC2 , RDS . + // The Amazon Web Services services associated with the event. For example, EC2 , + // RDS . Services []string // A list of dates and times that the event began. @@ -420,7 +425,8 @@ type EventType struct { // ; for example, AWS_EC2_SYSTEM_MAINTENANCE_EVENT . Code *string - // The Amazon Web Service that is affected by the event. For example, EC2 , RDS . + // The Amazon Web Services service that is affected by the event. For example, EC2 + // , RDS . Service *string noSmithyDocumentSerde @@ -439,7 +445,8 @@ type EventTypeFilter struct { // A list of event type codes. EventTypeCodes []string - // The Amazon Web Services associated with the event. For example, EC2 , RDS . + // The Amazon Web Services services associated with the event. For example, EC2 , + // RDS . Services []string noSmithyDocumentSerde @@ -521,8 +528,8 @@ type OrganizationEvent struct { // The date and time that the event ended. EndTime *time.Time - // This parameter specifies if the Health event is a public Amazon Web Service - // event or an account-specific event. + // This parameter specifies if the Health event is a public Amazon Web Services + // service event or an account-specific event. // // - If the eventScopeCode value is PUBLIC , then the affectedAccounts value is // always empty. @@ -552,7 +559,8 @@ type OrganizationEvent struct { // The Amazon Web Services Region name of the event. Region *string - // The Amazon Web Service that is affected by the event, such as EC2 and RDS. + // The Amazon Web Services service that is affected by the event, such as EC2 and + // RDS. Service *string // The date and time that the event began. @@ -705,7 +713,8 @@ type OrganizationEventFilter struct { // A list of Amazon Web Services Regions. Regions []string - // The Amazon Web Services associated with the event. For example, EC2 , RDS . + // The Amazon Web Services services associated with the event. For example, EC2 , + // RDS . Services []string // A range of dates and times that is used by the [EventFilter] and [EntityFilter] objects. If from is set diff --git a/service/iot/api_op_CreateCommand.go b/service/iot/api_op_CreateCommand.go new file mode 100644 index 00000000000..f04616e1bfd --- /dev/null +++ b/service/iot/api_op_CreateCommand.go @@ -0,0 +1,195 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a command. A command contains reusable configurations that can be +// applied before they are sent to the devices. +func (c *Client) CreateCommand(ctx context.Context, params *CreateCommandInput, optFns ...func(*Options)) (*CreateCommandOutput, error) { + if params == nil { + params = &CreateCommandInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateCommand", params, optFns, c.addOperationCreateCommandMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateCommandOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateCommandInput struct { + + // A unique identifier for the command. We recommend using UUID. Alpha-numeric + // characters, hyphens, and underscores are valid for use here. + // + // This member is required. + CommandId *string + + // A short text decription of the command. + Description *string + + // The user-friendly name in the console for the command. This name doesn't have + // to be unique. You can update the user-friendly name after you define it. + DisplayName *string + + // A list of parameters that are required by the StartCommandExecution API. These + // parameters need to be specified only when using the AWS-IoT-FleetWise + // namespace. You can either specify them here or when running the command using + // the StartCommandExecution API. + MandatoryParameters []types.CommandParameter + + // The namespace of the command. The MQTT reserved topics and validations will be + // used for command executions according to the namespace setting. + Namespace types.CommandNamespace + + // The payload object for the command. You must specify this information when + // using the AWS-IoT namespace. + // + // You can upload a static payload file from your local storage that contains the + // instructions for the device to process. The payload file can use any format. To + // make sure that the device correctly interprets the payload, we recommend you to + // specify the payload content type. + Payload *types.CommandPayload + + // The IAM role that allows access to create the command. + RoleArn *string + + // Name-value pairs that are used as metadata to manage a command. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateCommandOutput struct { + + // The Amazon Resource Number (ARN) of the command. For example, + // arn:aws:iot:::command/ + CommandArn *string + + // The unique identifier for the command. + CommandId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateCommand{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateCommand{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateCommand"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateCommandValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateCommand(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateCommand(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateCommand", + } +} diff --git a/service/iot/api_op_CreateJob.go b/service/iot/api_op_CreateJob.go index 897fa639a44..d1e22cded0b 100644 --- a/service/iot/api_op_CreateJob.go +++ b/service/iot/api_op_CreateJob.go @@ -33,9 +33,8 @@ func (c *Client) CreateJob(ctx context.Context, params *CreateJobInput, optFns . type CreateJobInput struct { - // A job identifier which must be unique for your Amazon Web Services account. We - // recommend using a UUID. Alpha-numeric characters, "-" and "_" are valid for use - // here. + // A job identifier which must be unique for your account. We recommend using a + // UUID. Alpha-numeric characters, "-" and "_" are valid for use here. // // This member is required. JobId *string diff --git a/service/iot/api_op_DeleteCommand.go b/service/iot/api_op_DeleteCommand.go new file mode 100644 index 00000000000..b9e6a1d7607 --- /dev/null +++ b/service/iot/api_op_DeleteCommand.go @@ -0,0 +1,168 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete a command resource. +func (c *Client) DeleteCommand(ctx context.Context, params *DeleteCommandInput, optFns ...func(*Options)) (*DeleteCommandOutput, error) { + if params == nil { + params = &DeleteCommandInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCommand", params, optFns, c.addOperationDeleteCommandMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCommandOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteCommandInput struct { + + // The unique identifier of the command to be deleted. + // + // This member is required. + CommandId *string + + noSmithyDocumentSerde +} + +type DeleteCommandOutput struct { + + // The status code for the command deletion request. The status code is in the 200 + // range for a successful request. + // + // - If the command hasn't been deprecated, or has been deprecated for a + // duration that is shorter than the maximum time out duration of 12 hours, when + // calling the DeleteCommand request, the deletion will be scheduled and a 202 + // status code will be returned. While the command is being deleted, it will be in + // a pendingDeletion state. Once the time out duration has been reached, the + // command will be permanently removed from your account. + // + // - If the command has been deprecated for a duration that is longer than the + // maximum time out duration of 12 hours, when calling the DeleteCommand request, + // the command will be deleted immediately and a 204 status code will be returned. + StatusCode int32 + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCommand{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCommand{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCommand"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteCommandValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCommand(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCommand(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCommand", + } +} diff --git a/service/iot/api_op_DeleteCommandExecution.go b/service/iot/api_op_DeleteCommandExecution.go new file mode 100644 index 00000000000..12c9008e97e --- /dev/null +++ b/service/iot/api_op_DeleteCommandExecution.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Delete a command execution. +// +// Only command executions that enter a terminal state can be deleted from your +// account. +func (c *Client) DeleteCommandExecution(ctx context.Context, params *DeleteCommandExecutionInput, optFns ...func(*Options)) (*DeleteCommandExecutionOutput, error) { + if params == nil { + params = &DeleteCommandExecutionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteCommandExecution", params, optFns, c.addOperationDeleteCommandExecutionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteCommandExecutionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteCommandExecutionInput struct { + + // The unique identifier of the command execution that you want to delete from + // your account. + // + // This member is required. + ExecutionId *string + + // The Amazon Resource Number (ARN) of the target device for which you want to + // delete command executions. + // + // This member is required. + TargetArn *string + + noSmithyDocumentSerde +} + +type DeleteCommandExecutionOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteCommandExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteCommandExecution{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteCommandExecution{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteCommandExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteCommandExecutionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteCommandExecution(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteCommandExecution(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteCommandExecution", + } +} diff --git a/service/iot/api_op_DescribeJob.go b/service/iot/api_op_DescribeJob.go index 9f798e6b824..5838105d715 100644 --- a/service/iot/api_op_DescribeJob.go +++ b/service/iot/api_op_DescribeJob.go @@ -38,8 +38,8 @@ type DescribeJobInput struct { // This member is required. JobId *string - // A flag that provides a view of the job document before and after the - // substitution parameters have been resolved with their exact values. + // Provides a view of the job document before and after the substitution + // parameters have been resolved with their exact values. BeforeSubstitution bool noSmithyDocumentSerde diff --git a/service/iot/api_op_GetCommand.go b/service/iot/api_op_GetCommand.go new file mode 100644 index 00000000000..a035fb5b47a --- /dev/null +++ b/service/iot/api_op_GetCommand.go @@ -0,0 +1,192 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets information about the specified command. +func (c *Client) GetCommand(ctx context.Context, params *GetCommandInput, optFns ...func(*Options)) (*GetCommandOutput, error) { + if params == nil { + params = &GetCommandInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCommand", params, optFns, c.addOperationGetCommandMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCommandOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCommandInput struct { + + // The unique identifier of the command for which you want to retrieve information. + // + // This member is required. + CommandId *string + + noSmithyDocumentSerde +} + +type GetCommandOutput struct { + + // The Amazon Resource Number (ARN) of the command. For example, + // arn:aws:iot:::command/ + CommandArn *string + + // The unique identifier of the command. + CommandId *string + + // The timestamp, when the command was created. + CreatedAt *time.Time + + // Indicates whether the command has been deprecated. + Deprecated *bool + + // A short text description of the command. + Description *string + + // The user-friendly name in the console for the command. + DisplayName *string + + // The timestamp, when the command was last updated. + LastUpdatedAt *time.Time + + // A list of parameters for the command created. + MandatoryParameters []types.CommandParameter + + // The namespace of the command. + Namespace types.CommandNamespace + + // The payload object that you provided for the command. + Payload *types.CommandPayload + + // Indicates whether the command is being deleted. + PendingDeletion *bool + + // The IAM role that allows access to retrieve information about the command. + RoleArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCommand{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCommand{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCommand"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetCommandValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCommand(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCommand(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCommand", + } +} diff --git a/service/iot/api_op_GetCommandExecution.go b/service/iot/api_op_GetCommandExecution.go new file mode 100644 index 00000000000..ac798f7fb3e --- /dev/null +++ b/service/iot/api_op_GetCommandExecution.go @@ -0,0 +1,222 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Gets information about the specific command execution on a single device. +func (c *Client) GetCommandExecution(ctx context.Context, params *GetCommandExecutionInput, optFns ...func(*Options)) (*GetCommandExecutionOutput, error) { + if params == nil { + params = &GetCommandExecutionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetCommandExecution", params, optFns, c.addOperationGetCommandExecutionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetCommandExecutionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetCommandExecutionInput struct { + + // The unique identifier for the command execution. This information is returned + // as a response of the StartCommandExecution API request. + // + // This member is required. + ExecutionId *string + + // The Amazon Resource Number (ARN) of the device on which the command execution + // is being performed. + // + // This member is required. + TargetArn *string + + // Can be used to specify whether to include the result of the command execution + // in the GetCommandExecution API response. Your device can use this field to + // provide additional information about the command execution. You only need to + // specify this field when using the AWS-IoT namespace. + IncludeResult *bool + + noSmithyDocumentSerde +} + +type GetCommandExecutionOutput struct { + + // The Amazon Resource Number (ARN) of the command. For example, + // arn:aws:iot:::command/ + CommandArn *string + + // The timestamp, when the command execution was completed. + CompletedAt *time.Time + + // The timestamp, when the command execution was created. + CreatedAt *time.Time + + // The unique identifier of the command execution. + ExecutionId *string + + // Specifies the amount of time in seconds that the device can take to finish a + // command execution. A timer starts when the command execution is created. If the + // command execution status is not set to another terminal state before the timer + // expires, it will automatically update to TIMED_OUT . + ExecutionTimeoutSeconds *int64 + + // The timestamp, when the command execution was last updated. + LastUpdatedAt *time.Time + + // The list of parameters that the StartCommandExecution API used when performing + // the command on the device. + Parameters map[string]types.CommandParameterValue + + // The result value for the current state of the command execution. The status + // provides information about the progress of the command execution. The device can + // use the result field to share additional details about the execution such as a + // return value of a remote function call. + // + // If you use the AWS-IoT-FleetWise namespace, then this field is not applicable + // in the API response. + Result map[string]types.CommandExecutionResult + + // The timestamp, when the command execution was started. + StartedAt *time.Time + + // The status of the command execution. After your devices receive the command and + // start performing the operations specified in the command, it can use the + // UpdateCommandExecution MQTT API to update the status information. + Status types.CommandExecutionStatus + + // Your devices can use this parameter to provide additional context about the + // status of a command execution using a reason code and description. + StatusReason *types.StatusReason + + // The Amazon Resource Number (ARN) of the device on which the command execution + // is being performed. + TargetArn *string + + // The time to live (TTL) parameter for the GetCommandExecution API. + TimeToLive *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetCommandExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetCommandExecution{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetCommandExecution{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetCommandExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetCommandExecutionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetCommandExecution(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetCommandExecution(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetCommandExecution", + } +} diff --git a/service/iot/api_op_GetJobDocument.go b/service/iot/api_op_GetJobDocument.go index b525d3b11b0..534a25a150e 100644 --- a/service/iot/api_op_GetJobDocument.go +++ b/service/iot/api_op_GetJobDocument.go @@ -37,8 +37,8 @@ type GetJobDocumentInput struct { // This member is required. JobId *string - // A flag that provides a view of the job document before and after the - // substitution parameters have been resolved with their exact values. + // Provides a view of the job document before and after the substitution + // parameters have been resolved with their exact values. BeforeSubstitution bool noSmithyDocumentSerde diff --git a/service/iot/api_op_ListCommandExecutions.go b/service/iot/api_op_ListCommandExecutions.go new file mode 100644 index 00000000000..a7a45dbd9b2 --- /dev/null +++ b/service/iot/api_op_ListCommandExecutions.go @@ -0,0 +1,289 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List all command executions. +// +// You must provide only the startedTimeFilter or the completedTimeFilter +// information. If you provide both time filters, the API will generate an error. +// You can use this information to find command executions that started within a +// specific timeframe. +func (c *Client) ListCommandExecutions(ctx context.Context, params *ListCommandExecutionsInput, optFns ...func(*Options)) (*ListCommandExecutionsOutput, error) { + if params == nil { + params = &ListCommandExecutionsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCommandExecutions", params, optFns, c.addOperationListCommandExecutionsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCommandExecutionsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCommandExecutionsInput struct { + + // The Amazon Resource Number (ARN) of the command. You can use this information + // to list all command executions for a particular command. + CommandArn *string + + // List all command executions that completed any time before or after the date + // and time that you specify. The date and time uses the format yyyy-MM-dd'T'HH:mm . + CompletedTimeFilter *types.TimeFilter + + // The maximum number of results to return in this operation. + MaxResults *int32 + + // The namespace of the command. + Namespace types.CommandNamespace + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string + + // Specify whether to list the command executions that were created in the + // ascending or descending order. By default, the API returns all commands in the + // descending order based on the start time or completion time of the executions, + // that are determined by the startTimeFilter and completeTimeFilter parameters. + SortOrder types.SortOrder + + // List all command executions that started any time before or after the date and + // time that you specify. The date and time uses the format yyyy-MM-dd'T'HH:mm . + StartedTimeFilter *types.TimeFilter + + // List all command executions for the device that have a particular status. For + // example, you can filter the list to display only command executions that have + // failed or timed out. + Status types.CommandExecutionStatus + + // The Amazon Resource Number (ARN) of the target device. You can use this + // information to list all command executions for a particular device. + TargetArn *string + + noSmithyDocumentSerde +} + +type ListCommandExecutionsOutput struct { + + // The list of command executions. + CommandExecutions []types.CommandExecutionSummary + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCommandExecutionsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCommandExecutions{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCommandExecutions{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCommandExecutions"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCommandExecutions(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListCommandExecutionsPaginatorOptions is the paginator options for +// ListCommandExecutions +type ListCommandExecutionsPaginatorOptions struct { + // The maximum number of results to return in this operation. + 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 +} + +// ListCommandExecutionsPaginator is a paginator for ListCommandExecutions +type ListCommandExecutionsPaginator struct { + options ListCommandExecutionsPaginatorOptions + client ListCommandExecutionsAPIClient + params *ListCommandExecutionsInput + nextToken *string + firstPage bool +} + +// NewListCommandExecutionsPaginator returns a new ListCommandExecutionsPaginator +func NewListCommandExecutionsPaginator(client ListCommandExecutionsAPIClient, params *ListCommandExecutionsInput, optFns ...func(*ListCommandExecutionsPaginatorOptions)) *ListCommandExecutionsPaginator { + if params == nil { + params = &ListCommandExecutionsInput{} + } + + options := ListCommandExecutionsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCommandExecutionsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCommandExecutionsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCommandExecutions page. +func (p *ListCommandExecutionsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommandExecutionsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListCommandExecutions(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 +} + +// ListCommandExecutionsAPIClient is a client that implements the +// ListCommandExecutions operation. +type ListCommandExecutionsAPIClient interface { + ListCommandExecutions(context.Context, *ListCommandExecutionsInput, ...func(*Options)) (*ListCommandExecutionsOutput, error) +} + +var _ ListCommandExecutionsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListCommandExecutions(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCommandExecutions", + } +} diff --git a/service/iot/api_op_ListCommands.go b/service/iot/api_op_ListCommands.go new file mode 100644 index 00000000000..a9d992c9e2c --- /dev/null +++ b/service/iot/api_op_ListCommands.go @@ -0,0 +1,271 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iot/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// List all commands in your account. +func (c *Client) ListCommands(ctx context.Context, params *ListCommandsInput, optFns ...func(*Options)) (*ListCommandsOutput, error) { + if params == nil { + params = &ListCommandsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListCommands", params, optFns, c.addOperationListCommandsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListCommandsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListCommandsInput struct { + + // A filter that can be used to display the list of commands that have a specific + // command parameter name. + CommandParameterName *string + + // The maximum number of results to return in this operation. By default, the API + // returns up to a maximum of 25 results. You can override this default value to + // return up to a maximum of 100 results for this operation. + MaxResults *int32 + + // The namespace of the command. By default, the API returns all commands that + // have been created for both AWS-IoT and AWS-IoT-FleetWise namespaces. You can + // override this default value if you want to return all commands that have been + // created only for a specific namespace. + Namespace types.CommandNamespace + + // To retrieve the next set of results, the nextToken value from a previous + // response; otherwise null to receive the first set of results. + NextToken *string + + // Specify whether to list the commands that you have created in the ascending or + // descending order. By default, the API returns all commands in the descending + // order based on the time that they were created. + SortOrder types.SortOrder + + noSmithyDocumentSerde +} + +type ListCommandsOutput struct { + + // The list of commands. + Commands []types.CommandSummary + + // The token to use to get the next set of results, or null if there are no + // additional results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListCommandsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListCommands{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListCommands{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListCommands"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListCommands(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListCommandsPaginatorOptions is the paginator options for ListCommands +type ListCommandsPaginatorOptions struct { + // The maximum number of results to return in this operation. By default, the API + // returns up to a maximum of 25 results. You can override this default value to + // return up to a maximum of 100 results for this operation. + 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 +} + +// ListCommandsPaginator is a paginator for ListCommands +type ListCommandsPaginator struct { + options ListCommandsPaginatorOptions + client ListCommandsAPIClient + params *ListCommandsInput + nextToken *string + firstPage bool +} + +// NewListCommandsPaginator returns a new ListCommandsPaginator +func NewListCommandsPaginator(client ListCommandsAPIClient, params *ListCommandsInput, optFns ...func(*ListCommandsPaginatorOptions)) *ListCommandsPaginator { + if params == nil { + params = &ListCommandsInput{} + } + + options := ListCommandsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListCommandsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListCommandsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListCommands page. +func (p *ListCommandsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListCommandsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListCommands(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 +} + +// ListCommandsAPIClient is a client that implements the ListCommands operation. +type ListCommandsAPIClient interface { + ListCommands(context.Context, *ListCommandsInput, ...func(*Options)) (*ListCommandsOutput, error) +} + +var _ ListCommandsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListCommands(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListCommands", + } +} diff --git a/service/iot/api_op_UpdateCommand.go b/service/iot/api_op_UpdateCommand.go new file mode 100644 index 00000000000..752cd0bae06 --- /dev/null +++ b/service/iot/api_op_UpdateCommand.go @@ -0,0 +1,179 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iot + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Update information about a command or mark a command for deprecation. +func (c *Client) UpdateCommand(ctx context.Context, params *UpdateCommandInput, optFns ...func(*Options)) (*UpdateCommandOutput, error) { + if params == nil { + params = &UpdateCommandInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateCommand", params, optFns, c.addOperationUpdateCommandMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateCommandOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateCommandInput struct { + + // The unique identifier of the command to be updated. + // + // This member is required. + CommandId *string + + // A boolean that you can use to specify whether to deprecate a command. + Deprecated *bool + + // A short text description of the command. + Description *string + + // The new user-friendly name to use in the console for the command. + DisplayName *string + + noSmithyDocumentSerde +} + +type UpdateCommandOutput struct { + + // The unique identifier of the command. + CommandId *string + + // The boolean that indicates whether the command was deprecated. + Deprecated *bool + + // The updated text description of the command. + Description *string + + // The updated user-friendly display name in the console for the command. + DisplayName *string + + // The date and time (epoch timestamp in seconds) when the command was last + // updated. + LastUpdatedAt *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateCommandMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateCommand{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateCommand{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateCommand"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateCommandValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateCommand(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateCommand(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateCommand", + } +} diff --git a/service/iot/deserializers.go b/service/iot/deserializers.go index 8cdd007e8b3..208f0ca3f6d 100644 --- a/service/iot/deserializers.go +++ b/service/iot/deserializers.go @@ -2884,6 +2884,183 @@ func awsRestjson1_deserializeOpDocumentCreateCertificateProviderOutput(v **Creat return nil } +type awsRestjson1_deserializeOpCreateCommand struct { +} + +func (*awsRestjson1_deserializeOpCreateCommand) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateCommand) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateCommand(response, &metadata) + } + output := &CreateCommandOutput{} + 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_deserializeOpDocumentCreateCommandOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateCommand(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("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_deserializeOpDocumentCreateCommandOutput(v **CreateCommandOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateCommandOutput + if *v == nil { + sv = &CreateCommandOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "commandArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandArn to be of type string, got %T instead", value) + } + sv.CommandArn = ptr.String(jtv) + } + + case "commandId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandId to be of type string, got %T instead", value) + } + sv.CommandId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpCreateCustomMetric struct { } @@ -8487,14 +8664,14 @@ func awsRestjson1_deserializeOpErrorDeleteCertificateProvider(response *smithyht } } -type awsRestjson1_deserializeOpDeleteCustomMetric struct { +type awsRestjson1_deserializeOpDeleteCommand struct { } -func (*awsRestjson1_deserializeOpDeleteCustomMetric) ID() string { +func (*awsRestjson1_deserializeOpDeleteCommand) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteCustomMetric) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteCommand) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8512,110 +8689,21 @@ func (m *awsRestjson1_deserializeOpDeleteCustomMetric) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteCustomMetric(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCommand(response, &metadata) } - output := &DeleteCustomMetricOutput{} + output := &DeleteCommandOutput{} out.Result = output - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteCustomMetric(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) + err = awsRestjson1_deserializeOpHttpBindingsDeleteCommandOutput(output, response) if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDeleteDimension struct { -} - -func (*awsRestjson1_deserializeOpDeleteDimension) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteDimension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response with invalid Http bindings, %w", err)} } - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorDeleteDimension(response, &metadata) - } - output := &DeleteDimensionOutput{} - out.Result = output - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDimension(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteCommand(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8656,15 +8744,18 @@ func awsRestjson1_deserializeOpErrorDeleteDimension(response *smithyhttp.Respons } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(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, @@ -8675,14 +8766,24 @@ func awsRestjson1_deserializeOpErrorDeleteDimension(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteDomainConfiguration struct { +func awsRestjson1_deserializeOpHttpBindingsDeleteCommandOutput(v *DeleteCommandOutput, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + v.StatusCode = int32(response.StatusCode) + + return nil } -func (*awsRestjson1_deserializeOpDeleteDomainConfiguration) ID() string { +type awsRestjson1_deserializeOpDeleteCommandExecution struct { +} + +func (*awsRestjson1_deserializeOpDeleteCommandExecution) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDomainConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteCommandExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8700,16 +8801,16 @@ func (m *awsRestjson1_deserializeOpDeleteDomainConfiguration) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDomainConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCommandExecution(response, &metadata) } - output := &DeleteDomainConfigurationOutput{} + output := &DeleteCommandExecutionOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDomainConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteCommandExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8750,23 +8851,17 @@ func awsRestjson1_deserializeOpErrorDeleteDomainConfiguration(response *smithyht } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -8778,14 +8873,14 @@ func awsRestjson1_deserializeOpErrorDeleteDomainConfiguration(response *smithyht } } -type awsRestjson1_deserializeOpDeleteDynamicThingGroup struct { +type awsRestjson1_deserializeOpDeleteCustomMetric struct { } -func (*awsRestjson1_deserializeOpDeleteDynamicThingGroup) ID() string { +func (*awsRestjson1_deserializeOpDeleteCustomMetric) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteDynamicThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteCustomMetric) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8803,16 +8898,16 @@ func (m *awsRestjson1_deserializeOpDeleteDynamicThingGroup) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteDynamicThingGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteCustomMetric(response, &metadata) } - output := &DeleteDynamicThingGroupOutput{} + output := &DeleteCustomMetricOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteDynamicThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteCustomMetric(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8862,9 +8957,6 @@ func awsRestjson1_deserializeOpErrorDeleteDynamicThingGroup(response *smithyhttp case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8875,14 +8967,14 @@ func awsRestjson1_deserializeOpErrorDeleteDynamicThingGroup(response *smithyhttp } } -type awsRestjson1_deserializeOpDeleteFleetMetric struct { +type awsRestjson1_deserializeOpDeleteDimension struct { } -func (*awsRestjson1_deserializeOpDeleteFleetMetric) ID() string { +func (*awsRestjson1_deserializeOpDeleteDimension) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteFleetMetric) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteDimension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -8900,22 +8992,110 @@ func (m *awsRestjson1_deserializeOpDeleteFleetMetric) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteFleetMetric(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDimension(response, &metadata) } - output := &DeleteFleetMetricOutput{} + output := &DeleteDimensionOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteDimension(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteDomainConfiguration struct { +} + +func (*awsRestjson1_deserializeOpDeleteDomainConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteDomainConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteDomainConfiguration(response, &metadata) + } + output := &DeleteDomainConfigurationOutput{} + out.Result = output + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteFleetMetric(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteDomainConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -8962,6 +9142,9 @@ func awsRestjson1_deserializeOpErrorDeleteFleetMetric(response *smithyhttp.Respo case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -8971,9 +9154,6 @@ func awsRestjson1_deserializeOpErrorDeleteFleetMetric(response *smithyhttp.Respo case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -8984,14 +9164,14 @@ func awsRestjson1_deserializeOpErrorDeleteFleetMetric(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpDeleteJob struct { +type awsRestjson1_deserializeOpDeleteDynamicThingGroup struct { } -func (*awsRestjson1_deserializeOpDeleteJob) ID() string { +func (*awsRestjson1_deserializeOpDeleteDynamicThingGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteDynamicThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9009,22 +9189,16 @@ func (m *awsRestjson1_deserializeOpDeleteJob) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteDynamicThingGroup(response, &metadata) } - output := &DeleteJobOutput{} + output := &DeleteDynamicThingGroupOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteDynamicThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9065,24 +9239,18 @@ func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, met } switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidStateTransitionException", errorCode): - return awsRestjson1_deserializeErrorInvalidStateTransitionException(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("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9093,14 +9261,14 @@ func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, met } } -type awsRestjson1_deserializeOpDeleteJobExecution struct { +type awsRestjson1_deserializeOpDeleteFleetMetric struct { } -func (*awsRestjson1_deserializeOpDeleteJobExecution) ID() string { +func (*awsRestjson1_deserializeOpDeleteFleetMetric) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteJobExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteFleetMetric) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9118,9 +9286,9 @@ func (m *awsRestjson1_deserializeOpDeleteJobExecution) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteJobExecution(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteFleetMetric(response, &metadata) } - output := &DeleteJobExecutionOutput{} + output := &DeleteFleetMetricOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -9133,7 +9301,7 @@ func (m *awsRestjson1_deserializeOpDeleteJobExecution) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteJobExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteFleetMetric(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9174,21 +9342,24 @@ func awsRestjson1_deserializeOpErrorDeleteJobExecution(response *smithyhttp.Resp } switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidStateTransitionException", errorCode): - return awsRestjson1_deserializeErrorInvalidStateTransitionException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -9199,14 +9370,14 @@ func awsRestjson1_deserializeOpErrorDeleteJobExecution(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpDeleteJobTemplate struct { +type awsRestjson1_deserializeOpDeleteJob struct { } -func (*awsRestjson1_deserializeOpDeleteJobTemplate) ID() string { +func (*awsRestjson1_deserializeOpDeleteJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteJobTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9224,9 +9395,9 @@ func (m *awsRestjson1_deserializeOpDeleteJobTemplate) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteJobTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteJob(response, &metadata) } - output := &DeleteJobTemplateOutput{} + output := &DeleteJobOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -9239,7 +9410,7 @@ func (m *awsRestjson1_deserializeOpDeleteJobTemplate) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteJobTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9280,15 +9451,21 @@ func awsRestjson1_deserializeOpErrorDeleteJobTemplate(response *smithyhttp.Respo } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidStateTransitionException", errorCode): + return awsRestjson1_deserializeErrorInvalidStateTransitionException(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("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -9302,14 +9479,14 @@ func awsRestjson1_deserializeOpErrorDeleteJobTemplate(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpDeleteMitigationAction struct { +type awsRestjson1_deserializeOpDeleteJobExecution struct { } -func (*awsRestjson1_deserializeOpDeleteMitigationAction) ID() string { +func (*awsRestjson1_deserializeOpDeleteJobExecution) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteMitigationAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteJobExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9327,16 +9504,22 @@ func (m *awsRestjson1_deserializeOpDeleteMitigationAction) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteMitigationAction(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteJobExecution(response, &metadata) } - output := &DeleteMitigationActionOutput{} + output := &DeleteJobExecutionOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteMitigationAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteJobExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9377,12 +9560,18 @@ func awsRestjson1_deserializeOpErrorDeleteMitigationAction(response *smithyhttp. } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidStateTransitionException", errorCode): + return awsRestjson1_deserializeErrorInvalidStateTransitionException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -9396,14 +9585,14 @@ func awsRestjson1_deserializeOpErrorDeleteMitigationAction(response *smithyhttp. } } -type awsRestjson1_deserializeOpDeleteOTAUpdate struct { +type awsRestjson1_deserializeOpDeleteJobTemplate struct { } -func (*awsRestjson1_deserializeOpDeleteOTAUpdate) ID() string { +func (*awsRestjson1_deserializeOpDeleteJobTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteOTAUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteJobTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9421,16 +9610,22 @@ func (m *awsRestjson1_deserializeOpDeleteOTAUpdate) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteOTAUpdate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteJobTemplate(response, &metadata) } - output := &DeleteOTAUpdateOutput{} + output := &DeleteJobTemplateOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteOTAUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteJobTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9480,17 +9675,102 @@ func awsRestjson1_deserializeOpErrorDeleteOTAUpdate(response *smithyhttp.Respons case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + } +} + +type awsRestjson1_deserializeOpDeleteMitigationAction struct { +} + +func (*awsRestjson1_deserializeOpDeleteMitigationAction) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteMitigationAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteMitigationAction(response, &metadata) + } + output := &DeleteMitigationActionOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteMitigationAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9502,14 +9782,14 @@ func awsRestjson1_deserializeOpErrorDeleteOTAUpdate(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeletePackage struct { +type awsRestjson1_deserializeOpDeleteOTAUpdate struct { } -func (*awsRestjson1_deserializeOpDeletePackage) ID() string { +func (*awsRestjson1_deserializeOpDeleteOTAUpdate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeletePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteOTAUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9527,16 +9807,16 @@ func (m *awsRestjson1_deserializeOpDeletePackage) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeletePackage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteOTAUpdate(response, &metadata) } - output := &DeletePackageOutput{} + output := &DeleteOTAUpdateOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeletePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteOTAUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9577,14 +9857,26 @@ func awsRestjson1_deserializeOpErrorDeletePackage(response *smithyhttp.Response, } switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9596,14 +9888,14 @@ func awsRestjson1_deserializeOpErrorDeletePackage(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeletePackageVersion struct { +type awsRestjson1_deserializeOpDeletePackage struct { } -func (*awsRestjson1_deserializeOpDeletePackageVersion) ID() string { +func (*awsRestjson1_deserializeOpDeletePackage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeletePackageVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeletePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9621,16 +9913,16 @@ func (m *awsRestjson1_deserializeOpDeletePackageVersion) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeletePackageVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeletePackage(response, &metadata) } - output := &DeletePackageVersionOutput{} + output := &DeletePackageOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeletePackageVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeletePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9690,14 +9982,14 @@ func awsRestjson1_deserializeOpErrorDeletePackageVersion(response *smithyhttp.Re } } -type awsRestjson1_deserializeOpDeletePolicy struct { +type awsRestjson1_deserializeOpDeletePackageVersion struct { } -func (*awsRestjson1_deserializeOpDeletePolicy) ID() string { +func (*awsRestjson1_deserializeOpDeletePackageVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeletePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeletePackageVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9715,22 +10007,16 @@ func (m *awsRestjson1_deserializeOpDeletePolicy) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeletePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeletePackageVersion(response, &metadata) } - output := &DeletePolicyOutput{} + output := &DeletePackageVersionOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeletePackageVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9771,26 +10057,14 @@ func awsRestjson1_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, } switch { - case strings.EqualFold("DeleteConflictException", errorCode): - return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody) - - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -9802,14 +10076,14 @@ func awsRestjson1_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeletePolicyVersion struct { +type awsRestjson1_deserializeOpDeletePolicy struct { } -func (*awsRestjson1_deserializeOpDeletePolicyVersion) ID() string { +func (*awsRestjson1_deserializeOpDeletePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeletePolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeletePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9827,9 +10101,9 @@ func (m *awsRestjson1_deserializeOpDeletePolicyVersion) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeletePolicyVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeletePolicy(response, &metadata) } - output := &DeletePolicyVersionOutput{} + output := &DeletePolicyOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -9842,7 +10116,7 @@ func (m *awsRestjson1_deserializeOpDeletePolicyVersion) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeletePolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeletePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9914,14 +10188,14 @@ func awsRestjson1_deserializeOpErrorDeletePolicyVersion(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpDeleteProvisioningTemplate struct { +type awsRestjson1_deserializeOpDeletePolicyVersion struct { } -func (*awsRestjson1_deserializeOpDeleteProvisioningTemplate) ID() string { +func (*awsRestjson1_deserializeOpDeletePolicyVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteProvisioningTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeletePolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -9939,16 +10213,22 @@ func (m *awsRestjson1_deserializeOpDeleteProvisioningTemplate) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeletePolicyVersion(response, &metadata) } - output := &DeleteProvisioningTemplateOutput{} + output := &DeletePolicyVersionOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeletePolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -9989,9 +10269,6 @@ func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response *smithyh } switch { - case strings.EqualFold("ConflictingResourceUpdateException", errorCode): - return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) - case strings.EqualFold("DeleteConflictException", errorCode): return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody) @@ -10004,6 +10281,9 @@ func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response *smithyh case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -10020,14 +10300,14 @@ func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response *smithyh } } -type awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion struct { +type awsRestjson1_deserializeOpDeleteProvisioningTemplate struct { } -func (*awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion) ID() string { +func (*awsRestjson1_deserializeOpDeleteProvisioningTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteProvisioningTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10045,16 +10325,16 @@ func (m *awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteProvisioningTemplateVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response, &metadata) } - output := &DeleteProvisioningTemplateVersionOutput{} + output := &DeleteProvisioningTemplateOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplateVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10126,14 +10406,14 @@ func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplateVersion(response * } } -type awsRestjson1_deserializeOpDeleteRegistrationCode struct { +type awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion struct { } -func (*awsRestjson1_deserializeOpDeleteRegistrationCode) ID() string { +func (*awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteRegistrationCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteProvisioningTemplateVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10151,16 +10431,16 @@ func (m *awsRestjson1_deserializeOpDeleteRegistrationCode) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteRegistrationCode(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteProvisioningTemplateVersion(response, &metadata) } - output := &DeleteRegistrationCodeOutput{} + output := &DeleteProvisioningTemplateVersionOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteRegistrationCode(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteProvisioningTemplateVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10201,15 +10481,21 @@ func awsRestjson1_deserializeOpErrorDeleteRegistrationCode(response *smithyhttp. } switch { + case strings.EqualFold("ConflictingResourceUpdateException", errorCode): + return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + + case strings.EqualFold("DeleteConflictException", errorCode): + return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -10226,14 +10512,14 @@ func awsRestjson1_deserializeOpErrorDeleteRegistrationCode(response *smithyhttp. } } -type awsRestjson1_deserializeOpDeleteRoleAlias struct { +type awsRestjson1_deserializeOpDeleteRegistrationCode struct { } -func (*awsRestjson1_deserializeOpDeleteRoleAlias) ID() string { +func (*awsRestjson1_deserializeOpDeleteRegistrationCode) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteRoleAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteRegistrationCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10251,16 +10537,16 @@ func (m *awsRestjson1_deserializeOpDeleteRoleAlias) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteRoleAlias(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteRegistrationCode(response, &metadata) } - output := &DeleteRoleAliasOutput{} + output := &DeleteRegistrationCodeOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteRoleAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteRegistrationCode(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10301,15 +10587,9 @@ func awsRestjson1_deserializeOpErrorDeleteRoleAlias(response *smithyhttp.Respons } switch { - case strings.EqualFold("DeleteConflictException", errorCode): - return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -10332,14 +10612,14 @@ func awsRestjson1_deserializeOpErrorDeleteRoleAlias(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteScheduledAudit struct { +type awsRestjson1_deserializeOpDeleteRoleAlias struct { } -func (*awsRestjson1_deserializeOpDeleteScheduledAudit) ID() string { +func (*awsRestjson1_deserializeOpDeleteRoleAlias) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteScheduledAudit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteRoleAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10357,16 +10637,16 @@ func (m *awsRestjson1_deserializeOpDeleteScheduledAudit) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteRoleAlias(response, &metadata) } - output := &DeleteScheduledAuditOutput{} + output := &DeleteRoleAliasOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteRoleAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10407,6 +10687,9 @@ func awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response *smithyhttp.Re } switch { + case strings.EqualFold("DeleteConflictException", errorCode): + return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -10416,9 +10699,15 @@ func awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response *smithyhttp.Re case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10429,14 +10718,14 @@ func awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response *smithyhttp.Re } } -type awsRestjson1_deserializeOpDeleteSecurityProfile struct { +type awsRestjson1_deserializeOpDeleteScheduledAudit struct { } -func (*awsRestjson1_deserializeOpDeleteSecurityProfile) ID() string { +func (*awsRestjson1_deserializeOpDeleteScheduledAudit) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteScheduledAudit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10454,16 +10743,16 @@ func (m *awsRestjson1_deserializeOpDeleteSecurityProfile) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteSecurityProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response, &metadata) } - output := &DeleteSecurityProfileOutput{} + output := &DeleteScheduledAuditOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteScheduledAudit(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10510,12 +10799,12 @@ func awsRestjson1_deserializeOpErrorDeleteSecurityProfile(response *smithyhttp.R case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10526,14 +10815,14 @@ func awsRestjson1_deserializeOpErrorDeleteSecurityProfile(response *smithyhttp.R } } -type awsRestjson1_deserializeOpDeleteStream struct { +type awsRestjson1_deserializeOpDeleteSecurityProfile struct { } -func (*awsRestjson1_deserializeOpDeleteStream) ID() string { +func (*awsRestjson1_deserializeOpDeleteSecurityProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10551,16 +10840,16 @@ func (m *awsRestjson1_deserializeOpDeleteStream) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteStream(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteSecurityProfile(response, &metadata) } - output := &DeleteStreamOutput{} + output := &DeleteSecurityProfileOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10601,26 +10890,17 @@ func awsRestjson1_deserializeOpErrorDeleteStream(response *smithyhttp.Response, } switch { - case strings.EqualFold("DeleteConflictException", errorCode): - return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -10632,14 +10912,14 @@ func awsRestjson1_deserializeOpErrorDeleteStream(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpDeleteThing struct { +type awsRestjson1_deserializeOpDeleteStream struct { } -func (*awsRestjson1_deserializeOpDeleteThing) ID() string { +func (*awsRestjson1_deserializeOpDeleteStream) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10657,16 +10937,16 @@ func (m *awsRestjson1_deserializeOpDeleteThing) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteThing(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteStream(response, &metadata) } - output := &DeleteThingOutput{} + output := &DeleteStreamOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10707,6 +10987,9 @@ func awsRestjson1_deserializeOpErrorDeleteThing(response *smithyhttp.Response, m } switch { + case strings.EqualFold("DeleteConflictException", errorCode): + return awsRestjson1_deserializeErrorDeleteConflictException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -10725,9 +11008,6 @@ func awsRestjson1_deserializeOpErrorDeleteThing(response *smithyhttp.Response, m case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10738,111 +11018,14 @@ func awsRestjson1_deserializeOpErrorDeleteThing(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpDeleteThingGroup struct { -} - -func (*awsRestjson1_deserializeOpDeleteThingGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpDeleteThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorDeleteThingGroup(response, &metadata) - } - output := &DeleteThingGroupOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorDeleteThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpDeleteThingType struct { +type awsRestjson1_deserializeOpDeleteThing struct { } -func (*awsRestjson1_deserializeOpDeleteThingType) ID() string { +func (*awsRestjson1_deserializeOpDeleteThing) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10860,16 +11043,16 @@ func (m *awsRestjson1_deserializeOpDeleteThingType) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteThingType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteThing(response, &metadata) } - output := &DeleteThingTypeOutput{} + output := &DeleteThingOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -10928,6 +11111,9 @@ func awsRestjson1_deserializeOpErrorDeleteThingType(response *smithyhttp.Respons case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -10938,14 +11124,14 @@ func awsRestjson1_deserializeOpErrorDeleteThingType(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteTopicRule struct { +type awsRestjson1_deserializeOpDeleteThingGroup struct { } -func (*awsRestjson1_deserializeOpDeleteTopicRule) ID() string { +func (*awsRestjson1_deserializeOpDeleteThingGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -10963,22 +11149,16 @@ func (m *awsRestjson1_deserializeOpDeleteTopicRule) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteTopicRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteThingGroup(response, &metadata) } - output := &DeleteTopicRuleOutput{} + output := &DeleteThingGroupOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11019,20 +11199,17 @@ func awsRestjson1_deserializeOpErrorDeleteTopicRule(response *smithyhttp.Respons } switch { - case strings.EqualFold("ConflictingResourceUpdateException", errorCode): - return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) - - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11044,14 +11221,14 @@ func awsRestjson1_deserializeOpErrorDeleteTopicRule(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpDeleteTopicRuleDestination struct { +type awsRestjson1_deserializeOpDeleteThingType struct { } -func (*awsRestjson1_deserializeOpDeleteTopicRuleDestination) ID() string { +func (*awsRestjson1_deserializeOpDeleteThingType) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11069,16 +11246,16 @@ func (m *awsRestjson1_deserializeOpDeleteTopicRuleDestination) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteTopicRuleDestination(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteThingType(response, &metadata) } - output := &DeleteTopicRuleDestinationOutput{} + output := &DeleteThingTypeOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11119,18 +11296,21 @@ func awsRestjson1_deserializeOpErrorDeleteTopicRuleDestination(response *smithyh } switch { - case strings.EqualFold("ConflictingResourceUpdateException", errorCode): - return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) - - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -11144,14 +11324,14 @@ func awsRestjson1_deserializeOpErrorDeleteTopicRuleDestination(response *smithyh } } -type awsRestjson1_deserializeOpDeleteV2LoggingLevel struct { +type awsRestjson1_deserializeOpDeleteTopicRule struct { } -func (*awsRestjson1_deserializeOpDeleteV2LoggingLevel) ID() string { +func (*awsRestjson1_deserializeOpDeleteTopicRule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeleteV2LoggingLevel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11169,9 +11349,9 @@ func (m *awsRestjson1_deserializeOpDeleteV2LoggingLevel) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteTopicRule(response, &metadata) } - output := &DeleteV2LoggingLevelOutput{} + output := &DeleteTopicRuleOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -11184,7 +11364,7 @@ func (m *awsRestjson1_deserializeOpDeleteV2LoggingLevel) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11225,6 +11405,9 @@ func awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response *smithyhttp.Re } switch { + case strings.EqualFold("ConflictingResourceUpdateException", errorCode): + return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) @@ -11234,6 +11417,9 @@ func awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response *smithyhttp.Re case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11244,14 +11430,14 @@ func awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response *smithyhttp.Re } } -type awsRestjson1_deserializeOpDeprecateThingType struct { +type awsRestjson1_deserializeOpDeleteTopicRuleDestination struct { } -func (*awsRestjson1_deserializeOpDeprecateThingType) ID() string { +func (*awsRestjson1_deserializeOpDeleteTopicRuleDestination) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDeprecateThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11269,16 +11455,16 @@ func (m *awsRestjson1_deserializeOpDeprecateThingType) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDeprecateThingType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteTopicRuleDestination(response, &metadata) } - output := &DeprecateThingTypeOutput{} + output := &DeleteTopicRuleDestinationOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDeprecateThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeleteTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11319,21 +11505,18 @@ func awsRestjson1_deserializeOpErrorDeprecateThingType(response *smithyhttp.Resp } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("ConflictingResourceUpdateException", errorCode): + return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -11347,14 +11530,14 @@ func awsRestjson1_deserializeOpErrorDeprecateThingType(response *smithyhttp.Resp } } -type awsRestjson1_deserializeOpDescribeAccountAuditConfiguration struct { +type awsRestjson1_deserializeOpDeleteV2LoggingLevel struct { } -func (*awsRestjson1_deserializeOpDescribeAccountAuditConfiguration) ID() string { +func (*awsRestjson1_deserializeOpDeleteV2LoggingLevel) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAccountAuditConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDeleteV2LoggingLevel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11372,44 +11555,116 @@ func (m *awsRestjson1_deserializeOpDescribeAccountAuditConfiguration) HandleDese } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAccountAuditConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response, &metadata) } - output := &DescribeAccountAuditConfigurationOutput{} + output := &DeleteV2LoggingLevelOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteV2LoggingLevel(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(response.Body, ringBuffer) - + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() - var shape interface{} - if err := decoder.Decode(&shape); err != nil && err != io.EOF { + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) err = &smithy.DeserializationError{ Err: fmt.Errorf("failed to decode response body, %w", err), Snapshot: snapshot.Bytes(), } - return out, metadata, err + return err } - err = awsRestjson1_deserializeOpDocumentDescribeAccountAuditConfigurationOutput(&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(), + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeprecateThingType struct { +} + +func (*awsRestjson1_deserializeOpDeprecateThingType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeprecateThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeprecateThingType(response, &metadata) } + output := &DeprecateThingTypeOutput{} + out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAccountAuditConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDeprecateThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11453,9 +11708,21 @@ func awsRestjson1_deserializeOpErrorDescribeAccountAuditConfiguration(response * case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11466,64 +11733,14 @@ func awsRestjson1_deserializeOpErrorDescribeAccountAuditConfiguration(response * } } -func awsRestjson1_deserializeOpDocumentDescribeAccountAuditConfigurationOutput(v **DescribeAccountAuditConfigurationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *DescribeAccountAuditConfigurationOutput - if *v == nil { - sv = &DescribeAccountAuditConfigurationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "auditCheckConfigurations": - if err := awsRestjson1_deserializeDocumentAuditCheckConfigurations(&sv.AuditCheckConfigurations, value); err != nil { - return err - } - - case "auditNotificationTargetConfigurations": - if err := awsRestjson1_deserializeDocumentAuditNotificationTargetConfigurations(&sv.AuditNotificationTargetConfigurations, value); err != nil { - return err - } - - 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) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpDescribeAuditFinding struct { +type awsRestjson1_deserializeOpDescribeAccountAuditConfiguration struct { } -func (*awsRestjson1_deserializeOpDescribeAuditFinding) ID() string { +func (*awsRestjson1_deserializeOpDescribeAccountAuditConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAuditFinding) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAccountAuditConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11541,9 +11758,9 @@ func (m *awsRestjson1_deserializeOpDescribeAuditFinding) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAuditFinding(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAccountAuditConfiguration(response, &metadata) } - output := &DescribeAuditFindingOutput{} + output := &DescribeAccountAuditConfigurationOutput{} out.Result = output var buff [1024]byte @@ -11564,7 +11781,7 @@ func (m *awsRestjson1_deserializeOpDescribeAuditFinding) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAuditFindingOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAccountAuditConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11578,7 +11795,7 @@ func (m *awsRestjson1_deserializeOpDescribeAuditFinding) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAuditFinding(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAccountAuditConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11622,12 +11839,6 @@ func awsRestjson1_deserializeOpErrorDescribeAuditFinding(response *smithyhttp.Re case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -11641,7 +11852,7 @@ func awsRestjson1_deserializeOpErrorDescribeAuditFinding(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentDescribeAuditFindingOutput(v **DescribeAuditFindingOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentDescribeAccountAuditConfigurationOutput(v **DescribeAccountAuditConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -11654,20 +11865,34 @@ func awsRestjson1_deserializeOpDocumentDescribeAuditFindingOutput(v **DescribeAu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DescribeAuditFindingOutput + var sv *DescribeAccountAuditConfigurationOutput if *v == nil { - sv = &DescribeAuditFindingOutput{} + sv = &DescribeAccountAuditConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "finding": - if err := awsRestjson1_deserializeDocumentAuditFinding(&sv.Finding, value); err != nil { + case "auditCheckConfigurations": + if err := awsRestjson1_deserializeDocumentAuditCheckConfigurations(&sv.AuditCheckConfigurations, value); err != nil { + return err + } + + case "auditNotificationTargetConfigurations": + if err := awsRestjson1_deserializeDocumentAuditNotificationTargetConfigurations(&sv.AuditNotificationTargetConfigurations, value); err != nil { return err } + 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) + } + default: _, _ = key, value @@ -11677,14 +11902,14 @@ func awsRestjson1_deserializeOpDocumentDescribeAuditFindingOutput(v **DescribeAu return nil } -type awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask struct { +type awsRestjson1_deserializeOpDescribeAuditFinding struct { } -func (*awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) ID() string { +func (*awsRestjson1_deserializeOpDescribeAuditFinding) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpDescribeAuditFinding) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11702,9 +11927,9 @@ func (m *awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) HandleDes } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorDescribeAuditMitigationActionsTask(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorDescribeAuditFinding(response, &metadata) } - output := &DescribeAuditMitigationActionsTaskOutput{} + output := &DescribeAuditFindingOutput{} out.Result = output var buff [1024]byte @@ -11725,7 +11950,7 @@ func (m *awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) HandleDes return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentDescribeAuditMitigationActionsTaskOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentDescribeAuditFindingOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11739,7 +11964,168 @@ func (m *awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) HandleDes return out, metadata, err } -func awsRestjson1_deserializeOpErrorDescribeAuditMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorDescribeAuditFinding(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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_deserializeOpDocumentDescribeAuditFindingOutput(v **DescribeAuditFindingOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeAuditFindingOutput + if *v == nil { + sv = &DescribeAuditFindingOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "finding": + if err := awsRestjson1_deserializeDocumentAuditFinding(&sv.Finding, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask struct { +} + +func (*awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeAuditMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDescribeAuditMitigationActionsTask(response, &metadata) + } + output := &DescribeAuditMitigationActionsTaskOutput{} + 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_deserializeOpDocumentDescribeAuditMitigationActionsTaskOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeAuditMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -19674,14 +20060,14 @@ func awsRestjson1_deserializeOpDocumentGetCardinalityOutput(v **GetCardinalityOu return nil } -type awsRestjson1_deserializeOpGetEffectivePolicies struct { +type awsRestjson1_deserializeOpGetCommand struct { } -func (*awsRestjson1_deserializeOpGetEffectivePolicies) ID() string { +func (*awsRestjson1_deserializeOpGetCommand) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetEffectivePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetCommand) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -19699,9 +20085,9 @@ func (m *awsRestjson1_deserializeOpGetEffectivePolicies) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetEffectivePolicies(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetCommand(response, &metadata) } - output := &GetEffectivePoliciesOutput{} + output := &GetCommandOutput{} out.Result = output var buff [1024]byte @@ -19722,7 +20108,7 @@ func (m *awsRestjson1_deserializeOpGetEffectivePolicies) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetEffectivePoliciesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetCommandOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -19736,7 +20122,7 @@ func (m *awsRestjson1_deserializeOpGetEffectivePolicies) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetEffectivePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetCommand(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -19777,26 +20163,17 @@ func awsRestjson1_deserializeOpErrorGetEffectivePolicies(response *smithyhttp.Re } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(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("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -19808,7 +20185,7 @@ func awsRestjson1_deserializeOpErrorGetEffectivePolicies(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentGetEffectivePoliciesOutput(v **GetEffectivePoliciesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetCommandOutput(v **GetCommandOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -19821,20 +20198,129 @@ func awsRestjson1_deserializeOpDocumentGetEffectivePoliciesOutput(v **GetEffecti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetEffectivePoliciesOutput + var sv *GetCommandOutput if *v == nil { - sv = &GetEffectivePoliciesOutput{} + sv = &GetCommandOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "effectivePolicies": - if err := awsRestjson1_deserializeDocumentEffectivePolicies(&sv.EffectivePolicies, value); err != nil { + case "commandArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandArn to be of type string, got %T instead", value) + } + sv.CommandArn = ptr.String(jtv) + } + + case "commandId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandId to be of type string, got %T instead", value) + } + sv.CommandId = 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 DateType to be a JSON Number, got %T instead", value) + + } + } + + case "deprecated": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected DeprecationFlag to be of type *bool, got %T instead", value) + } + sv.Deprecated = ptr.Bool(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "mandatoryParameters": + if err := awsRestjson1_deserializeDocumentCommandParameterList(&sv.MandatoryParameters, value); err != nil { + return err + } + + case "namespace": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandNamespace to be of type string, got %T instead", value) + } + sv.Namespace = types.CommandNamespace(jtv) + } + + case "payload": + if err := awsRestjson1_deserializeDocumentCommandPayload(&sv.Payload, value); err != nil { return err } + case "pendingDeletion": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BooleanWrapperObject to be of type *bool, got %T instead", value) + } + sv.PendingDeletion = ptr.Bool(jtv) + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) + } + default: _, _ = key, value @@ -19844,14 +20330,14 @@ func awsRestjson1_deserializeOpDocumentGetEffectivePoliciesOutput(v **GetEffecti return nil } -type awsRestjson1_deserializeOpGetIndexingConfiguration struct { +type awsRestjson1_deserializeOpGetCommandExecution struct { } -func (*awsRestjson1_deserializeOpGetIndexingConfiguration) ID() string { +func (*awsRestjson1_deserializeOpGetCommandExecution) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetIndexingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetCommandExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -19869,9 +20355,9 @@ func (m *awsRestjson1_deserializeOpGetIndexingConfiguration) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetIndexingConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetCommandExecution(response, &metadata) } - output := &GetIndexingConfigurationOutput{} + output := &GetCommandExecutionOutput{} out.Result = output var buff [1024]byte @@ -19892,7 +20378,7 @@ func (m *awsRestjson1_deserializeOpGetIndexingConfiguration) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetIndexingConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetCommandExecutionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -19906,7 +20392,7 @@ func (m *awsRestjson1_deserializeOpGetIndexingConfiguration) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetIndexingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetCommandExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -19947,20 +20433,17 @@ func awsRestjson1_deserializeOpErrorGetIndexingConfiguration(response *smithyhtt } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -19972,7 +20455,7 @@ func awsRestjson1_deserializeOpErrorGetIndexingConfiguration(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentGetIndexingConfigurationOutput(v **GetIndexingConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetCommandExecutionOutput(v **GetCommandExecutionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -19985,25 +20468,159 @@ func awsRestjson1_deserializeOpDocumentGetIndexingConfigurationOutput(v **GetInd return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetIndexingConfigurationOutput + var sv *GetCommandExecutionOutput if *v == nil { - sv = &GetIndexingConfigurationOutput{} + sv = &GetCommandExecutionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "thingGroupIndexingConfiguration": - if err := awsRestjson1_deserializeDocumentThingGroupIndexingConfiguration(&sv.ThingGroupIndexingConfiguration, value); err != nil { + case "commandArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandArn to be of type string, got %T instead", value) + } + sv.CommandArn = ptr.String(jtv) + } + + case "completedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + 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 DateType to be a JSON Number, got %T instead", value) + + } + } + + case "executionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandExecutionId to be of type string, got %T instead", value) + } + sv.ExecutionId = ptr.String(jtv) + } + + case "executionTimeoutSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CommandExecutionTimeoutInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExecutionTimeoutSeconds = ptr.Int64(i64) + } + + case "lastUpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "parameters": + if err := awsRestjson1_deserializeDocumentCommandExecutionParameterMap(&sv.Parameters, value); err != nil { return err } - case "thingIndexingConfiguration": - if err := awsRestjson1_deserializeDocumentThingIndexingConfiguration(&sv.ThingIndexingConfiguration, value); err != nil { + case "result": + if err := awsRestjson1_deserializeDocumentCommandExecutionResultMap(&sv.Result, value); err != nil { + return err + } + + case "startedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandExecutionStatus to be of type string, got %T instead", value) + } + sv.Status = types.CommandExecutionStatus(jtv) + } + + case "statusReason": + if err := awsRestjson1_deserializeDocumentStatusReason(&sv.StatusReason, value); err != nil { return err } + case "targetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value) + } + sv.TargetArn = ptr.String(jtv) + } + + case "timeToLive": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TimeToLive = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + default: _, _ = key, value @@ -20013,14 +20630,14 @@ func awsRestjson1_deserializeOpDocumentGetIndexingConfigurationOutput(v **GetInd return nil } -type awsRestjson1_deserializeOpGetJobDocument struct { +type awsRestjson1_deserializeOpGetEffectivePolicies struct { } -func (*awsRestjson1_deserializeOpGetJobDocument) ID() string { +func (*awsRestjson1_deserializeOpGetEffectivePolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetJobDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetEffectivePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -20038,9 +20655,9 @@ func (m *awsRestjson1_deserializeOpGetJobDocument) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetJobDocument(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetEffectivePolicies(response, &metadata) } - output := &GetJobDocumentOutput{} + output := &GetEffectivePoliciesOutput{} out.Result = output var buff [1024]byte @@ -20061,7 +20678,7 @@ func (m *awsRestjson1_deserializeOpGetJobDocument) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetJobDocumentOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetEffectivePoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20075,7 +20692,7 @@ func (m *awsRestjson1_deserializeOpGetJobDocument) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetJobDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetEffectivePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -20116,9 +20733,15 @@ func awsRestjson1_deserializeOpErrorGetJobDocument(response *smithyhttp.Response } switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -20128,6 +20751,9 @@ func awsRestjson1_deserializeOpErrorGetJobDocument(response *smithyhttp.Response case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -20138,7 +20764,7 @@ func awsRestjson1_deserializeOpErrorGetJobDocument(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentGetJobDocumentOutput(v **GetJobDocumentOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetEffectivePoliciesOutput(v **GetEffectivePoliciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20151,22 +20777,18 @@ func awsRestjson1_deserializeOpDocumentGetJobDocumentOutput(v **GetJobDocumentOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetJobDocumentOutput + var sv *GetEffectivePoliciesOutput if *v == nil { - sv = &GetJobDocumentOutput{} + sv = &GetEffectivePoliciesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "document": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected JobDocument to be of type string, got %T instead", value) - } - sv.Document = ptr.String(jtv) + case "effectivePolicies": + if err := awsRestjson1_deserializeDocumentEffectivePolicies(&sv.EffectivePolicies, value); err != nil { + return err } default: @@ -20178,14 +20800,14 @@ func awsRestjson1_deserializeOpDocumentGetJobDocumentOutput(v **GetJobDocumentOu return nil } -type awsRestjson1_deserializeOpGetLoggingOptions struct { +type awsRestjson1_deserializeOpGetIndexingConfiguration struct { } -func (*awsRestjson1_deserializeOpGetLoggingOptions) ID() string { +func (*awsRestjson1_deserializeOpGetIndexingConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetLoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetIndexingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -20203,9 +20825,9 @@ func (m *awsRestjson1_deserializeOpGetLoggingOptions) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetLoggingOptions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetIndexingConfiguration(response, &metadata) } - output := &GetLoggingOptionsOutput{} + output := &GetIndexingConfigurationOutput{} out.Result = output var buff [1024]byte @@ -20226,7 +20848,7 @@ func (m *awsRestjson1_deserializeOpGetLoggingOptions) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetLoggingOptionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetIndexingConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20240,7 +20862,7 @@ func (m *awsRestjson1_deserializeOpGetLoggingOptions) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetLoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetIndexingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -20281,8 +20903,8 @@ func awsRestjson1_deserializeOpErrorGetLoggingOptions(response *smithyhttp.Respo } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -20290,6 +20912,12 @@ func awsRestjson1_deserializeOpErrorGetLoggingOptions(response *smithyhttp.Respo case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -20300,7 +20928,7 @@ func awsRestjson1_deserializeOpErrorGetLoggingOptions(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetLoggingOptionsOutput(v **GetLoggingOptionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetIndexingConfigurationOutput(v **GetIndexingConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20313,31 +20941,23 @@ func awsRestjson1_deserializeOpDocumentGetLoggingOptionsOutput(v **GetLoggingOpt return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetLoggingOptionsOutput + var sv *GetIndexingConfigurationOutput if *v == nil { - sv = &GetLoggingOptionsOutput{} + sv = &GetIndexingConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "logLevel": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value) - } - sv.LogLevel = types.LogLevel(jtv) + case "thingGroupIndexingConfiguration": + if err := awsRestjson1_deserializeDocumentThingGroupIndexingConfiguration(&sv.ThingGroupIndexingConfiguration, value); err != nil { + return err } - case "roleArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) - } - sv.RoleArn = ptr.String(jtv) + case "thingIndexingConfiguration": + if err := awsRestjson1_deserializeDocumentThingIndexingConfiguration(&sv.ThingIndexingConfiguration, value); err != nil { + return err } default: @@ -20349,14 +20969,14 @@ func awsRestjson1_deserializeOpDocumentGetLoggingOptionsOutput(v **GetLoggingOpt return nil } -type awsRestjson1_deserializeOpGetOTAUpdate struct { +type awsRestjson1_deserializeOpGetJobDocument struct { } -func (*awsRestjson1_deserializeOpGetOTAUpdate) ID() string { +func (*awsRestjson1_deserializeOpGetJobDocument) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetOTAUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetJobDocument) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -20374,9 +20994,9 @@ func (m *awsRestjson1_deserializeOpGetOTAUpdate) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetOTAUpdate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetJobDocument(response, &metadata) } - output := &GetOTAUpdateOutput{} + output := &GetJobDocumentOutput{} out.Result = output var buff [1024]byte @@ -20397,7 +21017,7 @@ func (m *awsRestjson1_deserializeOpGetOTAUpdate) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetOTAUpdateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetJobDocumentOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20411,7 +21031,7 @@ func (m *awsRestjson1_deserializeOpGetOTAUpdate) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetOTAUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetJobDocument(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -20452,9 +21072,6 @@ func awsRestjson1_deserializeOpErrorGetOTAUpdate(response *smithyhttp.Response, } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -20467,9 +21084,6 @@ func awsRestjson1_deserializeOpErrorGetOTAUpdate(response *smithyhttp.Response, case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -20480,7 +21094,7 @@ func awsRestjson1_deserializeOpErrorGetOTAUpdate(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetOTAUpdateOutput(v **GetOTAUpdateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetJobDocumentOutput(v **GetJobDocumentOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20493,18 +21107,22 @@ func awsRestjson1_deserializeOpDocumentGetOTAUpdateOutput(v **GetOTAUpdateOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetOTAUpdateOutput + var sv *GetJobDocumentOutput if *v == nil { - sv = &GetOTAUpdateOutput{} + sv = &GetJobDocumentOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "otaUpdateInfo": - if err := awsRestjson1_deserializeDocumentOTAUpdateInfo(&sv.OtaUpdateInfo, value); err != nil { - return err + case "document": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected JobDocument to be of type string, got %T instead", value) + } + sv.Document = ptr.String(jtv) } default: @@ -20516,14 +21134,14 @@ func awsRestjson1_deserializeOpDocumentGetOTAUpdateOutput(v **GetOTAUpdateOutput return nil } -type awsRestjson1_deserializeOpGetPackage struct { +type awsRestjson1_deserializeOpGetLoggingOptions struct { } -func (*awsRestjson1_deserializeOpGetPackage) ID() string { +func (*awsRestjson1_deserializeOpGetLoggingOptions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetLoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -20541,9 +21159,9 @@ func (m *awsRestjson1_deserializeOpGetPackage) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPackage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetLoggingOptions(response, &metadata) } - output := &GetPackageOutput{} + output := &GetLoggingOptionsOutput{} out.Result = output var buff [1024]byte @@ -20564,7 +21182,7 @@ func (m *awsRestjson1_deserializeOpGetPackage) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPackageOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetLoggingOptionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20578,7 +21196,7 @@ func (m *awsRestjson1_deserializeOpGetPackage) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetLoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -20619,17 +21237,14 @@ func awsRestjson1_deserializeOpErrorGetPackage(response *smithyhttp.Response, me } switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -20641,7 +21256,7 @@ func awsRestjson1_deserializeOpErrorGetPackage(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentGetPackageOutput(v **GetPackageOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetLoggingOptionsOutput(v **GetLoggingOptionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20654,81 +21269,31 @@ func awsRestjson1_deserializeOpDocumentGetPackageOutput(v **GetPackageOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPackageOutput + var sv *GetLoggingOptionsOutput if *v == nil { - sv = &GetPackageOutput{} + sv = &GetLoggingOptionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected CreationDate to be a JSON Number, got %T instead", value) - - } - } - - case "defaultVersionName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected VersionName to be of type string, got %T instead", value) - } - sv.DefaultVersionName = ptr.String(jtv) - } - - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } - - case "lastModifiedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected LastModifiedDate to be a JSON Number, got %T instead", value) - - } - } - - case "packageArn": + case "logLevel": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PackageArn to be of type string, got %T instead", value) + return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value) } - sv.PackageArn = ptr.String(jtv) + sv.LogLevel = types.LogLevel(jtv) } - case "packageName": + case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) } - sv.PackageName = ptr.String(jtv) + sv.RoleArn = ptr.String(jtv) } default: @@ -20740,14 +21305,14 @@ func awsRestjson1_deserializeOpDocumentGetPackageOutput(v **GetPackageOutput, va return nil } -type awsRestjson1_deserializeOpGetPackageConfiguration struct { +type awsRestjson1_deserializeOpGetOTAUpdate struct { } -func (*awsRestjson1_deserializeOpGetPackageConfiguration) ID() string { +func (*awsRestjson1_deserializeOpGetOTAUpdate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPackageConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetOTAUpdate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -20765,9 +21330,9 @@ func (m *awsRestjson1_deserializeOpGetPackageConfiguration) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPackageConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetOTAUpdate(response, &metadata) } - output := &GetPackageConfigurationOutput{} + output := &GetOTAUpdateOutput{} out.Result = output var buff [1024]byte @@ -20788,7 +21353,7 @@ func (m *awsRestjson1_deserializeOpGetPackageConfiguration) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPackageConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetOTAUpdateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20802,7 +21367,7 @@ func (m *awsRestjson1_deserializeOpGetPackageConfiguration) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPackageConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetOTAUpdate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -20843,12 +21408,24 @@ func awsRestjson1_deserializeOpErrorGetPackageConfiguration(response *smithyhttp } switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -20859,7 +21436,7 @@ func awsRestjson1_deserializeOpErrorGetPackageConfiguration(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentGetPackageConfigurationOutput(v **GetPackageConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetOTAUpdateOutput(v **GetOTAUpdateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -20872,17 +21449,17 @@ func awsRestjson1_deserializeOpDocumentGetPackageConfigurationOutput(v **GetPack return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPackageConfigurationOutput + var sv *GetOTAUpdateOutput if *v == nil { - sv = &GetPackageConfigurationOutput{} + sv = &GetOTAUpdateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "versionUpdateByJobsConfig": - if err := awsRestjson1_deserializeDocumentVersionUpdateByJobsConfig(&sv.VersionUpdateByJobsConfig, value); err != nil { + case "otaUpdateInfo": + if err := awsRestjson1_deserializeDocumentOTAUpdateInfo(&sv.OtaUpdateInfo, value); err != nil { return err } @@ -20895,14 +21472,14 @@ func awsRestjson1_deserializeOpDocumentGetPackageConfigurationOutput(v **GetPack return nil } -type awsRestjson1_deserializeOpGetPackageVersion struct { +type awsRestjson1_deserializeOpGetPackage struct { } -func (*awsRestjson1_deserializeOpGetPackageVersion) ID() string { +func (*awsRestjson1_deserializeOpGetPackage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPackageVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -20920,9 +21497,9 @@ func (m *awsRestjson1_deserializeOpGetPackageVersion) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPackageVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPackage(response, &metadata) } - output := &GetPackageVersionOutput{} + output := &GetPackageOutput{} out.Result = output var buff [1024]byte @@ -20943,7 +21520,7 @@ func (m *awsRestjson1_deserializeOpGetPackageVersion) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPackageVersionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPackageOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -20957,7 +21534,7 @@ func (m *awsRestjson1_deserializeOpGetPackageVersion) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPackageVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -21020,7 +21597,7 @@ func awsRestjson1_deserializeOpErrorGetPackageVersion(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetPackageVersionOutput(v **GetPackageVersionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPackageOutput(v **GetPackageOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21033,25 +21610,15 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionOutput(v **GetPackageVer return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPackageVersionOutput + var sv *GetPackageOutput if *v == nil { - sv = &GetPackageVersionOutput{} + sv = &GetPackageOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "artifact": - if err := awsRestjson1_deserializeDocumentPackageVersionArtifact(&sv.Artifact, value); err != nil { - return err - } - - case "attributes": - if err := awsRestjson1_deserializeDocumentResourceAttributes(&sv.Attributes, value); err != nil { - return err - } - case "creationDate": if value != nil { switch jtv := value.(type) { @@ -21068,22 +21635,22 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionOutput(v **GetPackageVer } } - case "description": + case "defaultVersionName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected VersionName to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.DefaultVersionName = ptr.String(jtv) } - case "errorReason": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PackageVersionErrorReason to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value) } - sv.ErrorReason = ptr.String(jtv) + sv.Description = ptr.String(jtv) } case "lastModifiedDate": @@ -21102,63 +21669,22 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionOutput(v **GetPackageVer } } - case "packageName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) - } - sv.PackageName = ptr.String(jtv) - } - - case "packageVersionArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PackageVersionArn to be of type string, got %T instead", value) - } - sv.PackageVersionArn = ptr.String(jtv) - } - - case "recipe": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PackageVersionRecipe to be of type string, got %T instead", value) - } - sv.Recipe = ptr.String(jtv) - } - - case "sbom": - if err := awsRestjson1_deserializeDocumentSbom(&sv.Sbom, value); err != nil { - return err - } - - case "sbomValidationStatus": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SbomValidationStatus to be of type string, got %T instead", value) - } - sv.SbomValidationStatus = types.SbomValidationStatus(jtv) - } - - case "status": + case "packageArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PackageVersionStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected PackageArn to be of type string, got %T instead", value) } - sv.Status = types.PackageVersionStatus(jtv) + sv.PackageArn = ptr.String(jtv) } - case "versionName": + case "packageName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected VersionName to be of type string, got %T instead", value) + return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) } - sv.VersionName = ptr.String(jtv) + sv.PackageName = ptr.String(jtv) } default: @@ -21170,14 +21696,14 @@ func awsRestjson1_deserializeOpDocumentGetPackageVersionOutput(v **GetPackageVer return nil } -type awsRestjson1_deserializeOpGetPercentiles struct { +type awsRestjson1_deserializeOpGetPackageConfiguration struct { } -func (*awsRestjson1_deserializeOpGetPercentiles) ID() string { +func (*awsRestjson1_deserializeOpGetPackageConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPercentiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPackageConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -21195,9 +21721,9 @@ func (m *awsRestjson1_deserializeOpGetPercentiles) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPercentiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPackageConfiguration(response, &metadata) } - output := &GetPercentilesOutput{} + output := &GetPackageConfigurationOutput{} out.Result = output var buff [1024]byte @@ -21218,7 +21744,7 @@ func (m *awsRestjson1_deserializeOpGetPercentiles) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPercentilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPackageConfigurationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21232,7 +21758,7 @@ func (m *awsRestjson1_deserializeOpGetPercentiles) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPercentiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPackageConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -21273,33 +21799,12 @@ func awsRestjson1_deserializeOpErrorGetPercentiles(response *smithyhttp.Response } switch { - case strings.EqualFold("IndexNotReadyException", errorCode): - return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody) - - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidAggregationException", errorCode): - return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody) - - case strings.EqualFold("InvalidQueryException", errorCode): - return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -21310,7 +21815,7 @@ func awsRestjson1_deserializeOpErrorGetPercentiles(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentGetPercentilesOutput(v **GetPercentilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPackageConfigurationOutput(v **GetPackageConfigurationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21323,17 +21828,17 @@ func awsRestjson1_deserializeOpDocumentGetPercentilesOutput(v **GetPercentilesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPercentilesOutput + var sv *GetPackageConfigurationOutput if *v == nil { - sv = &GetPercentilesOutput{} + sv = &GetPackageConfigurationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "percentiles": - if err := awsRestjson1_deserializeDocumentPercentiles(&sv.Percentiles, value); err != nil { + case "versionUpdateByJobsConfig": + if err := awsRestjson1_deserializeDocumentVersionUpdateByJobsConfig(&sv.VersionUpdateByJobsConfig, value); err != nil { return err } @@ -21346,14 +21851,14 @@ func awsRestjson1_deserializeOpDocumentGetPercentilesOutput(v **GetPercentilesOu return nil } -type awsRestjson1_deserializeOpGetPolicy struct { +type awsRestjson1_deserializeOpGetPackageVersion struct { } -func (*awsRestjson1_deserializeOpGetPolicy) ID() string { +func (*awsRestjson1_deserializeOpGetPackageVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPackageVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -21371,9 +21876,9 @@ func (m *awsRestjson1_deserializeOpGetPolicy) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPackageVersion(response, &metadata) } - output := &GetPolicyOutput{} + output := &GetPackageVersionOutput{} out.Result = output var buff [1024]byte @@ -21394,7 +21899,7 @@ func (m *awsRestjson1_deserializeOpGetPolicy) HandleDeserialize(ctx context.Cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPackageVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21408,7 +21913,7 @@ func (m *awsRestjson1_deserializeOpGetPolicy) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPackageVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -21449,23 +21954,17 @@ func awsRestjson1_deserializeOpErrorGetPolicy(response *smithyhttp.Response, met } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -21477,7 +21976,7 @@ func awsRestjson1_deserializeOpErrorGetPolicy(response *smithyhttp.Response, met } } -func awsRestjson1_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPackageVersionOutput(v **GetPackageVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21490,15 +21989,25 @@ func awsRestjson1_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPolicyOutput + var sv *GetPackageVersionOutput if *v == nil { - sv = &GetPolicyOutput{} + sv = &GetPackageVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "artifact": + if err := awsRestjson1_deserializeDocumentPackageVersionArtifact(&sv.Artifact, value); err != nil { + return err + } + + case "attributes": + if err := awsRestjson1_deserializeDocumentResourceAttributes(&sv.Attributes, value); err != nil { + return err + } + case "creationDate": if value != nil { switch jtv := value.(type) { @@ -21510,27 +22019,27 @@ func awsRestjson1_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, valu sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected CreationDate to be a JSON Number, got %T instead", value) } } - case "defaultVersionId": + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourceDescription to be of type string, got %T instead", value) } - sv.DefaultVersionId = ptr.String(jtv) + sv.Description = ptr.String(jtv) } - case "generationId": + case "errorReason": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value) + return fmt.Errorf("expected PackageVersionErrorReason to be of type string, got %T instead", value) } - sv.GenerationId = ptr.String(jtv) + sv.ErrorReason = ptr.String(jtv) } case "lastModifiedDate": @@ -21544,36 +22053,68 @@ func awsRestjson1_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, valu sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected LastModifiedDate to be a JSON Number, got %T instead", value) } } - case "policyArn": + case "packageName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value) + return fmt.Errorf("expected PackageName to be of type string, got %T instead", value) } - sv.PolicyArn = ptr.String(jtv) + sv.PackageName = ptr.String(jtv) } - case "policyDocument": + case "packageVersionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) + return fmt.Errorf("expected PackageVersionArn to be of type string, got %T instead", value) } - sv.PolicyDocument = ptr.String(jtv) + sv.PackageVersionArn = ptr.String(jtv) } - case "policyName": + case "recipe": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + return fmt.Errorf("expected PackageVersionRecipe to be of type string, got %T instead", value) } - sv.PolicyName = ptr.String(jtv) + sv.Recipe = ptr.String(jtv) + } + + case "sbom": + if err := awsRestjson1_deserializeDocumentSbom(&sv.Sbom, value); err != nil { + return err + } + + case "sbomValidationStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SbomValidationStatus to be of type string, got %T instead", value) + } + sv.SbomValidationStatus = types.SbomValidationStatus(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PackageVersionStatus to be of type string, got %T instead", value) + } + sv.Status = types.PackageVersionStatus(jtv) + } + + case "versionName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected VersionName to be of type string, got %T instead", value) + } + sv.VersionName = ptr.String(jtv) } default: @@ -21585,14 +22126,14 @@ func awsRestjson1_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, valu return nil } -type awsRestjson1_deserializeOpGetPolicyVersion struct { +type awsRestjson1_deserializeOpGetPercentiles struct { } -func (*awsRestjson1_deserializeOpGetPolicyVersion) ID() string { +func (*awsRestjson1_deserializeOpGetPercentiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetPolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPercentiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -21610,9 +22151,9 @@ func (m *awsRestjson1_deserializeOpGetPolicyVersion) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetPolicyVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPercentiles(response, &metadata) } - output := &GetPolicyVersionOutput{} + output := &GetPercentilesOutput{} out.Result = output var buff [1024]byte @@ -21633,7 +22174,7 @@ func (m *awsRestjson1_deserializeOpGetPolicyVersion) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetPolicyVersionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPercentilesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21647,7 +22188,7 @@ func (m *awsRestjson1_deserializeOpGetPolicyVersion) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetPolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPercentiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -21688,9 +22229,18 @@ func awsRestjson1_deserializeOpErrorGetPolicyVersion(response *smithyhttp.Respon } switch { + case strings.EqualFold("IndexNotReadyException", errorCode): + return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidAggregationException", errorCode): + return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody) + + case strings.EqualFold("InvalidQueryException", errorCode): + return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -21716,7 +22266,7 @@ func awsRestjson1_deserializeOpErrorGetPolicyVersion(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetPolicyVersionOutput(v **GetPolicyVersionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPercentilesOutput(v **GetPercentilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21729,99 +22279,18 @@ func awsRestjson1_deserializeOpDocumentGetPolicyVersionOutput(v **GetPolicyVersi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetPolicyVersionOutput + var sv *GetPercentilesOutput if *v == nil { - sv = &GetPolicyVersionOutput{} + sv = &GetPercentilesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - - } - } - - case "generationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value) - } - sv.GenerationId = ptr.String(jtv) - } - - case "isDefaultVersion": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected IsDefaultVersion to be of type *bool, got %T instead", value) - } - sv.IsDefaultVersion = jtv - } - - case "lastModifiedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - - } - } - - case "policyArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value) - } - sv.PolicyArn = ptr.String(jtv) - } - - case "policyDocument": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) - } - sv.PolicyDocument = ptr.String(jtv) - } - - case "policyName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) - } - sv.PolicyName = ptr.String(jtv) - } - - case "policyVersionId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value) - } - sv.PolicyVersionId = ptr.String(jtv) + case "percentiles": + if err := awsRestjson1_deserializeDocumentPercentiles(&sv.Percentiles, value); err != nil { + return err } default: @@ -21833,14 +22302,14 @@ func awsRestjson1_deserializeOpDocumentGetPolicyVersionOutput(v **GetPolicyVersi return nil } -type awsRestjson1_deserializeOpGetRegistrationCode struct { +type awsRestjson1_deserializeOpGetPolicy struct { } -func (*awsRestjson1_deserializeOpGetRegistrationCode) ID() string { +func (*awsRestjson1_deserializeOpGetPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetRegistrationCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -21858,9 +22327,9 @@ func (m *awsRestjson1_deserializeOpGetRegistrationCode) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetRegistrationCode(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPolicy(response, &metadata) } - output := &GetRegistrationCodeOutput{} + output := &GetPolicyOutput{} out.Result = output var buff [1024]byte @@ -21881,7 +22350,7 @@ func (m *awsRestjson1_deserializeOpGetRegistrationCode) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetRegistrationCodeOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -21895,7 +22364,7 @@ func (m *awsRestjson1_deserializeOpGetRegistrationCode) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetRegistrationCode(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -21942,6 +22411,9 @@ func awsRestjson1_deserializeOpErrorGetRegistrationCode(response *smithyhttp.Res case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -21961,7 +22433,7 @@ func awsRestjson1_deserializeOpErrorGetRegistrationCode(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetRegistrationCodeOutput(v **GetRegistrationCodeOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPolicyOutput(v **GetPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -21974,22 +22446,90 @@ func awsRestjson1_deserializeOpDocumentGetRegistrationCodeOutput(v **GetRegistra return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetRegistrationCodeOutput + var sv *GetPolicyOutput if *v == nil { - sv = &GetRegistrationCodeOutput{} + sv = &GetPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "registrationCode": + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "defaultVersionId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RegistrationCode to be of type string, got %T instead", value) + return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value) } - sv.RegistrationCode = ptr.String(jtv) + sv.DefaultVersionId = ptr.String(jtv) + } + + case "generationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value) + } + sv.GenerationId = ptr.String(jtv) + } + + case "lastModifiedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "policyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value) + } + sv.PolicyArn = ptr.String(jtv) + } + + case "policyDocument": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) + } + sv.PolicyDocument = ptr.String(jtv) + } + + case "policyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + } + sv.PolicyName = ptr.String(jtv) } default: @@ -22001,14 +22541,14 @@ func awsRestjson1_deserializeOpDocumentGetRegistrationCodeOutput(v **GetRegistra return nil } -type awsRestjson1_deserializeOpGetStatistics struct { +type awsRestjson1_deserializeOpGetPolicyVersion struct { } -func (*awsRestjson1_deserializeOpGetStatistics) ID() string { +func (*awsRestjson1_deserializeOpGetPolicyVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetPolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -22026,9 +22566,9 @@ func (m *awsRestjson1_deserializeOpGetStatistics) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetStatistics(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetPolicyVersion(response, &metadata) } - output := &GetStatisticsOutput{} + output := &GetPolicyVersionOutput{} out.Result = output var buff [1024]byte @@ -22049,7 +22589,7 @@ func (m *awsRestjson1_deserializeOpGetStatistics) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetStatisticsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetPolicyVersionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -22063,7 +22603,7 @@ func (m *awsRestjson1_deserializeOpGetStatistics) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetPolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -22104,18 +22644,9 @@ func awsRestjson1_deserializeOpErrorGetStatistics(response *smithyhttp.Response, } switch { - case strings.EqualFold("IndexNotReadyException", errorCode): - return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidAggregationException", errorCode): - return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody) - - case strings.EqualFold("InvalidQueryException", errorCode): - return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -22141,7 +22672,7 @@ func awsRestjson1_deserializeOpErrorGetStatistics(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetStatisticsOutput(v **GetStatisticsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetPolicyVersionOutput(v **GetPolicyVersionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22154,18 +22685,99 @@ func awsRestjson1_deserializeOpDocumentGetStatisticsOutput(v **GetStatisticsOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetStatisticsOutput + var sv *GetPolicyVersionOutput if *v == nil { - sv = &GetStatisticsOutput{} + sv = &GetPolicyVersionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "statistics": - if err := awsRestjson1_deserializeDocumentStatistics(&sv.Statistics, value); err != nil { - return err + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "generationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value) + } + sv.GenerationId = ptr.String(jtv) + } + + case "isDefaultVersion": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsDefaultVersion to be of type *bool, got %T instead", value) + } + sv.IsDefaultVersion = jtv + } + + case "lastModifiedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "policyArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyArn to be of type string, got %T instead", value) + } + sv.PolicyArn = ptr.String(jtv) + } + + case "policyDocument": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyDocument to be of type string, got %T instead", value) + } + sv.PolicyDocument = ptr.String(jtv) + } + + case "policyName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyName to be of type string, got %T instead", value) + } + sv.PolicyName = ptr.String(jtv) + } + + case "policyVersionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PolicyVersionId to be of type string, got %T instead", value) + } + sv.PolicyVersionId = ptr.String(jtv) } default: @@ -22177,14 +22789,14 @@ func awsRestjson1_deserializeOpDocumentGetStatisticsOutput(v **GetStatisticsOutp return nil } -type awsRestjson1_deserializeOpGetTopicRule struct { +type awsRestjson1_deserializeOpGetRegistrationCode struct { } -func (*awsRestjson1_deserializeOpGetTopicRule) ID() string { +func (*awsRestjson1_deserializeOpGetRegistrationCode) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetRegistrationCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -22202,9 +22814,9 @@ func (m *awsRestjson1_deserializeOpGetTopicRule) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetTopicRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetRegistrationCode(response, &metadata) } - output := &GetTopicRuleOutput{} + output := &GetRegistrationCodeOutput{} out.Result = output var buff [1024]byte @@ -22225,7 +22837,7 @@ func (m *awsRestjson1_deserializeOpGetTopicRule) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetTopicRuleOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetRegistrationCodeOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -22239,7 +22851,7 @@ func (m *awsRestjson1_deserializeOpGetTopicRule) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetRegistrationCode(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -22280,8 +22892,8 @@ func awsRestjson1_deserializeOpErrorGetTopicRule(response *smithyhttp.Response, } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -22289,6 +22901,9 @@ func awsRestjson1_deserializeOpErrorGetTopicRule(response *smithyhttp.Response, case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -22302,7 +22917,7 @@ func awsRestjson1_deserializeOpErrorGetTopicRule(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentGetTopicRuleOutput(v **GetTopicRuleOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetRegistrationCodeOutput(v **GetRegistrationCodeOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22315,27 +22930,22 @@ func awsRestjson1_deserializeOpDocumentGetTopicRuleOutput(v **GetTopicRuleOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetTopicRuleOutput + var sv *GetRegistrationCodeOutput if *v == nil { - sv = &GetTopicRuleOutput{} + sv = &GetRegistrationCodeOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "rule": - if err := awsRestjson1_deserializeDocumentTopicRule(&sv.Rule, value); err != nil { - return err - } - - case "ruleArn": + case "registrationCode": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RuleArn to be of type string, got %T instead", value) + return fmt.Errorf("expected RegistrationCode to be of type string, got %T instead", value) } - sv.RuleArn = ptr.String(jtv) + sv.RegistrationCode = ptr.String(jtv) } default: @@ -22347,14 +22957,14 @@ func awsRestjson1_deserializeOpDocumentGetTopicRuleOutput(v **GetTopicRuleOutput return nil } -type awsRestjson1_deserializeOpGetTopicRuleDestination struct { +type awsRestjson1_deserializeOpGetStatistics struct { } -func (*awsRestjson1_deserializeOpGetTopicRuleDestination) ID() string { +func (*awsRestjson1_deserializeOpGetStatistics) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetStatistics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -22372,9 +22982,9 @@ func (m *awsRestjson1_deserializeOpGetTopicRuleDestination) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetTopicRuleDestination(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetStatistics(response, &metadata) } - output := &GetTopicRuleDestinationOutput{} + output := &GetStatisticsOutput{} out.Result = output var buff [1024]byte @@ -22395,7 +23005,7 @@ func (m *awsRestjson1_deserializeOpGetTopicRuleDestination) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetTopicRuleDestinationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetStatisticsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -22409,7 +23019,7 @@ func (m *awsRestjson1_deserializeOpGetTopicRuleDestination) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetStatistics(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -22450,15 +23060,30 @@ func awsRestjson1_deserializeOpErrorGetTopicRuleDestination(response *smithyhttp } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("IndexNotReadyException", errorCode): + return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody) + + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidAggregationException", errorCode): + return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody) + + case strings.EqualFold("InvalidQueryException", errorCode): + return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -22472,7 +23097,7 @@ func awsRestjson1_deserializeOpErrorGetTopicRuleDestination(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentGetTopicRuleDestinationOutput(v **GetTopicRuleDestinationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetStatisticsOutput(v **GetStatisticsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22485,17 +23110,17 @@ func awsRestjson1_deserializeOpDocumentGetTopicRuleDestinationOutput(v **GetTopi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetTopicRuleDestinationOutput + var sv *GetStatisticsOutput if *v == nil { - sv = &GetTopicRuleDestinationOutput{} + sv = &GetStatisticsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "topicRuleDestination": - if err := awsRestjson1_deserializeDocumentTopicRuleDestination(&sv.TopicRuleDestination, value); err != nil { + case "statistics": + if err := awsRestjson1_deserializeDocumentStatistics(&sv.Statistics, value); err != nil { return err } @@ -22508,14 +23133,14 @@ func awsRestjson1_deserializeOpDocumentGetTopicRuleDestinationOutput(v **GetTopi return nil } -type awsRestjson1_deserializeOpGetV2LoggingOptions struct { +type awsRestjson1_deserializeOpGetTopicRule struct { } -func (*awsRestjson1_deserializeOpGetV2LoggingOptions) ID() string { +func (*awsRestjson1_deserializeOpGetTopicRule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetV2LoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -22533,9 +23158,9 @@ func (m *awsRestjson1_deserializeOpGetV2LoggingOptions) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetV2LoggingOptions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetTopicRule(response, &metadata) } - output := &GetV2LoggingOptionsOutput{} + output := &GetTopicRuleOutput{} out.Result = output var buff [1024]byte @@ -22556,7 +23181,7 @@ func (m *awsRestjson1_deserializeOpGetV2LoggingOptions) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetV2LoggingOptionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetTopicRuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -22570,7 +23195,7 @@ func (m *awsRestjson1_deserializeOpGetV2LoggingOptions) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetV2LoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -22614,12 +23239,15 @@ func awsRestjson1_deserializeOpErrorGetV2LoggingOptions(response *smithyhttp.Res case strings.EqualFold("InternalException", errorCode): return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("NotConfiguredException", errorCode): - return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -22630,7 +23258,7 @@ func awsRestjson1_deserializeOpErrorGetV2LoggingOptions(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentGetV2LoggingOptionsOutput(v **GetV2LoggingOptionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetTopicRuleOutput(v **GetTopicRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22643,40 +23271,27 @@ func awsRestjson1_deserializeOpDocumentGetV2LoggingOptionsOutput(v **GetV2Loggin return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetV2LoggingOptionsOutput + var sv *GetTopicRuleOutput if *v == nil { - sv = &GetV2LoggingOptionsOutput{} + sv = &GetTopicRuleOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "defaultLogLevel": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value) - } - sv.DefaultLogLevel = types.LogLevel(jtv) - } - - case "disableAllLogs": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected DisableAllLogs to be of type *bool, got %T instead", value) - } - sv.DisableAllLogs = jtv + case "rule": + if err := awsRestjson1_deserializeDocumentTopicRule(&sv.Rule, value); err != nil { + return err } - case "roleArn": + case "ruleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) + return fmt.Errorf("expected RuleArn to be of type string, got %T instead", value) } - sv.RoleArn = ptr.String(jtv) + sv.RuleArn = ptr.String(jtv) } default: @@ -22688,14 +23303,14 @@ func awsRestjson1_deserializeOpDocumentGetV2LoggingOptionsOutput(v **GetV2Loggin return nil } -type awsRestjson1_deserializeOpListActiveViolations struct { +type awsRestjson1_deserializeOpGetTopicRuleDestination struct { } -func (*awsRestjson1_deserializeOpListActiveViolations) ID() string { +func (*awsRestjson1_deserializeOpGetTopicRuleDestination) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListActiveViolations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -22713,9 +23328,9 @@ func (m *awsRestjson1_deserializeOpListActiveViolations) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListActiveViolations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetTopicRuleDestination(response, &metadata) } - output := &ListActiveViolationsOutput{} + output := &GetTopicRuleDestinationOutput{} out.Result = output var buff [1024]byte @@ -22736,7 +23351,7 @@ func (m *awsRestjson1_deserializeOpListActiveViolations) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListActiveViolationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetTopicRuleDestinationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -22750,7 +23365,7 @@ func (m *awsRestjson1_deserializeOpListActiveViolations) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListActiveViolations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -22791,17 +23406,17 @@ func awsRestjson1_deserializeOpErrorListActiveViolations(response *smithyhttp.Re } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -22813,7 +23428,7 @@ func awsRestjson1_deserializeOpErrorListActiveViolations(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListActiveViolationsOutput(v **ListActiveViolationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetTopicRuleDestinationOutput(v **GetTopicRuleDestinationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -22826,29 +23441,20 @@ func awsRestjson1_deserializeOpDocumentListActiveViolationsOutput(v **ListActive return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListActiveViolationsOutput + var sv *GetTopicRuleDestinationOutput if *v == nil { - sv = &ListActiveViolationsOutput{} + sv = &GetTopicRuleDestinationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "activeViolations": - if err := awsRestjson1_deserializeDocumentActiveViolations(&sv.ActiveViolations, value); err != nil { + case "topicRuleDestination": + if err := awsRestjson1_deserializeDocumentTopicRuleDestination(&sv.TopicRuleDestination, value); err != nil { return err } - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -22858,14 +23464,14 @@ func awsRestjson1_deserializeOpDocumentListActiveViolationsOutput(v **ListActive return nil } -type awsRestjson1_deserializeOpListAttachedPolicies struct { +type awsRestjson1_deserializeOpGetV2LoggingOptions struct { } -func (*awsRestjson1_deserializeOpListAttachedPolicies) ID() string { +func (*awsRestjson1_deserializeOpGetV2LoggingOptions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAttachedPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetV2LoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -22883,9 +23489,9 @@ func (m *awsRestjson1_deserializeOpListAttachedPolicies) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAttachedPolicies(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetV2LoggingOptions(response, &metadata) } - output := &ListAttachedPoliciesOutput{} + output := &GetV2LoggingOptionsOutput{} out.Result = output var buff [1024]byte @@ -22906,7 +23512,7 @@ func (m *awsRestjson1_deserializeOpListAttachedPolicies) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAttachedPoliciesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetV2LoggingOptionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -22920,7 +23526,7 @@ func (m *awsRestjson1_deserializeOpListAttachedPolicies) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAttachedPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetV2LoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -22961,27 +23567,15 @@ func awsRestjson1_deserializeOpErrorListAttachedPolicies(response *smithyhttp.Re } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("NotConfiguredException", errorCode): + return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -22992,7 +23586,7 @@ func awsRestjson1_deserializeOpErrorListAttachedPolicies(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListAttachedPoliciesOutput(v **ListAttachedPoliciesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetV2LoggingOptionsOutput(v **GetV2LoggingOptionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -23005,27 +23599,40 @@ func awsRestjson1_deserializeOpDocumentListAttachedPoliciesOutput(v **ListAttach return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAttachedPoliciesOutput + var sv *GetV2LoggingOptionsOutput if *v == nil { - sv = &ListAttachedPoliciesOutput{} + sv = &GetV2LoggingOptionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextMarker": + case "defaultLogLevel": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) + return fmt.Errorf("expected LogLevel to be of type string, got %T instead", value) } - sv.NextMarker = ptr.String(jtv) + sv.DefaultLogLevel = types.LogLevel(jtv) } - case "policies": - if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil { - return err + case "disableAllLogs": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected DisableAllLogs to be of type *bool, got %T instead", value) + } + sv.DisableAllLogs = jtv + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) } default: @@ -23037,14 +23644,14 @@ func awsRestjson1_deserializeOpDocumentListAttachedPoliciesOutput(v **ListAttach return nil } -type awsRestjson1_deserializeOpListAuditFindings struct { +type awsRestjson1_deserializeOpListActiveViolations struct { } -func (*awsRestjson1_deserializeOpListAuditFindings) ID() string { +func (*awsRestjson1_deserializeOpListActiveViolations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAuditFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListActiveViolations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23062,9 +23669,9 @@ func (m *awsRestjson1_deserializeOpListAuditFindings) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAuditFindings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListActiveViolations(response, &metadata) } - output := &ListAuditFindingsOutput{} + output := &ListActiveViolationsOutput{} out.Result = output var buff [1024]byte @@ -23085,7 +23692,7 @@ func (m *awsRestjson1_deserializeOpListAuditFindings) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAuditFindingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListActiveViolationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23099,7 +23706,7 @@ func (m *awsRestjson1_deserializeOpListAuditFindings) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAuditFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListActiveViolations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23146,6 +23753,9 @@ func awsRestjson1_deserializeOpErrorListAuditFindings(response *smithyhttp.Respo case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -23159,7 +23769,7 @@ func awsRestjson1_deserializeOpErrorListAuditFindings(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListAuditFindingsOutput(v **ListAuditFindingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListActiveViolationsOutput(v **ListActiveViolationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -23172,17 +23782,17 @@ func awsRestjson1_deserializeOpDocumentListAuditFindingsOutput(v **ListAuditFind return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAuditFindingsOutput + var sv *ListActiveViolationsOutput if *v == nil { - sv = &ListAuditFindingsOutput{} + sv = &ListActiveViolationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "findings": - if err := awsRestjson1_deserializeDocumentAuditFindings(&sv.Findings, value); err != nil { + case "activeViolations": + if err := awsRestjson1_deserializeDocumentActiveViolations(&sv.ActiveViolations, value); err != nil { return err } @@ -23204,14 +23814,14 @@ func awsRestjson1_deserializeOpDocumentListAuditFindingsOutput(v **ListAuditFind return nil } -type awsRestjson1_deserializeOpListAuditMitigationActionsExecutions struct { +type awsRestjson1_deserializeOpListAttachedPolicies struct { } -func (*awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) ID() string { +func (*awsRestjson1_deserializeOpListAttachedPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAttachedPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23229,9 +23839,9 @@ func (m *awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) HandleD } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAuditMitigationActionsExecutions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAttachedPolicies(response, &metadata) } - output := &ListAuditMitigationActionsExecutionsOutput{} + output := &ListAttachedPoliciesOutput{} out.Result = output var buff [1024]byte @@ -23252,7 +23862,7 @@ func (m *awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) HandleD return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAuditMitigationActionsExecutionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAttachedPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23266,7 +23876,7 @@ func (m *awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) HandleD return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAuditMitigationActionsExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAttachedPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23313,9 +23923,21 @@ func awsRestjson1_deserializeOpErrorListAuditMitigationActionsExecutions(respons case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -23326,7 +23948,7 @@ func awsRestjson1_deserializeOpErrorListAuditMitigationActionsExecutions(respons } } -func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsExecutionsOutput(v **ListAuditMitigationActionsExecutionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAttachedPoliciesOutput(v **ListAttachedPoliciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -23339,27 +23961,27 @@ func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsExecutionsOutpu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAuditMitigationActionsExecutionsOutput + var sv *ListAttachedPoliciesOutput if *v == nil { - sv = &ListAuditMitigationActionsExecutionsOutput{} + sv = &ListAttachedPoliciesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "actionsExecutions": - if err := awsRestjson1_deserializeDocumentAuditMitigationActionExecutionMetadataList(&sv.ActionsExecutions, value); err != nil { - return err - } - - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) + } + + case "policies": + if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil { + return err } default: @@ -23371,14 +23993,14 @@ func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsExecutionsOutpu return nil } -type awsRestjson1_deserializeOpListAuditMitigationActionsTasks struct { +type awsRestjson1_deserializeOpListAuditFindings struct { } -func (*awsRestjson1_deserializeOpListAuditMitigationActionsTasks) ID() string { +func (*awsRestjson1_deserializeOpListAuditFindings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAuditMitigationActionsTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAuditFindings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23396,9 +24018,9 @@ func (m *awsRestjson1_deserializeOpListAuditMitigationActionsTasks) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAuditMitigationActionsTasks(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAuditFindings(response, &metadata) } - output := &ListAuditMitigationActionsTasksOutput{} + output := &ListAuditFindingsOutput{} out.Result = output var buff [1024]byte @@ -23419,7 +24041,7 @@ func (m *awsRestjson1_deserializeOpListAuditMitigationActionsTasks) HandleDeseri return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAuditFindingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23433,7 +24055,7 @@ func (m *awsRestjson1_deserializeOpListAuditMitigationActionsTasks) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAuditMitigationActionsTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAuditFindings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23493,7 +24115,7 @@ func awsRestjson1_deserializeOpErrorListAuditMitigationActionsTasks(response *sm } } -func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(v **ListAuditMitigationActionsTasksOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAuditFindingsOutput(v **ListAuditFindingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -23506,15 +24128,20 @@ func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(v * return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAuditMitigationActionsTasksOutput + var sv *ListAuditFindingsOutput if *v == nil { - sv = &ListAuditMitigationActionsTasksOutput{} + sv = &ListAuditFindingsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "findings": + if err := awsRestjson1_deserializeDocumentAuditFindings(&sv.Findings, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -23524,11 +24151,6 @@ func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(v * sv.NextToken = ptr.String(jtv) } - case "tasks": - if err := awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadataList(&sv.Tasks, value); err != nil { - return err - } - default: _, _ = key, value @@ -23538,14 +24160,14 @@ func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(v * return nil } -type awsRestjson1_deserializeOpListAuditSuppressions struct { +type awsRestjson1_deserializeOpListAuditMitigationActionsExecutions struct { } -func (*awsRestjson1_deserializeOpListAuditSuppressions) ID() string { +func (*awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAuditSuppressions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAuditMitigationActionsExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23563,9 +24185,9 @@ func (m *awsRestjson1_deserializeOpListAuditSuppressions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAuditSuppressions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAuditMitigationActionsExecutions(response, &metadata) } - output := &ListAuditSuppressionsOutput{} + output := &ListAuditMitigationActionsExecutionsOutput{} out.Result = output var buff [1024]byte @@ -23586,7 +24208,7 @@ func (m *awsRestjson1_deserializeOpListAuditSuppressions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAuditMitigationActionsExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23600,7 +24222,7 @@ func (m *awsRestjson1_deserializeOpListAuditSuppressions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAuditSuppressions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAuditMitigationActionsExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23660,7 +24282,7 @@ func awsRestjson1_deserializeOpErrorListAuditSuppressions(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(v **ListAuditSuppressionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsExecutionsOutput(v **ListAuditMitigationActionsExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -23673,15 +24295,20 @@ func awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(v **ListAudit return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAuditSuppressionsOutput + var sv *ListAuditMitigationActionsExecutionsOutput if *v == nil { - sv = &ListAuditSuppressionsOutput{} + sv = &ListAuditMitigationActionsExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "actionsExecutions": + if err := awsRestjson1_deserializeDocumentAuditMitigationActionExecutionMetadataList(&sv.ActionsExecutions, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -23691,11 +24318,6 @@ func awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(v **ListAudit sv.NextToken = ptr.String(jtv) } - case "suppressions": - if err := awsRestjson1_deserializeDocumentAuditSuppressionList(&sv.Suppressions, value); err != nil { - return err - } - default: _, _ = key, value @@ -23705,14 +24327,14 @@ func awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(v **ListAudit return nil } -type awsRestjson1_deserializeOpListAuditTasks struct { +type awsRestjson1_deserializeOpListAuditMitigationActionsTasks struct { } -func (*awsRestjson1_deserializeOpListAuditTasks) ID() string { +func (*awsRestjson1_deserializeOpListAuditMitigationActionsTasks) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAuditTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAuditMitigationActionsTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23730,9 +24352,9 @@ func (m *awsRestjson1_deserializeOpListAuditTasks) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAuditTasks(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAuditMitigationActionsTasks(response, &metadata) } - output := &ListAuditTasksOutput{} + output := &ListAuditMitigationActionsTasksOutput{} out.Result = output var buff [1024]byte @@ -23753,7 +24375,7 @@ func (m *awsRestjson1_deserializeOpListAuditTasks) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAuditTasksOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23767,7 +24389,7 @@ func (m *awsRestjson1_deserializeOpListAuditTasks) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAuditTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAuditMitigationActionsTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23827,7 +24449,7 @@ func awsRestjson1_deserializeOpErrorListAuditTasks(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListAuditTasksOutput(v **ListAuditTasksOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAuditMitigationActionsTasksOutput(v **ListAuditMitigationActionsTasksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -23840,9 +24462,9 @@ func awsRestjson1_deserializeOpDocumentListAuditTasksOutput(v **ListAuditTasksOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAuditTasksOutput + var sv *ListAuditMitigationActionsTasksOutput if *v == nil { - sv = &ListAuditTasksOutput{} + sv = &ListAuditMitigationActionsTasksOutput{} } else { sv = *v } @@ -23859,7 +24481,7 @@ func awsRestjson1_deserializeOpDocumentListAuditTasksOutput(v **ListAuditTasksOu } case "tasks": - if err := awsRestjson1_deserializeDocumentAuditTaskMetadataList(&sv.Tasks, value); err != nil { + if err := awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadataList(&sv.Tasks, value); err != nil { return err } @@ -23872,14 +24494,14 @@ func awsRestjson1_deserializeOpDocumentListAuditTasksOutput(v **ListAuditTasksOu return nil } -type awsRestjson1_deserializeOpListAuthorizers struct { +type awsRestjson1_deserializeOpListAuditSuppressions struct { } -func (*awsRestjson1_deserializeOpListAuthorizers) ID() string { +func (*awsRestjson1_deserializeOpListAuditSuppressions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAuthorizers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAuditSuppressions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -23897,9 +24519,9 @@ func (m *awsRestjson1_deserializeOpListAuthorizers) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAuthorizers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAuditSuppressions(response, &metadata) } - output := &ListAuthorizersOutput{} + output := &ListAuditSuppressionsOutput{} out.Result = output var buff [1024]byte @@ -23920,7 +24542,7 @@ func (m *awsRestjson1_deserializeOpListAuthorizers) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAuthorizersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -23934,7 +24556,7 @@ func (m *awsRestjson1_deserializeOpListAuthorizers) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAuthorizers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAuditSuppressions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -23981,15 +24603,9 @@ func awsRestjson1_deserializeOpErrorListAuthorizers(response *smithyhttp.Respons case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -24000,7 +24616,7 @@ func awsRestjson1_deserializeOpErrorListAuthorizers(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListAuthorizersOutput(v **ListAuthorizersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAuditSuppressionsOutput(v **ListAuditSuppressionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24013,27 +24629,27 @@ func awsRestjson1_deserializeOpDocumentListAuthorizersOutput(v **ListAuthorizers return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAuthorizersOutput + var sv *ListAuditSuppressionsOutput if *v == nil { - sv = &ListAuthorizersOutput{} + sv = &ListAuditSuppressionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "authorizers": - if err := awsRestjson1_deserializeDocumentAuthorizers(&sv.Authorizers, value); err != nil { - return err - } - - case "nextMarker": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.NextMarker = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) + } + + case "suppressions": + if err := awsRestjson1_deserializeDocumentAuditSuppressionList(&sv.Suppressions, value); err != nil { + return err } default: @@ -24045,14 +24661,14 @@ func awsRestjson1_deserializeOpDocumentListAuthorizersOutput(v **ListAuthorizers return nil } -type awsRestjson1_deserializeOpListBillingGroups struct { +type awsRestjson1_deserializeOpListAuditTasks struct { } -func (*awsRestjson1_deserializeOpListBillingGroups) ID() string { +func (*awsRestjson1_deserializeOpListAuditTasks) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListBillingGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAuditTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -24070,9 +24686,9 @@ func (m *awsRestjson1_deserializeOpListBillingGroups) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListBillingGroups(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAuditTasks(response, &metadata) } - output := &ListBillingGroupsOutput{} + output := &ListAuditTasksOutput{} out.Result = output var buff [1024]byte @@ -24093,7 +24709,7 @@ func (m *awsRestjson1_deserializeOpListBillingGroups) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAuditTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24107,7 +24723,7 @@ func (m *awsRestjson1_deserializeOpListBillingGroups) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListBillingGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAuditTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -24154,9 +24770,6 @@ func awsRestjson1_deserializeOpErrorListBillingGroups(response *smithyhttp.Respo case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -24170,7 +24783,7 @@ func awsRestjson1_deserializeOpErrorListBillingGroups(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(v **ListBillingGroupsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAuditTasksOutput(v **ListAuditTasksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24183,20 +24796,15 @@ func awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(v **ListBillingGr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListBillingGroupsOutput + var sv *ListAuditTasksOutput if *v == nil { - sv = &ListBillingGroupsOutput{} + sv = &ListAuditTasksOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "billingGroups": - if err := awsRestjson1_deserializeDocumentBillingGroupNameAndArnList(&sv.BillingGroups, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -24206,6 +24814,11 @@ func awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(v **ListBillingGr sv.NextToken = ptr.String(jtv) } + case "tasks": + if err := awsRestjson1_deserializeDocumentAuditTaskMetadataList(&sv.Tasks, value); err != nil { + return err + } + default: _, _ = key, value @@ -24215,14 +24828,14 @@ func awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(v **ListBillingGr return nil } -type awsRestjson1_deserializeOpListCACertificates struct { +type awsRestjson1_deserializeOpListAuthorizers struct { } -func (*awsRestjson1_deserializeOpListCACertificates) ID() string { +func (*awsRestjson1_deserializeOpListAuthorizers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCACertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListAuthorizers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -24240,9 +24853,9 @@ func (m *awsRestjson1_deserializeOpListCACertificates) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCACertificates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListAuthorizers(response, &metadata) } - output := &ListCACertificatesOutput{} + output := &ListAuthorizersOutput{} out.Result = output var buff [1024]byte @@ -24263,7 +24876,7 @@ func (m *awsRestjson1_deserializeOpListCACertificates) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCACertificatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListAuthorizersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24277,7 +24890,7 @@ func (m *awsRestjson1_deserializeOpListCACertificates) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCACertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListAuthorizers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -24343,7 +24956,7 @@ func awsRestjson1_deserializeOpErrorListCACertificates(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListCACertificatesOutput(v **ListCACertificatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListAuthorizersOutput(v **ListAuthorizersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24356,17 +24969,17 @@ func awsRestjson1_deserializeOpDocumentListCACertificatesOutput(v **ListCACertif return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCACertificatesOutput + var sv *ListAuthorizersOutput if *v == nil { - sv = &ListCACertificatesOutput{} + sv = &ListAuthorizersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "certificates": - if err := awsRestjson1_deserializeDocumentCACertificates(&sv.Certificates, value); err != nil { + case "authorizers": + if err := awsRestjson1_deserializeDocumentAuthorizers(&sv.Authorizers, value); err != nil { return err } @@ -24388,14 +25001,14 @@ func awsRestjson1_deserializeOpDocumentListCACertificatesOutput(v **ListCACertif return nil } -type awsRestjson1_deserializeOpListCertificateProviders struct { +type awsRestjson1_deserializeOpListBillingGroups struct { } -func (*awsRestjson1_deserializeOpListCertificateProviders) ID() string { +func (*awsRestjson1_deserializeOpListBillingGroups) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCertificateProviders) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListBillingGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -24413,9 +25026,9 @@ func (m *awsRestjson1_deserializeOpListCertificateProviders) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCertificateProviders(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListBillingGroups(response, &metadata) } - output := &ListCertificateProvidersOutput{} + output := &ListBillingGroupsOutput{} out.Result = output var buff [1024]byte @@ -24436,7 +25049,7 @@ func (m *awsRestjson1_deserializeOpListCertificateProviders) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCertificateProvidersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24450,7 +25063,7 @@ func (m *awsRestjson1_deserializeOpListCertificateProviders) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCertificateProviders(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListBillingGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -24497,15 +25110,12 @@ func awsRestjson1_deserializeOpErrorListCertificateProviders(response *smithyhtt case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -24516,7 +25126,7 @@ func awsRestjson1_deserializeOpErrorListCertificateProviders(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListCertificateProvidersOutput(v **ListCertificateProvidersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListBillingGroupsOutput(v **ListBillingGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24529,17 +25139,17 @@ func awsRestjson1_deserializeOpDocumentListCertificateProvidersOutput(v **ListCe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCertificateProvidersOutput + var sv *ListBillingGroupsOutput if *v == nil { - sv = &ListCertificateProvidersOutput{} + sv = &ListBillingGroupsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "certificateProviders": - if err := awsRestjson1_deserializeDocumentCertificateProviders(&sv.CertificateProviders, value); err != nil { + case "billingGroups": + if err := awsRestjson1_deserializeDocumentBillingGroupNameAndArnList(&sv.BillingGroups, value); err != nil { return err } @@ -24547,7 +25157,7 @@ func awsRestjson1_deserializeOpDocumentListCertificateProvidersOutput(v **ListCe if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } @@ -24561,14 +25171,14 @@ func awsRestjson1_deserializeOpDocumentListCertificateProvidersOutput(v **ListCe return nil } -type awsRestjson1_deserializeOpListCertificates struct { +type awsRestjson1_deserializeOpListCACertificates struct { } -func (*awsRestjson1_deserializeOpListCertificates) ID() string { +func (*awsRestjson1_deserializeOpListCACertificates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCACertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -24586,9 +25196,9 @@ func (m *awsRestjson1_deserializeOpListCertificates) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCertificates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCACertificates(response, &metadata) } - output := &ListCertificatesOutput{} + output := &ListCACertificatesOutput{} out.Result = output var buff [1024]byte @@ -24609,7 +25219,7 @@ func (m *awsRestjson1_deserializeOpListCertificates) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCertificatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCACertificatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24623,7 +25233,7 @@ func (m *awsRestjson1_deserializeOpListCertificates) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCACertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -24689,7 +25299,7 @@ func awsRestjson1_deserializeOpErrorListCertificates(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListCertificatesOutput(v **ListCertificatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCACertificatesOutput(v **ListCACertificatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24702,9 +25312,9 @@ func awsRestjson1_deserializeOpDocumentListCertificatesOutput(v **ListCertificat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCertificatesOutput + var sv *ListCACertificatesOutput if *v == nil { - sv = &ListCertificatesOutput{} + sv = &ListCACertificatesOutput{} } else { sv = *v } @@ -24712,7 +25322,7 @@ func awsRestjson1_deserializeOpDocumentListCertificatesOutput(v **ListCertificat for key, value := range shape { switch key { case "certificates": - if err := awsRestjson1_deserializeDocumentCertificates(&sv.Certificates, value); err != nil { + if err := awsRestjson1_deserializeDocumentCACertificates(&sv.Certificates, value); err != nil { return err } @@ -24734,14 +25344,14 @@ func awsRestjson1_deserializeOpDocumentListCertificatesOutput(v **ListCertificat return nil } -type awsRestjson1_deserializeOpListCertificatesByCA struct { +type awsRestjson1_deserializeOpListCertificateProviders struct { } -func (*awsRestjson1_deserializeOpListCertificatesByCA) ID() string { +func (*awsRestjson1_deserializeOpListCertificateProviders) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCertificatesByCA) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCertificateProviders) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -24759,9 +25369,9 @@ func (m *awsRestjson1_deserializeOpListCertificatesByCA) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCertificatesByCA(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCertificateProviders(response, &metadata) } - output := &ListCertificatesByCAOutput{} + output := &ListCertificateProvidersOutput{} out.Result = output var buff [1024]byte @@ -24782,7 +25392,7 @@ func (m *awsRestjson1_deserializeOpListCertificatesByCA) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCertificatesByCAOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCertificateProvidersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24796,7 +25406,7 @@ func (m *awsRestjson1_deserializeOpListCertificatesByCA) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCertificatesByCA(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCertificateProviders(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -24862,7 +25472,7 @@ func awsRestjson1_deserializeOpErrorListCertificatesByCA(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListCertificatesByCAOutput(v **ListCertificatesByCAOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCertificateProvidersOutput(v **ListCertificateProvidersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -24875,27 +25485,27 @@ func awsRestjson1_deserializeOpDocumentListCertificatesByCAOutput(v **ListCertif return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCertificatesByCAOutput + var sv *ListCertificateProvidersOutput if *v == nil { - sv = &ListCertificatesByCAOutput{} + sv = &ListCertificateProvidersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "certificates": - if err := awsRestjson1_deserializeDocumentCertificates(&sv.Certificates, value); err != nil { + case "certificateProviders": + if err := awsRestjson1_deserializeDocumentCertificateProviders(&sv.CertificateProviders, value); err != nil { return err } - case "nextMarker": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextMarker = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -24907,14 +25517,14 @@ func awsRestjson1_deserializeOpDocumentListCertificatesByCAOutput(v **ListCertif return nil } -type awsRestjson1_deserializeOpListCustomMetrics struct { +type awsRestjson1_deserializeOpListCertificates struct { } -func (*awsRestjson1_deserializeOpListCustomMetrics) ID() string { +func (*awsRestjson1_deserializeOpListCertificates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListCustomMetrics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -24932,9 +25542,9 @@ func (m *awsRestjson1_deserializeOpListCustomMetrics) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListCustomMetrics(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCertificates(response, &metadata) } - output := &ListCustomMetricsOutput{} + output := &ListCertificatesOutput{} out.Result = output var buff [1024]byte @@ -24955,7 +25565,7 @@ func (m *awsRestjson1_deserializeOpListCustomMetrics) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListCustomMetricsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCertificatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -24969,7 +25579,7 @@ func (m *awsRestjson1_deserializeOpListCustomMetrics) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorListCustomMetrics(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -25016,9 +25626,15 @@ func awsRestjson1_deserializeOpErrorListCustomMetrics(response *smithyhttp.Respo case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -25029,7 +25645,7 @@ func awsRestjson1_deserializeOpErrorListCustomMetrics(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentListCustomMetricsOutput(v **ListCustomMetricsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCertificatesOutput(v **ListCertificatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25042,27 +25658,27 @@ func awsRestjson1_deserializeOpDocumentListCustomMetricsOutput(v **ListCustomMet return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCustomMetricsOutput + var sv *ListCertificatesOutput if *v == nil { - sv = &ListCustomMetricsOutput{} + sv = &ListCertificatesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "metricNames": - if err := awsRestjson1_deserializeDocumentMetricNames(&sv.MetricNames, value); err != nil { + case "certificates": + if err := awsRestjson1_deserializeDocumentCertificates(&sv.Certificates, value); err != nil { return err } - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) } default: @@ -25074,14 +25690,14 @@ func awsRestjson1_deserializeOpDocumentListCustomMetricsOutput(v **ListCustomMet return nil } -type awsRestjson1_deserializeOpListDetectMitigationActionsExecutions struct { +type awsRestjson1_deserializeOpListCertificatesByCA struct { } -func (*awsRestjson1_deserializeOpListDetectMitigationActionsExecutions) ID() string { +func (*awsRestjson1_deserializeOpListCertificatesByCA) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDetectMitigationActionsExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCertificatesByCA) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -25099,9 +25715,9 @@ func (m *awsRestjson1_deserializeOpListDetectMitigationActionsExecutions) Handle } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDetectMitigationActionsExecutions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCertificatesByCA(response, &metadata) } - output := &ListDetectMitigationActionsExecutionsOutput{} + output := &ListCertificatesByCAOutput{} out.Result = output var buff [1024]byte @@ -25122,7 +25738,7 @@ func (m *awsRestjson1_deserializeOpListDetectMitigationActionsExecutions) Handle return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDetectMitigationActionsExecutionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCertificatesByCAOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -25136,7 +25752,7 @@ func (m *awsRestjson1_deserializeOpListDetectMitigationActionsExecutions) Handle return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDetectMitigationActionsExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCertificatesByCA(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -25183,9 +25799,15 @@ func awsRestjson1_deserializeOpErrorListDetectMitigationActionsExecutions(respon case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -25196,7 +25818,7 @@ func awsRestjson1_deserializeOpErrorListDetectMitigationActionsExecutions(respon } } -func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsExecutionsOutput(v **ListDetectMitigationActionsExecutionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCertificatesByCAOutput(v **ListCertificatesByCAOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25209,27 +25831,27 @@ func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsExecutionsOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDetectMitigationActionsExecutionsOutput + var sv *ListCertificatesByCAOutput if *v == nil { - sv = &ListDetectMitigationActionsExecutionsOutput{} + sv = &ListCertificatesByCAOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "actionsExecutions": - if err := awsRestjson1_deserializeDocumentDetectMitigationActionExecutionList(&sv.ActionsExecutions, value); err != nil { + case "certificates": + if err := awsRestjson1_deserializeDocumentCertificates(&sv.Certificates, value); err != nil { return err } - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) } default: @@ -25241,14 +25863,14 @@ func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsExecutionsOutp return nil } -type awsRestjson1_deserializeOpListDetectMitigationActionsTasks struct { +type awsRestjson1_deserializeOpListCommandExecutions struct { } -func (*awsRestjson1_deserializeOpListDetectMitigationActionsTasks) ID() string { +func (*awsRestjson1_deserializeOpListCommandExecutions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDetectMitigationActionsTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCommandExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -25266,9 +25888,9 @@ func (m *awsRestjson1_deserializeOpListDetectMitigationActionsTasks) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDetectMitigationActionsTasks(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCommandExecutions(response, &metadata) } - output := &ListDetectMitigationActionsTasksOutput{} + output := &ListCommandExecutionsOutput{} out.Result = output var buff [1024]byte @@ -25289,7 +25911,7 @@ func (m *awsRestjson1_deserializeOpListDetectMitigationActionsTasks) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDetectMitigationActionsTasksOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCommandExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -25303,7 +25925,7 @@ func (m *awsRestjson1_deserializeOpListDetectMitigationActionsTasks) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDetectMitigationActionsTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCommandExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -25344,15 +25966,18 @@ func awsRestjson1_deserializeOpErrorListDetectMitigationActionsTasks(response *s } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(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, @@ -25363,7 +25988,7 @@ func awsRestjson1_deserializeOpErrorListDetectMitigationActionsTasks(response *s } } -func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsTasksOutput(v **ListDetectMitigationActionsTasksOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCommandExecutionsOutput(v **ListCommandExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25376,15 +26001,20 @@ func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsTasksOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDetectMitigationActionsTasksOutput + var sv *ListCommandExecutionsOutput if *v == nil { - sv = &ListDetectMitigationActionsTasksOutput{} + sv = &ListCommandExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "commandExecutions": + if err := awsRestjson1_deserializeDocumentCommandExecutionSummaryList(&sv.CommandExecutions, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -25394,11 +26024,6 @@ func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsTasksOutput(v sv.NextToken = ptr.String(jtv) } - case "tasks": - if err := awsRestjson1_deserializeDocumentDetectMitigationActionsTaskSummaryList(&sv.Tasks, value); err != nil { - return err - } - default: _, _ = key, value @@ -25408,14 +26033,14 @@ func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsTasksOutput(v return nil } -type awsRestjson1_deserializeOpListDimensions struct { +type awsRestjson1_deserializeOpListCommands struct { } -func (*awsRestjson1_deserializeOpListDimensions) ID() string { +func (*awsRestjson1_deserializeOpListCommands) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDimensions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCommands) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -25433,9 +26058,9 @@ func (m *awsRestjson1_deserializeOpListDimensions) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDimensions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCommands(response, &metadata) } - output := &ListDimensionsOutput{} + output := &ListCommandsOutput{} out.Result = output var buff [1024]byte @@ -25456,7 +26081,7 @@ func (m *awsRestjson1_deserializeOpListDimensions) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDimensionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCommandsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -25470,7 +26095,7 @@ func (m *awsRestjson1_deserializeOpListDimensions) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDimensions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCommands(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -25511,15 +26136,15 @@ func awsRestjson1_deserializeOpErrorListDimensions(response *smithyhttp.Response } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(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, @@ -25530,7 +26155,7 @@ func awsRestjson1_deserializeOpErrorListDimensions(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListDimensionsOutput(v **ListDimensionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25543,17 +26168,17 @@ func awsRestjson1_deserializeOpDocumentListDimensionsOutput(v **ListDimensionsOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDimensionsOutput + var sv *ListCommandsOutput if *v == nil { - sv = &ListDimensionsOutput{} + sv = &ListCommandsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "dimensionNames": - if err := awsRestjson1_deserializeDocumentDimensionNames(&sv.DimensionNames, value); err != nil { + case "commands": + if err := awsRestjson1_deserializeDocumentCommandSummaryList(&sv.Commands, value); err != nil { return err } @@ -25575,14 +26200,14 @@ func awsRestjson1_deserializeOpDocumentListDimensionsOutput(v **ListDimensionsOu return nil } -type awsRestjson1_deserializeOpListDomainConfigurations struct { +type awsRestjson1_deserializeOpListCustomMetrics struct { } -func (*awsRestjson1_deserializeOpListDomainConfigurations) ID() string { +func (*awsRestjson1_deserializeOpListCustomMetrics) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListDomainConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListCustomMetrics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -25600,9 +26225,9 @@ func (m *awsRestjson1_deserializeOpListDomainConfigurations) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListDomainConfigurations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListCustomMetrics(response, &metadata) } - output := &ListDomainConfigurationsOutput{} + output := &ListCustomMetricsOutput{} out.Result = output var buff [1024]byte @@ -25623,7 +26248,7 @@ func (m *awsRestjson1_deserializeOpListDomainConfigurations) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListDomainConfigurationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListCustomMetricsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -25637,7 +26262,7 @@ func (m *awsRestjson1_deserializeOpListDomainConfigurations) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListDomainConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListCustomMetrics(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -25684,15 +26309,9 @@ func awsRestjson1_deserializeOpErrorListDomainConfigurations(response *smithyhtt case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -25703,7 +26322,7 @@ func awsRestjson1_deserializeOpErrorListDomainConfigurations(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListDomainConfigurationsOutput(v **ListDomainConfigurationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListCustomMetricsOutput(v **ListCustomMetricsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25716,27 +26335,27 @@ func awsRestjson1_deserializeOpDocumentListDomainConfigurationsOutput(v **ListDo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDomainConfigurationsOutput + var sv *ListCustomMetricsOutput if *v == nil { - sv = &ListDomainConfigurationsOutput{} + sv = &ListCustomMetricsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "domainConfigurations": - if err := awsRestjson1_deserializeDocumentDomainConfigurations(&sv.DomainConfigurations, value); err != nil { + case "metricNames": + if err := awsRestjson1_deserializeDocumentMetricNames(&sv.MetricNames, value); err != nil { return err } - case "nextMarker": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.NextMarker = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -25748,14 +26367,14 @@ func awsRestjson1_deserializeOpDocumentListDomainConfigurationsOutput(v **ListDo return nil } -type awsRestjson1_deserializeOpListFleetMetrics struct { +type awsRestjson1_deserializeOpListDetectMitigationActionsExecutions struct { } -func (*awsRestjson1_deserializeOpListFleetMetrics) ID() string { +func (*awsRestjson1_deserializeOpListDetectMitigationActionsExecutions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListFleetMetrics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDetectMitigationActionsExecutions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -25773,9 +26392,9 @@ func (m *awsRestjson1_deserializeOpListFleetMetrics) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListFleetMetrics(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDetectMitigationActionsExecutions(response, &metadata) } - output := &ListFleetMetricsOutput{} + output := &ListDetectMitigationActionsExecutionsOutput{} out.Result = output var buff [1024]byte @@ -25796,7 +26415,7 @@ func (m *awsRestjson1_deserializeOpListFleetMetrics) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListFleetMetricsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDetectMitigationActionsExecutionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -25810,7 +26429,7 @@ func (m *awsRestjson1_deserializeOpListFleetMetrics) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListFleetMetrics(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDetectMitigationActionsExecutions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -25857,15 +26476,9 @@ func awsRestjson1_deserializeOpErrorListFleetMetrics(response *smithyhttp.Respon case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -25876,7 +26489,7 @@ func awsRestjson1_deserializeOpErrorListFleetMetrics(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListFleetMetricsOutput(v **ListFleetMetricsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsExecutionsOutput(v **ListDetectMitigationActionsExecutionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -25889,17 +26502,17 @@ func awsRestjson1_deserializeOpDocumentListFleetMetricsOutput(v **ListFleetMetri return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListFleetMetricsOutput + var sv *ListDetectMitigationActionsExecutionsOutput if *v == nil { - sv = &ListFleetMetricsOutput{} + sv = &ListDetectMitigationActionsExecutionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "fleetMetrics": - if err := awsRestjson1_deserializeDocumentFleetMetricNameAndArnList(&sv.FleetMetrics, value); err != nil { + case "actionsExecutions": + if err := awsRestjson1_deserializeDocumentDetectMitigationActionExecutionList(&sv.ActionsExecutions, value); err != nil { return err } @@ -25921,14 +26534,14 @@ func awsRestjson1_deserializeOpDocumentListFleetMetricsOutput(v **ListFleetMetri return nil } -type awsRestjson1_deserializeOpListIndices struct { +type awsRestjson1_deserializeOpListDetectMitigationActionsTasks struct { } -func (*awsRestjson1_deserializeOpListIndices) ID() string { +func (*awsRestjson1_deserializeOpListDetectMitigationActionsTasks) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListIndices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDetectMitigationActionsTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -25946,9 +26559,9 @@ func (m *awsRestjson1_deserializeOpListIndices) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListIndices(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDetectMitigationActionsTasks(response, &metadata) } - output := &ListIndicesOutput{} + output := &ListDetectMitigationActionsTasksOutput{} out.Result = output var buff [1024]byte @@ -25969,7 +26582,7 @@ func (m *awsRestjson1_deserializeOpListIndices) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListIndicesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDetectMitigationActionsTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -25983,7 +26596,7 @@ func (m *awsRestjson1_deserializeOpListIndices) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListIndices(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDetectMitigationActionsTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -26030,15 +26643,9 @@ func awsRestjson1_deserializeOpErrorListIndices(response *smithyhttp.Response, m case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -26049,7 +26656,7 @@ func awsRestjson1_deserializeOpErrorListIndices(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListIndicesOutput(v **ListIndicesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDetectMitigationActionsTasksOutput(v **ListDetectMitigationActionsTasksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -26062,20 +26669,15 @@ func awsRestjson1_deserializeOpDocumentListIndicesOutput(v **ListIndicesOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListIndicesOutput + var sv *ListDetectMitigationActionsTasksOutput if *v == nil { - sv = &ListIndicesOutput{} + sv = &ListDetectMitigationActionsTasksOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "indexNames": - if err := awsRestjson1_deserializeDocumentIndexNamesList(&sv.IndexNames, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -26085,6 +26687,11 @@ func awsRestjson1_deserializeOpDocumentListIndicesOutput(v **ListIndicesOutput, sv.NextToken = ptr.String(jtv) } + case "tasks": + if err := awsRestjson1_deserializeDocumentDetectMitigationActionsTaskSummaryList(&sv.Tasks, value); err != nil { + return err + } + default: _, _ = key, value @@ -26094,14 +26701,14 @@ func awsRestjson1_deserializeOpDocumentListIndicesOutput(v **ListIndicesOutput, return nil } -type awsRestjson1_deserializeOpListJobExecutionsForJob struct { +type awsRestjson1_deserializeOpListDimensions struct { } -func (*awsRestjson1_deserializeOpListJobExecutionsForJob) ID() string { +func (*awsRestjson1_deserializeOpListDimensions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListJobExecutionsForJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDimensions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -26119,9 +26726,9 @@ func (m *awsRestjson1_deserializeOpListJobExecutionsForJob) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListJobExecutionsForJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDimensions(response, &metadata) } - output := &ListJobExecutionsForJobOutput{} + output := &ListDimensionsOutput{} out.Result = output var buff [1024]byte @@ -26142,7 +26749,7 @@ func (m *awsRestjson1_deserializeOpListJobExecutionsForJob) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListJobExecutionsForJobOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDimensionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -26156,7 +26763,7 @@ func (m *awsRestjson1_deserializeOpListJobExecutionsForJob) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListJobExecutionsForJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDimensions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -26197,15 +26804,12 @@ func awsRestjson1_deserializeOpErrorListJobExecutionsForJob(response *smithyhttp } switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -26219,7 +26823,7 @@ func awsRestjson1_deserializeOpErrorListJobExecutionsForJob(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListJobExecutionsForJobOutput(v **ListJobExecutionsForJobOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDimensionsOutput(v **ListDimensionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -26232,17 +26836,17 @@ func awsRestjson1_deserializeOpDocumentListJobExecutionsForJobOutput(v **ListJob return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListJobExecutionsForJobOutput + var sv *ListDimensionsOutput if *v == nil { - sv = &ListJobExecutionsForJobOutput{} + sv = &ListDimensionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "executionSummaries": - if err := awsRestjson1_deserializeDocumentJobExecutionSummaryForJobList(&sv.ExecutionSummaries, value); err != nil { + case "dimensionNames": + if err := awsRestjson1_deserializeDocumentDimensionNames(&sv.DimensionNames, value); err != nil { return err } @@ -26264,14 +26868,14 @@ func awsRestjson1_deserializeOpDocumentListJobExecutionsForJobOutput(v **ListJob return nil } -type awsRestjson1_deserializeOpListJobExecutionsForThing struct { +type awsRestjson1_deserializeOpListDomainConfigurations struct { } -func (*awsRestjson1_deserializeOpListJobExecutionsForThing) ID() string { +func (*awsRestjson1_deserializeOpListDomainConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListJobExecutionsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListDomainConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -26289,9 +26893,9 @@ func (m *awsRestjson1_deserializeOpListJobExecutionsForThing) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListJobExecutionsForThing(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListDomainConfigurations(response, &metadata) } - output := &ListJobExecutionsForThingOutput{} + output := &ListDomainConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -26312,7 +26916,7 @@ func (m *awsRestjson1_deserializeOpListJobExecutionsForThing) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListJobExecutionsForThingOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListDomainConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -26326,7 +26930,7 @@ func (m *awsRestjson1_deserializeOpListJobExecutionsForThing) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorListJobExecutionsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListDomainConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -26367,18 +26971,21 @@ func awsRestjson1_deserializeOpErrorListJobExecutionsForThing(response *smithyht } switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -26389,7 +26996,7 @@ func awsRestjson1_deserializeOpErrorListJobExecutionsForThing(response *smithyht } } -func awsRestjson1_deserializeOpDocumentListJobExecutionsForThingOutput(v **ListJobExecutionsForThingOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListDomainConfigurationsOutput(v **ListDomainConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -26402,27 +27009,27 @@ func awsRestjson1_deserializeOpDocumentListJobExecutionsForThingOutput(v **ListJ return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListJobExecutionsForThingOutput + var sv *ListDomainConfigurationsOutput if *v == nil { - sv = &ListJobExecutionsForThingOutput{} + sv = &ListDomainConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "executionSummaries": - if err := awsRestjson1_deserializeDocumentJobExecutionSummaryForThingList(&sv.ExecutionSummaries, value); err != nil { + case "domainConfigurations": + if err := awsRestjson1_deserializeDocumentDomainConfigurations(&sv.DomainConfigurations, value); err != nil { return err } - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) } default: @@ -26434,14 +27041,14 @@ func awsRestjson1_deserializeOpDocumentListJobExecutionsForThingOutput(v **ListJ return nil } -type awsRestjson1_deserializeOpListJobs struct { +type awsRestjson1_deserializeOpListFleetMetrics struct { } -func (*awsRestjson1_deserializeOpListJobs) ID() string { +func (*awsRestjson1_deserializeOpListFleetMetrics) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListFleetMetrics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -26459,9 +27066,9 @@ func (m *awsRestjson1_deserializeOpListJobs) HandleDeserialize(ctx context.Conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListJobs(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListFleetMetrics(response, &metadata) } - output := &ListJobsOutput{} + output := &ListFleetMetricsOutput{} out.Result = output var buff [1024]byte @@ -26482,7 +27089,7 @@ func (m *awsRestjson1_deserializeOpListJobs) HandleDeserialize(ctx context.Conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListJobsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListFleetMetricsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -26496,7 +27103,7 @@ func (m *awsRestjson1_deserializeOpListJobs) HandleDeserialize(ctx context.Conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListFleetMetrics(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -26537,18 +27144,21 @@ func awsRestjson1_deserializeOpErrorListJobs(response *smithyhttp.Response, meta } switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -26559,7 +27169,7 @@ func awsRestjson1_deserializeOpErrorListJobs(response *smithyhttp.Response, meta } } -func awsRestjson1_deserializeOpDocumentListJobsOutput(v **ListJobsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListFleetMetricsOutput(v **ListFleetMetricsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -26572,17 +27182,17 @@ func awsRestjson1_deserializeOpDocumentListJobsOutput(v **ListJobsOutput, value return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListJobsOutput + var sv *ListFleetMetricsOutput if *v == nil { - sv = &ListJobsOutput{} + sv = &ListFleetMetricsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "jobs": - if err := awsRestjson1_deserializeDocumentJobSummaryList(&sv.Jobs, value); err != nil { + case "fleetMetrics": + if err := awsRestjson1_deserializeDocumentFleetMetricNameAndArnList(&sv.FleetMetrics, value); err != nil { return err } @@ -26604,14 +27214,14 @@ func awsRestjson1_deserializeOpDocumentListJobsOutput(v **ListJobsOutput, value return nil } -type awsRestjson1_deserializeOpListJobTemplates struct { +type awsRestjson1_deserializeOpListIndices struct { } -func (*awsRestjson1_deserializeOpListJobTemplates) ID() string { +func (*awsRestjson1_deserializeOpListIndices) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListJobTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListIndices) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -26629,9 +27239,9 @@ func (m *awsRestjson1_deserializeOpListJobTemplates) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListJobTemplates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListIndices(response, &metadata) } - output := &ListJobTemplatesOutput{} + output := &ListIndicesOutput{} out.Result = output var buff [1024]byte @@ -26652,7 +27262,7 @@ func (m *awsRestjson1_deserializeOpListJobTemplates) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListJobTemplatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListIndicesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -26666,7 +27276,7 @@ func (m *awsRestjson1_deserializeOpListJobTemplates) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListJobTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListIndices(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -26713,9 +27323,15 @@ func awsRestjson1_deserializeOpErrorListJobTemplates(response *smithyhttp.Respon case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -26726,7 +27342,7 @@ func awsRestjson1_deserializeOpErrorListJobTemplates(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListJobTemplatesOutput(v **ListJobTemplatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListIndicesOutput(v **ListIndicesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -26739,17 +27355,17 @@ func awsRestjson1_deserializeOpDocumentListJobTemplatesOutput(v **ListJobTemplat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListJobTemplatesOutput + var sv *ListIndicesOutput if *v == nil { - sv = &ListJobTemplatesOutput{} + sv = &ListIndicesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "jobTemplates": - if err := awsRestjson1_deserializeDocumentJobTemplateSummaryList(&sv.JobTemplates, value); err != nil { + case "indexNames": + if err := awsRestjson1_deserializeDocumentIndexNamesList(&sv.IndexNames, value); err != nil { return err } @@ -26771,14 +27387,14 @@ func awsRestjson1_deserializeOpDocumentListJobTemplatesOutput(v **ListJobTemplat return nil } -type awsRestjson1_deserializeOpListManagedJobTemplates struct { +type awsRestjson1_deserializeOpListJobExecutionsForJob struct { } -func (*awsRestjson1_deserializeOpListManagedJobTemplates) ID() string { +func (*awsRestjson1_deserializeOpListJobExecutionsForJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListManagedJobTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListJobExecutionsForJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -26796,9 +27412,9 @@ func (m *awsRestjson1_deserializeOpListManagedJobTemplates) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListManagedJobTemplates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListJobExecutionsForJob(response, &metadata) } - output := &ListManagedJobTemplatesOutput{} + output := &ListJobExecutionsForJobOutput{} out.Result = output var buff [1024]byte @@ -26819,7 +27435,7 @@ func (m *awsRestjson1_deserializeOpListManagedJobTemplates) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListManagedJobTemplatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListJobExecutionsForJobOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -26833,7 +27449,7 @@ func (m *awsRestjson1_deserializeOpListManagedJobTemplates) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListManagedJobTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListJobExecutionsForJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -26874,15 +27490,15 @@ func awsRestjson1_deserializeOpErrorListManagedJobTemplates(response *smithyhttp } switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -26896,7 +27512,7 @@ func awsRestjson1_deserializeOpErrorListManagedJobTemplates(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListManagedJobTemplatesOutput(v **ListManagedJobTemplatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListJobExecutionsForJobOutput(v **ListJobExecutionsForJobOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -26909,17 +27525,17 @@ func awsRestjson1_deserializeOpDocumentListManagedJobTemplatesOutput(v **ListMan return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListManagedJobTemplatesOutput + var sv *ListJobExecutionsForJobOutput if *v == nil { - sv = &ListManagedJobTemplatesOutput{} + sv = &ListJobExecutionsForJobOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "managedJobTemplates": - if err := awsRestjson1_deserializeDocumentManagedJobTemplatesSummaryList(&sv.ManagedJobTemplates, value); err != nil { + case "executionSummaries": + if err := awsRestjson1_deserializeDocumentJobExecutionSummaryForJobList(&sv.ExecutionSummaries, value); err != nil { return err } @@ -26941,14 +27557,14 @@ func awsRestjson1_deserializeOpDocumentListManagedJobTemplatesOutput(v **ListMan return nil } -type awsRestjson1_deserializeOpListMetricValues struct { +type awsRestjson1_deserializeOpListJobExecutionsForThing struct { } -func (*awsRestjson1_deserializeOpListMetricValues) ID() string { +func (*awsRestjson1_deserializeOpListJobExecutionsForThing) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMetricValues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListJobExecutionsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -26966,9 +27582,9 @@ func (m *awsRestjson1_deserializeOpListMetricValues) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListMetricValues(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListJobExecutionsForThing(response, &metadata) } - output := &ListMetricValuesOutput{} + output := &ListJobExecutionsForThingOutput{} out.Result = output var buff [1024]byte @@ -26989,7 +27605,7 @@ func (m *awsRestjson1_deserializeOpListMetricValues) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMetricValuesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListJobExecutionsForThingOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -27003,7 +27619,7 @@ func (m *awsRestjson1_deserializeOpListMetricValues) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMetricValues(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListJobExecutionsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -27044,15 +27660,15 @@ func awsRestjson1_deserializeOpErrorListMetricValues(response *smithyhttp.Respon } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -27066,7 +27682,7 @@ func awsRestjson1_deserializeOpErrorListMetricValues(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentListMetricValuesOutput(v **ListMetricValuesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListJobExecutionsForThingOutput(v **ListJobExecutionsForThingOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -27079,17 +27695,17 @@ func awsRestjson1_deserializeOpDocumentListMetricValuesOutput(v **ListMetricValu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMetricValuesOutput + var sv *ListJobExecutionsForThingOutput if *v == nil { - sv = &ListMetricValuesOutput{} + sv = &ListJobExecutionsForThingOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "metricDatumList": - if err := awsRestjson1_deserializeDocumentMetricDatumList(&sv.MetricDatumList, value); err != nil { + case "executionSummaries": + if err := awsRestjson1_deserializeDocumentJobExecutionSummaryForThingList(&sv.ExecutionSummaries, value); err != nil { return err } @@ -27111,14 +27727,14 @@ func awsRestjson1_deserializeOpDocumentListMetricValuesOutput(v **ListMetricValu return nil } -type awsRestjson1_deserializeOpListMitigationActions struct { +type awsRestjson1_deserializeOpListJobs struct { } -func (*awsRestjson1_deserializeOpListMitigationActions) ID() string { +func (*awsRestjson1_deserializeOpListJobs) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListMitigationActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListJobs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -27136,9 +27752,9 @@ func (m *awsRestjson1_deserializeOpListMitigationActions) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListMitigationActions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListJobs(response, &metadata) } - output := &ListMitigationActionsOutput{} + output := &ListJobsOutput{} out.Result = output var buff [1024]byte @@ -27159,7 +27775,7 @@ func (m *awsRestjson1_deserializeOpListMitigationActions) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListMitigationActionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListJobsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -27173,7 +27789,7 @@ func (m *awsRestjson1_deserializeOpListMitigationActions) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListMitigationActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListJobs(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -27214,12 +27830,15 @@ func awsRestjson1_deserializeOpErrorListMitigationActions(response *smithyhttp.R } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -27233,7 +27852,7 @@ func awsRestjson1_deserializeOpErrorListMitigationActions(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListMitigationActionsOutput(v **ListMitigationActionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListJobsOutput(v **ListJobsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -27246,17 +27865,17 @@ func awsRestjson1_deserializeOpDocumentListMitigationActionsOutput(v **ListMitig return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListMitigationActionsOutput + var sv *ListJobsOutput if *v == nil { - sv = &ListMitigationActionsOutput{} + sv = &ListJobsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "actionIdentifiers": - if err := awsRestjson1_deserializeDocumentMitigationActionIdentifierList(&sv.ActionIdentifiers, value); err != nil { + case "jobs": + if err := awsRestjson1_deserializeDocumentJobSummaryList(&sv.Jobs, value); err != nil { return err } @@ -27278,14 +27897,14 @@ func awsRestjson1_deserializeOpDocumentListMitigationActionsOutput(v **ListMitig return nil } -type awsRestjson1_deserializeOpListOTAUpdates struct { +type awsRestjson1_deserializeOpListJobTemplates struct { } -func (*awsRestjson1_deserializeOpListOTAUpdates) ID() string { +func (*awsRestjson1_deserializeOpListJobTemplates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListOTAUpdates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListJobTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -27303,9 +27922,9 @@ func (m *awsRestjson1_deserializeOpListOTAUpdates) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListOTAUpdates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListJobTemplates(response, &metadata) } - output := &ListOTAUpdatesOutput{} + output := &ListJobTemplatesOutput{} out.Result = output var buff [1024]byte @@ -27326,7 +27945,7 @@ func (m *awsRestjson1_deserializeOpListOTAUpdates) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListJobTemplatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -27340,7 +27959,7 @@ func (m *awsRestjson1_deserializeOpListOTAUpdates) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListOTAUpdates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListJobTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -27387,15 +28006,9 @@ func awsRestjson1_deserializeOpErrorListOTAUpdates(response *smithyhttp.Response case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -27406,7 +28019,7 @@ func awsRestjson1_deserializeOpErrorListOTAUpdates(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(v **ListOTAUpdatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListJobTemplatesOutput(v **ListJobTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -27419,15 +28032,20 @@ func awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(v **ListOTAUpdatesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListOTAUpdatesOutput + var sv *ListJobTemplatesOutput if *v == nil { - sv = &ListOTAUpdatesOutput{} + sv = &ListJobTemplatesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "jobTemplates": + if err := awsRestjson1_deserializeDocumentJobTemplateSummaryList(&sv.JobTemplates, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -27437,11 +28055,6 @@ func awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(v **ListOTAUpdatesOu sv.NextToken = ptr.String(jtv) } - case "otaUpdates": - if err := awsRestjson1_deserializeDocumentOTAUpdatesSummary(&sv.OtaUpdates, value); err != nil { - return err - } - default: _, _ = key, value @@ -27451,14 +28064,14 @@ func awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(v **ListOTAUpdatesOu return nil } -type awsRestjson1_deserializeOpListOutgoingCertificates struct { +type awsRestjson1_deserializeOpListManagedJobTemplates struct { } -func (*awsRestjson1_deserializeOpListOutgoingCertificates) ID() string { +func (*awsRestjson1_deserializeOpListManagedJobTemplates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListOutgoingCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListManagedJobTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -27476,9 +28089,9 @@ func (m *awsRestjson1_deserializeOpListOutgoingCertificates) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListOutgoingCertificates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListManagedJobTemplates(response, &metadata) } - output := &ListOutgoingCertificatesOutput{} + output := &ListManagedJobTemplatesOutput{} out.Result = output var buff [1024]byte @@ -27499,7 +28112,7 @@ func (m *awsRestjson1_deserializeOpListOutgoingCertificates) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListOutgoingCertificatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListManagedJobTemplatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -27513,7 +28126,7 @@ func (m *awsRestjson1_deserializeOpListOutgoingCertificates) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListOutgoingCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListManagedJobTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -27554,21 +28167,18 @@ func awsRestjson1_deserializeOpErrorListOutgoingCertificates(response *smithyhtt } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -27579,7 +28189,7 @@ func awsRestjson1_deserializeOpErrorListOutgoingCertificates(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListOutgoingCertificatesOutput(v **ListOutgoingCertificatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListManagedJobTemplatesOutput(v **ListManagedJobTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -27592,27 +28202,27 @@ func awsRestjson1_deserializeOpDocumentListOutgoingCertificatesOutput(v **ListOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListOutgoingCertificatesOutput + var sv *ListManagedJobTemplatesOutput if *v == nil { - sv = &ListOutgoingCertificatesOutput{} + sv = &ListManagedJobTemplatesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextMarker": + case "managedJobTemplates": + if err := awsRestjson1_deserializeDocumentManagedJobTemplatesSummaryList(&sv.ManagedJobTemplates, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.NextMarker = ptr.String(jtv) - } - - case "outgoingCertificates": - if err := awsRestjson1_deserializeDocumentOutgoingCertificates(&sv.OutgoingCertificates, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } default: @@ -27624,14 +28234,14 @@ func awsRestjson1_deserializeOpDocumentListOutgoingCertificatesOutput(v **ListOu return nil } -type awsRestjson1_deserializeOpListPackages struct { +type awsRestjson1_deserializeOpListMetricValues struct { } -func (*awsRestjson1_deserializeOpListPackages) ID() string { +func (*awsRestjson1_deserializeOpListMetricValues) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMetricValues) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -27649,9 +28259,9 @@ func (m *awsRestjson1_deserializeOpListPackages) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPackages(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListMetricValues(response, &metadata) } - output := &ListPackagesOutput{} + output := &ListMetricValuesOutput{} out.Result = output var buff [1024]byte @@ -27672,7 +28282,7 @@ func (m *awsRestjson1_deserializeOpListPackages) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPackagesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListMetricValuesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -27686,7 +28296,7 @@ func (m *awsRestjson1_deserializeOpListPackages) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMetricValues(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -27727,15 +28337,18 @@ func awsRestjson1_deserializeOpErrorListPackages(response *smithyhttp.Response, } switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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, @@ -27746,7 +28359,7 @@ func awsRestjson1_deserializeOpErrorListPackages(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListPackagesOutput(v **ListPackagesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListMetricValuesOutput(v **ListMetricValuesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -27759,15 +28372,20 @@ func awsRestjson1_deserializeOpDocumentListPackagesOutput(v **ListPackagesOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPackagesOutput + var sv *ListMetricValuesOutput if *v == nil { - sv = &ListPackagesOutput{} + sv = &ListMetricValuesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "metricDatumList": + if err := awsRestjson1_deserializeDocumentMetricDatumList(&sv.MetricDatumList, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -27777,11 +28395,6 @@ func awsRestjson1_deserializeOpDocumentListPackagesOutput(v **ListPackagesOutput sv.NextToken = ptr.String(jtv) } - case "packageSummaries": - if err := awsRestjson1_deserializeDocumentPackageSummaryList(&sv.PackageSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -27791,14 +28404,14 @@ func awsRestjson1_deserializeOpDocumentListPackagesOutput(v **ListPackagesOutput return nil } -type awsRestjson1_deserializeOpListPackageVersions struct { +type awsRestjson1_deserializeOpListMitigationActions struct { } -func (*awsRestjson1_deserializeOpListPackageVersions) ID() string { +func (*awsRestjson1_deserializeOpListMitigationActions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPackageVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMitigationActions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -27816,9 +28429,9 @@ func (m *awsRestjson1_deserializeOpListPackageVersions) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPackageVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListMitigationActions(response, &metadata) } - output := &ListPackageVersionsOutput{} + output := &ListMitigationActionsOutput{} out.Result = output var buff [1024]byte @@ -27839,7 +28452,7 @@ func (m *awsRestjson1_deserializeOpListPackageVersions) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPackageVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListMitigationActionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -27853,7 +28466,7 @@ func (m *awsRestjson1_deserializeOpListPackageVersions) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPackageVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMitigationActions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -27894,15 +28507,15 @@ func awsRestjson1_deserializeOpErrorListPackageVersions(response *smithyhttp.Res } switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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, @@ -27913,7 +28526,7 @@ func awsRestjson1_deserializeOpErrorListPackageVersions(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListPackageVersionsOutput(v **ListPackageVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListMitigationActionsOutput(v **ListMitigationActionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -27926,15 +28539,20 @@ func awsRestjson1_deserializeOpDocumentListPackageVersionsOutput(v **ListPackage return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPackageVersionsOutput + var sv *ListMitigationActionsOutput if *v == nil { - sv = &ListPackageVersionsOutput{} + sv = &ListMitigationActionsOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "actionIdentifiers": + if err := awsRestjson1_deserializeDocumentMitigationActionIdentifierList(&sv.ActionIdentifiers, value); err != nil { + return err + } + case "nextToken": if value != nil { jtv, ok := value.(string) @@ -27944,11 +28562,6 @@ func awsRestjson1_deserializeOpDocumentListPackageVersionsOutput(v **ListPackage sv.NextToken = ptr.String(jtv) } - case "packageVersionSummaries": - if err := awsRestjson1_deserializeDocumentPackageVersionSummaryList(&sv.PackageVersionSummaries, value); err != nil { - return err - } - default: _, _ = key, value @@ -27958,14 +28571,14 @@ func awsRestjson1_deserializeOpDocumentListPackageVersionsOutput(v **ListPackage return nil } -type awsRestjson1_deserializeOpListPolicies struct { +type awsRestjson1_deserializeOpListOTAUpdates struct { } -func (*awsRestjson1_deserializeOpListPolicies) ID() string { +func (*awsRestjson1_deserializeOpListOTAUpdates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListOTAUpdates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -27983,9 +28596,9 @@ func (m *awsRestjson1_deserializeOpListPolicies) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPolicies(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListOTAUpdates(response, &metadata) } - output := &ListPoliciesOutput{} + output := &ListOTAUpdatesOutput{} out.Result = output var buff [1024]byte @@ -28006,7 +28619,7 @@ func (m *awsRestjson1_deserializeOpListPolicies) HandleDeserialize(ctx context.C return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPoliciesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -28020,7 +28633,7 @@ func (m *awsRestjson1_deserializeOpListPolicies) HandleDeserialize(ctx context.C return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListOTAUpdates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -28086,7 +28699,7 @@ func awsRestjson1_deserializeOpErrorListPolicies(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentListPoliciesOutput(v **ListPoliciesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListOTAUpdatesOutput(v **ListOTAUpdatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -28099,26 +28712,26 @@ func awsRestjson1_deserializeOpDocumentListPoliciesOutput(v **ListPoliciesOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPoliciesOutput + var sv *ListOTAUpdatesOutput if *v == nil { - sv = &ListPoliciesOutput{} + sv = &ListOTAUpdatesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextMarker": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.NextMarker = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "policies": - if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil { + case "otaUpdates": + if err := awsRestjson1_deserializeDocumentOTAUpdatesSummary(&sv.OtaUpdates, value); err != nil { return err } @@ -28131,14 +28744,14 @@ func awsRestjson1_deserializeOpDocumentListPoliciesOutput(v **ListPoliciesOutput return nil } -type awsRestjson1_deserializeOpListPolicyPrincipals struct { +type awsRestjson1_deserializeOpListOutgoingCertificates struct { } -func (*awsRestjson1_deserializeOpListPolicyPrincipals) ID() string { +func (*awsRestjson1_deserializeOpListOutgoingCertificates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPolicyPrincipals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListOutgoingCertificates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -28156,9 +28769,9 @@ func (m *awsRestjson1_deserializeOpListPolicyPrincipals) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPolicyPrincipals(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListOutgoingCertificates(response, &metadata) } - output := &ListPolicyPrincipalsOutput{} + output := &ListOutgoingCertificatesOutput{} out.Result = output var buff [1024]byte @@ -28179,7 +28792,7 @@ func (m *awsRestjson1_deserializeOpListPolicyPrincipals) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListOutgoingCertificatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -28193,7 +28806,7 @@ func (m *awsRestjson1_deserializeOpListPolicyPrincipals) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPolicyPrincipals(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListOutgoingCertificates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -28240,9 +28853,6 @@ func awsRestjson1_deserializeOpErrorListPolicyPrincipals(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -28262,7 +28872,7 @@ func awsRestjson1_deserializeOpErrorListPolicyPrincipals(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(v **ListPolicyPrincipalsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListOutgoingCertificatesOutput(v **ListOutgoingCertificatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -28275,9 +28885,9 @@ func awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(v **ListPolicy return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPolicyPrincipalsOutput + var sv *ListOutgoingCertificatesOutput if *v == nil { - sv = &ListPolicyPrincipalsOutput{} + sv = &ListOutgoingCertificatesOutput{} } else { sv = *v } @@ -28293,8 +28903,8 @@ func awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(v **ListPolicy sv.NextMarker = ptr.String(jtv) } - case "principals": - if err := awsRestjson1_deserializeDocumentPrincipals(&sv.Principals, value); err != nil { + case "outgoingCertificates": + if err := awsRestjson1_deserializeDocumentOutgoingCertificates(&sv.OutgoingCertificates, value); err != nil { return err } @@ -28307,14 +28917,14 @@ func awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(v **ListPolicy return nil } -type awsRestjson1_deserializeOpListPolicyVersions struct { +type awsRestjson1_deserializeOpListPackages struct { } -func (*awsRestjson1_deserializeOpListPolicyVersions) ID() string { +func (*awsRestjson1_deserializeOpListPackages) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPolicyVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPackages) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -28332,9 +28942,9 @@ func (m *awsRestjson1_deserializeOpListPolicyVersions) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPolicyVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPackages(response, &metadata) } - output := &ListPolicyVersionsOutput{} + output := &ListPackagesOutput{} out.Result = output var buff [1024]byte @@ -28355,7 +28965,7 @@ func (m *awsRestjson1_deserializeOpListPolicyVersions) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPolicyVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPackagesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -28369,7 +28979,7 @@ func (m *awsRestjson1_deserializeOpListPolicyVersions) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPolicyVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPackages(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -28410,23 +29020,14 @@ func awsRestjson1_deserializeOpErrorListPolicyVersions(response *smithyhttp.Resp } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -28438,7 +29039,7 @@ func awsRestjson1_deserializeOpErrorListPolicyVersions(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentListPolicyVersionsOutput(v **ListPolicyVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPackagesOutput(v **ListPackagesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -28451,17 +29052,26 @@ func awsRestjson1_deserializeOpDocumentListPolicyVersionsOutput(v **ListPolicyVe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPolicyVersionsOutput + var sv *ListPackagesOutput if *v == nil { - sv = &ListPolicyVersionsOutput{} + sv = &ListPackagesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "policyVersions": - if err := awsRestjson1_deserializeDocumentPolicyVersions(&sv.PolicyVersions, value); err != nil { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "packageSummaries": + if err := awsRestjson1_deserializeDocumentPackageSummaryList(&sv.PackageSummaries, value); err != nil { return err } @@ -28474,14 +29084,14 @@ func awsRestjson1_deserializeOpDocumentListPolicyVersionsOutput(v **ListPolicyVe return nil } -type awsRestjson1_deserializeOpListPrincipalPolicies struct { +type awsRestjson1_deserializeOpListPackageVersions struct { } -func (*awsRestjson1_deserializeOpListPrincipalPolicies) ID() string { +func (*awsRestjson1_deserializeOpListPackageVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPrincipalPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPackageVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -28499,9 +29109,9 @@ func (m *awsRestjson1_deserializeOpListPrincipalPolicies) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalPolicies(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPackageVersions(response, &metadata) } - output := &ListPrincipalPoliciesOutput{} + output := &ListPackageVersionsOutput{} out.Result = output var buff [1024]byte @@ -28522,7 +29132,7 @@ func (m *awsRestjson1_deserializeOpListPrincipalPolicies) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPrincipalPoliciesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPackageVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -28536,7 +29146,7 @@ func (m *awsRestjson1_deserializeOpListPrincipalPolicies) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPrincipalPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPackageVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -28577,23 +29187,14 @@ func awsRestjson1_deserializeOpErrorListPrincipalPolicies(response *smithyhttp.R } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -28605,7 +29206,7 @@ func awsRestjson1_deserializeOpErrorListPrincipalPolicies(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListPrincipalPoliciesOutput(v **ListPrincipalPoliciesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPackageVersionsOutput(v **ListPackageVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -28618,26 +29219,26 @@ func awsRestjson1_deserializeOpDocumentListPrincipalPoliciesOutput(v **ListPrinc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPrincipalPoliciesOutput + var sv *ListPackageVersionsOutput if *v == nil { - sv = &ListPrincipalPoliciesOutput{} + sv = &ListPackageVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextMarker": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.NextMarker = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "policies": - if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil { + case "packageVersionSummaries": + if err := awsRestjson1_deserializeDocumentPackageVersionSummaryList(&sv.PackageVersionSummaries, value); err != nil { return err } @@ -28650,14 +29251,14 @@ func awsRestjson1_deserializeOpDocumentListPrincipalPoliciesOutput(v **ListPrinc return nil } -type awsRestjson1_deserializeOpListPrincipalThings struct { +type awsRestjson1_deserializeOpListPolicies struct { } -func (*awsRestjson1_deserializeOpListPrincipalThings) ID() string { +func (*awsRestjson1_deserializeOpListPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPrincipalThings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -28675,9 +29276,9 @@ func (m *awsRestjson1_deserializeOpListPrincipalThings) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalThings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPolicies(response, &metadata) } - output := &ListPrincipalThingsOutput{} + output := &ListPoliciesOutput{} out.Result = output var buff [1024]byte @@ -28698,7 +29299,7 @@ func (m *awsRestjson1_deserializeOpListPrincipalThings) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -28712,7 +29313,7 @@ func (m *awsRestjson1_deserializeOpListPrincipalThings) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPrincipalThings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -28759,9 +29360,6 @@ func awsRestjson1_deserializeOpErrorListPrincipalThings(response *smithyhttp.Res case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -28781,7 +29379,7 @@ func awsRestjson1_deserializeOpErrorListPrincipalThings(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(v **ListPrincipalThingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPoliciesOutput(v **ListPoliciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -28794,26 +29392,26 @@ func awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(v **ListPrincip return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPrincipalThingsOutput + var sv *ListPoliciesOutput if *v == nil { - sv = &ListPrincipalThingsOutput{} + sv = &ListPoliciesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) } - case "things": - if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil { + case "policies": + if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil { return err } @@ -28826,14 +29424,14 @@ func awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(v **ListPrincip return nil } -type awsRestjson1_deserializeOpListPrincipalThingsV2 struct { +type awsRestjson1_deserializeOpListPolicyPrincipals struct { } -func (*awsRestjson1_deserializeOpListPrincipalThingsV2) ID() string { +func (*awsRestjson1_deserializeOpListPolicyPrincipals) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListPrincipalThingsV2) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPolicyPrincipals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -28851,9 +29449,9 @@ func (m *awsRestjson1_deserializeOpListPrincipalThingsV2) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalThingsV2(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPolicyPrincipals(response, &metadata) } - output := &ListPrincipalThingsV2Output{} + output := &ListPolicyPrincipalsOutput{} out.Result = output var buff [1024]byte @@ -28874,7 +29472,7 @@ func (m *awsRestjson1_deserializeOpListPrincipalThingsV2) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListPrincipalThingsV2Output(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -28888,7 +29486,7 @@ func (m *awsRestjson1_deserializeOpListPrincipalThingsV2) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListPrincipalThingsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPolicyPrincipals(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -28957,7 +29555,7 @@ func awsRestjson1_deserializeOpErrorListPrincipalThingsV2(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListPrincipalThingsV2Output(v **ListPrincipalThingsV2Output, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPolicyPrincipalsOutput(v **ListPolicyPrincipalsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -28970,26 +29568,26 @@ func awsRestjson1_deserializeOpDocumentListPrincipalThingsV2Output(v **ListPrinc return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListPrincipalThingsV2Output + var sv *ListPolicyPrincipalsOutput if *v == nil { - sv = &ListPrincipalThingsV2Output{} + sv = &ListPolicyPrincipalsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) } - case "principalThingObjects": - if err := awsRestjson1_deserializeDocumentPrincipalThingObjects(&sv.PrincipalThingObjects, value); err != nil { + case "principals": + if err := awsRestjson1_deserializeDocumentPrincipals(&sv.Principals, value); err != nil { return err } @@ -29002,14 +29600,14 @@ func awsRestjson1_deserializeOpDocumentListPrincipalThingsV2Output(v **ListPrinc return nil } -type awsRestjson1_deserializeOpListProvisioningTemplates struct { +type awsRestjson1_deserializeOpListPolicyVersions struct { } -func (*awsRestjson1_deserializeOpListProvisioningTemplates) ID() string { +func (*awsRestjson1_deserializeOpListPolicyVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListProvisioningTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPolicyVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -29027,9 +29625,9 @@ func (m *awsRestjson1_deserializeOpListProvisioningTemplates) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListProvisioningTemplates(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPolicyVersions(response, &metadata) } - output := &ListProvisioningTemplatesOutput{} + output := &ListPolicyVersionsOutput{} out.Result = output var buff [1024]byte @@ -29050,7 +29648,7 @@ func (m *awsRestjson1_deserializeOpListProvisioningTemplates) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListProvisioningTemplatesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPolicyVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -29064,7 +29662,7 @@ func (m *awsRestjson1_deserializeOpListProvisioningTemplates) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorListProvisioningTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPolicyVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -29111,6 +29709,12 @@ func awsRestjson1_deserializeOpErrorListProvisioningTemplates(response *smithyht case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -29127,7 +29731,7 @@ func awsRestjson1_deserializeOpErrorListProvisioningTemplates(response *smithyht } } -func awsRestjson1_deserializeOpDocumentListProvisioningTemplatesOutput(v **ListProvisioningTemplatesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPolicyVersionsOutput(v **ListPolicyVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -29140,26 +29744,17 @@ func awsRestjson1_deserializeOpDocumentListProvisioningTemplatesOutput(v **ListP return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListProvisioningTemplatesOutput + var sv *ListPolicyVersionsOutput if *v == nil { - sv = &ListProvisioningTemplatesOutput{} + sv = &ListPolicyVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - case "templates": - if err := awsRestjson1_deserializeDocumentProvisioningTemplateListing(&sv.Templates, value); err != nil { + case "policyVersions": + if err := awsRestjson1_deserializeDocumentPolicyVersions(&sv.PolicyVersions, value); err != nil { return err } @@ -29172,14 +29767,14 @@ func awsRestjson1_deserializeOpDocumentListProvisioningTemplatesOutput(v **ListP return nil } -type awsRestjson1_deserializeOpListProvisioningTemplateVersions struct { +type awsRestjson1_deserializeOpListPrincipalPolicies struct { } -func (*awsRestjson1_deserializeOpListProvisioningTemplateVersions) ID() string { +func (*awsRestjson1_deserializeOpListPrincipalPolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListProvisioningTemplateVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPrincipalPolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -29197,9 +29792,9 @@ func (m *awsRestjson1_deserializeOpListProvisioningTemplateVersions) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListProvisioningTemplateVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalPolicies(response, &metadata) } - output := &ListProvisioningTemplateVersionsOutput{} + output := &ListPrincipalPoliciesOutput{} out.Result = output var buff [1024]byte @@ -29220,7 +29815,7 @@ func (m *awsRestjson1_deserializeOpListProvisioningTemplateVersions) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPrincipalPoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -29234,7 +29829,7 @@ func (m *awsRestjson1_deserializeOpListProvisioningTemplateVersions) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorListProvisioningTemplateVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPrincipalPolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -29284,6 +29879,9 @@ func awsRestjson1_deserializeOpErrorListProvisioningTemplateVersions(response *s case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -29300,7 +29898,7 @@ func awsRestjson1_deserializeOpErrorListProvisioningTemplateVersions(response *s } } -func awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(v **ListProvisioningTemplateVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPrincipalPoliciesOutput(v **ListPrincipalPoliciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -29313,26 +29911,26 @@ func awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListProvisioningTemplateVersionsOutput + var sv *ListPrincipalPoliciesOutput if *v == nil { - sv = &ListProvisioningTemplateVersionsOutput{} + sv = &ListPrincipalPoliciesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) } - case "versions": - if err := awsRestjson1_deserializeDocumentProvisioningTemplateVersionListing(&sv.Versions, value); err != nil { + case "policies": + if err := awsRestjson1_deserializeDocumentPolicies(&sv.Policies, value); err != nil { return err } @@ -29345,14 +29943,14 @@ func awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(v return nil } -type awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding struct { +type awsRestjson1_deserializeOpListPrincipalThings struct { } -func (*awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) ID() string { +func (*awsRestjson1_deserializeOpListPrincipalThings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPrincipalThings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -29370,9 +29968,9 @@ func (m *awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) HandleDe } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRelatedResourcesForAuditFinding(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalThings(response, &metadata) } - output := &ListRelatedResourcesForAuditFindingOutput{} + output := &ListPrincipalThingsOutput{} out.Result = output var buff [1024]byte @@ -29393,7 +29991,7 @@ func (m *awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) HandleDe return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -29407,7 +30005,7 @@ func (m *awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) HandleDe return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRelatedResourcesForAuditFinding(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPrincipalThings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -29457,9 +30055,15 @@ func awsRestjson1_deserializeOpErrorListRelatedResourcesForAuditFinding(response case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -29470,7 +30074,7 @@ func awsRestjson1_deserializeOpErrorListRelatedResourcesForAuditFinding(response } } -func awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput(v **ListRelatedResourcesForAuditFindingOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPrincipalThingsOutput(v **ListPrincipalThingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -29483,9 +30087,9 @@ func awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListRelatedResourcesForAuditFindingOutput + var sv *ListPrincipalThingsOutput if *v == nil { - sv = &ListRelatedResourcesForAuditFindingOutput{} + sv = &ListPrincipalThingsOutput{} } else { sv = *v } @@ -29501,8 +30105,8 @@ func awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput sv.NextToken = ptr.String(jtv) } - case "relatedResources": - if err := awsRestjson1_deserializeDocumentRelatedResources(&sv.RelatedResources, value); err != nil { + case "things": + if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil { return err } @@ -29515,14 +30119,14 @@ func awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput return nil } -type awsRestjson1_deserializeOpListRoleAliases struct { +type awsRestjson1_deserializeOpListPrincipalThingsV2 struct { } -func (*awsRestjson1_deserializeOpListRoleAliases) ID() string { +func (*awsRestjson1_deserializeOpListPrincipalThingsV2) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListRoleAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListPrincipalThingsV2) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -29540,9 +30144,9 @@ func (m *awsRestjson1_deserializeOpListRoleAliases) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListRoleAliases(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListPrincipalThingsV2(response, &metadata) } - output := &ListRoleAliasesOutput{} + output := &ListPrincipalThingsV2Output{} out.Result = output var buff [1024]byte @@ -29563,7 +30167,7 @@ func (m *awsRestjson1_deserializeOpListRoleAliases) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListRoleAliasesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListPrincipalThingsV2Output(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -29577,7 +30181,7 @@ func (m *awsRestjson1_deserializeOpListRoleAliases) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListRoleAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListPrincipalThingsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -29624,6 +30228,9 @@ func awsRestjson1_deserializeOpErrorListRoleAliases(response *smithyhttp.Respons case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -29643,177 +30250,7 @@ func awsRestjson1_deserializeOpErrorListRoleAliases(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListRoleAliasesOutput(v **ListRoleAliasesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListRoleAliasesOutput - if *v == nil { - sv = &ListRoleAliasesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "nextMarker": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) - } - sv.NextMarker = ptr.String(jtv) - } - - case "roleAliases": - if err := awsRestjson1_deserializeDocumentRoleAliases(&sv.RoleAliases, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpListSbomValidationResults struct { -} - -func (*awsRestjson1_deserializeOpListSbomValidationResults) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpListSbomValidationResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorListSbomValidationResults(response, &metadata) - } - output := &ListSbomValidationResultsOutput{} - 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_deserializeOpDocumentListSbomValidationResultsOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorListSbomValidationResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - - case strings.EqualFold("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_deserializeOpDocumentListSbomValidationResultsOutput(v **ListSbomValidationResultsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListPrincipalThingsV2Output(v **ListPrincipalThingsV2Output, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -29826,9 +30263,9 @@ func awsRestjson1_deserializeOpDocumentListSbomValidationResultsOutput(v **ListS return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSbomValidationResultsOutput + var sv *ListPrincipalThingsV2Output if *v == nil { - sv = &ListSbomValidationResultsOutput{} + sv = &ListPrincipalThingsV2Output{} } else { sv = *v } @@ -29844,8 +30281,8 @@ func awsRestjson1_deserializeOpDocumentListSbomValidationResultsOutput(v **ListS sv.NextToken = ptr.String(jtv) } - case "validationResultSummaries": - if err := awsRestjson1_deserializeDocumentSbomValidationResultSummaryList(&sv.ValidationResultSummaries, value); err != nil { + case "principalThingObjects": + if err := awsRestjson1_deserializeDocumentPrincipalThingObjects(&sv.PrincipalThingObjects, value); err != nil { return err } @@ -29858,14 +30295,14 @@ func awsRestjson1_deserializeOpDocumentListSbomValidationResultsOutput(v **ListS return nil } -type awsRestjson1_deserializeOpListScheduledAudits struct { +type awsRestjson1_deserializeOpListProvisioningTemplates struct { } -func (*awsRestjson1_deserializeOpListScheduledAudits) ID() string { +func (*awsRestjson1_deserializeOpListProvisioningTemplates) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListScheduledAudits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListProvisioningTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -29883,9 +30320,9 @@ func (m *awsRestjson1_deserializeOpListScheduledAudits) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListScheduledAudits(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListProvisioningTemplates(response, &metadata) } - output := &ListScheduledAuditsOutput{} + output := &ListProvisioningTemplatesOutput{} out.Result = output var buff [1024]byte @@ -29906,7 +30343,7 @@ func (m *awsRestjson1_deserializeOpListScheduledAudits) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListProvisioningTemplatesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -29920,7 +30357,7 @@ func (m *awsRestjson1_deserializeOpListScheduledAudits) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListScheduledAudits(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListProvisioningTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -29970,6 +30407,9 @@ func awsRestjson1_deserializeOpErrorListScheduledAudits(response *smithyhttp.Res case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -29980,7 +30420,7 @@ func awsRestjson1_deserializeOpErrorListScheduledAudits(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(v **ListScheduledAuditsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListProvisioningTemplatesOutput(v **ListProvisioningTemplatesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -29993,9 +30433,9 @@ func awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(v **ListSchedul return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListScheduledAuditsOutput + var sv *ListProvisioningTemplatesOutput if *v == nil { - sv = &ListScheduledAuditsOutput{} + sv = &ListProvisioningTemplatesOutput{} } else { sv = *v } @@ -30011,8 +30451,8 @@ func awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(v **ListSchedul sv.NextToken = ptr.String(jtv) } - case "scheduledAudits": - if err := awsRestjson1_deserializeDocumentScheduledAuditMetadataList(&sv.ScheduledAudits, value); err != nil { + case "templates": + if err := awsRestjson1_deserializeDocumentProvisioningTemplateListing(&sv.Templates, value); err != nil { return err } @@ -30025,14 +30465,14 @@ func awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(v **ListSchedul return nil } -type awsRestjson1_deserializeOpListSecurityProfiles struct { +type awsRestjson1_deserializeOpListProvisioningTemplateVersions struct { } -func (*awsRestjson1_deserializeOpListSecurityProfiles) ID() string { +func (*awsRestjson1_deserializeOpListProvisioningTemplateVersions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListProvisioningTemplateVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -30050,9 +30490,9 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfiles(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListProvisioningTemplateVersions(response, &metadata) } - output := &ListSecurityProfilesOutput{} + output := &ListProvisioningTemplateVersionsOutput{} out.Result = output var buff [1024]byte @@ -30073,7 +30513,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30087,7 +30527,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListProvisioningTemplateVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -30140,6 +30580,9 @@ func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Re case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -30150,7 +30593,7 @@ func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecurityProfilesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListProvisioningTemplateVersionsOutput(v **ListProvisioningTemplateVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -30163,9 +30606,9 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityProfilesOutput + var sv *ListProvisioningTemplateVersionsOutput if *v == nil { - sv = &ListSecurityProfilesOutput{} + sv = &ListProvisioningTemplateVersionsOutput{} } else { sv = *v } @@ -30181,8 +30624,8 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri sv.NextToken = ptr.String(jtv) } - case "securityProfileIdentifiers": - if err := awsRestjson1_deserializeDocumentSecurityProfileIdentifiers(&sv.SecurityProfileIdentifiers, value); err != nil { + case "versions": + if err := awsRestjson1_deserializeDocumentProvisioningTemplateVersionListing(&sv.Versions, value); err != nil { return err } @@ -30195,14 +30638,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecuri return nil } -type awsRestjson1_deserializeOpListSecurityProfilesForTarget struct { +type awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding struct { } -func (*awsRestjson1_deserializeOpListSecurityProfilesForTarget) ID() string { +func (*awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListSecurityProfilesForTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRelatedResourcesForAuditFinding) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -30220,9 +30663,9 @@ func (m *awsRestjson1_deserializeOpListSecurityProfilesForTarget) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfilesForTarget(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRelatedResourcesForAuditFinding(response, &metadata) } - output := &ListSecurityProfilesForTargetOutput{} + output := &ListRelatedResourcesForAuditFindingOutput{} out.Result = output var buff [1024]byte @@ -30243,7 +30686,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfilesForTarget) HandleDeserial return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30257,7 +30700,7 @@ func (m *awsRestjson1_deserializeOpListSecurityProfilesForTarget) HandleDeserial return out, metadata, err } -func awsRestjson1_deserializeOpErrorListSecurityProfilesForTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRelatedResourcesForAuditFinding(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -30320,7 +30763,7 @@ func awsRestjson1_deserializeOpErrorListSecurityProfilesForTarget(response *smit } } -func awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(v **ListSecurityProfilesForTargetOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRelatedResourcesForAuditFindingOutput(v **ListRelatedResourcesForAuditFindingOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -30333,9 +30776,9 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(v **L return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListSecurityProfilesForTargetOutput + var sv *ListRelatedResourcesForAuditFindingOutput if *v == nil { - sv = &ListSecurityProfilesForTargetOutput{} + sv = &ListRelatedResourcesForAuditFindingOutput{} } else { sv = *v } @@ -30351,8 +30794,8 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(v **L sv.NextToken = ptr.String(jtv) } - case "securityProfileTargetMappings": - if err := awsRestjson1_deserializeDocumentSecurityProfileTargetMappings(&sv.SecurityProfileTargetMappings, value); err != nil { + case "relatedResources": + if err := awsRestjson1_deserializeDocumentRelatedResources(&sv.RelatedResources, value); err != nil { return err } @@ -30365,14 +30808,14 @@ func awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(v **L return nil } -type awsRestjson1_deserializeOpListStreams struct { +type awsRestjson1_deserializeOpListRoleAliases struct { } -func (*awsRestjson1_deserializeOpListStreams) ID() string { +func (*awsRestjson1_deserializeOpListRoleAliases) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRoleAliases) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -30390,9 +30833,9 @@ func (m *awsRestjson1_deserializeOpListStreams) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListStreams(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRoleAliases(response, &metadata) } - output := &ListStreamsOutput{} + output := &ListRoleAliasesOutput{} out.Result = output var buff [1024]byte @@ -30413,7 +30856,7 @@ func (m *awsRestjson1_deserializeOpListStreams) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListStreamsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRoleAliasesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30427,7 +30870,7 @@ func (m *awsRestjson1_deserializeOpListStreams) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRoleAliases(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -30493,7 +30936,7 @@ func awsRestjson1_deserializeOpErrorListStreams(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentListStreamsOutput(v **ListStreamsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRoleAliasesOutput(v **ListRoleAliasesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -30506,26 +30949,26 @@ func awsRestjson1_deserializeOpDocumentListStreamsOutput(v **ListStreamsOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListStreamsOutput + var sv *ListRoleAliasesOutput if *v == nil { - sv = &ListStreamsOutput{} + sv = &ListRoleAliasesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) } - case "streams": - if err := awsRestjson1_deserializeDocumentStreamsSummary(&sv.Streams, value); err != nil { + case "roleAliases": + if err := awsRestjson1_deserializeDocumentRoleAliases(&sv.RoleAliases, value); err != nil { return err } @@ -30538,14 +30981,14 @@ func awsRestjson1_deserializeOpDocumentListStreamsOutput(v **ListStreamsOutput, return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListSbomValidationResults struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListSbomValidationResults) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSbomValidationResults) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -30563,9 +31006,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSbomValidationResults(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListSbomValidationResultsOutput{} out.Result = output var buff [1024]byte @@ -30586,7 +31029,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSbomValidationResultsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30600,7 +31043,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSbomValidationResults(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -30641,11 +31084,8 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -30653,6 +31093,9 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res 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, @@ -30663,7 +31106,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSbomValidationResultsOutput(v **ListSbomValidationResultsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -30676,9 +31119,9 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListSbomValidationResultsOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListSbomValidationResultsOutput{} } else { sv = *v } @@ -30694,8 +31137,8 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor sv.NextToken = ptr.String(jtv) } - case "tags": - if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + case "validationResultSummaries": + if err := awsRestjson1_deserializeDocumentSbomValidationResultSummaryList(&sv.ValidationResultSummaries, value); err != nil { return err } @@ -30708,14 +31151,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpListTargetsForPolicy struct { +type awsRestjson1_deserializeOpListScheduledAudits struct { } -func (*awsRestjson1_deserializeOpListTargetsForPolicy) ID() string { +func (*awsRestjson1_deserializeOpListScheduledAudits) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTargetsForPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListScheduledAudits) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -30733,9 +31176,9 @@ func (m *awsRestjson1_deserializeOpListTargetsForPolicy) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTargetsForPolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListScheduledAudits(response, &metadata) } - output := &ListTargetsForPolicyOutput{} + output := &ListScheduledAuditsOutput{} out.Result = output var buff [1024]byte @@ -30756,7 +31199,7 @@ func (m *awsRestjson1_deserializeOpListTargetsForPolicy) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTargetsForPolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30770,7 +31213,7 @@ func (m *awsRestjson1_deserializeOpListTargetsForPolicy) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTargetsForPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListScheduledAudits(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -30817,21 +31260,9 @@ func awsRestjson1_deserializeOpErrorListTargetsForPolicy(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -30842,7 +31273,7 @@ func awsRestjson1_deserializeOpErrorListTargetsForPolicy(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListTargetsForPolicyOutput(v **ListTargetsForPolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListScheduledAuditsOutput(v **ListScheduledAuditsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -30855,26 +31286,26 @@ func awsRestjson1_deserializeOpDocumentListTargetsForPolicyOutput(v **ListTarget return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTargetsForPolicyOutput + var sv *ListScheduledAuditsOutput if *v == nil { - sv = &ListTargetsForPolicyOutput{} + sv = &ListScheduledAuditsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextMarker": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Marker to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.NextMarker = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "targets": - if err := awsRestjson1_deserializeDocumentPolicyTargets(&sv.Targets, value); err != nil { + case "scheduledAudits": + if err := awsRestjson1_deserializeDocumentScheduledAuditMetadataList(&sv.ScheduledAudits, value); err != nil { return err } @@ -30887,14 +31318,14 @@ func awsRestjson1_deserializeOpDocumentListTargetsForPolicyOutput(v **ListTarget return nil } -type awsRestjson1_deserializeOpListTargetsForSecurityProfile struct { +type awsRestjson1_deserializeOpListSecurityProfiles struct { } -func (*awsRestjson1_deserializeOpListTargetsForSecurityProfile) ID() string { +func (*awsRestjson1_deserializeOpListSecurityProfiles) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTargetsForSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityProfiles) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -30912,9 +31343,9 @@ func (m *awsRestjson1_deserializeOpListTargetsForSecurityProfile) HandleDeserial } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTargetsForSecurityProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfiles(response, &metadata) } - output := &ListTargetsForSecurityProfileOutput{} + output := &ListSecurityProfilesOutput{} out.Result = output var buff [1024]byte @@ -30935,7 +31366,7 @@ func (m *awsRestjson1_deserializeOpListTargetsForSecurityProfile) HandleDeserial return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -30949,7 +31380,7 @@ func (m *awsRestjson1_deserializeOpListTargetsForSecurityProfile) HandleDeserial return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTargetsForSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityProfiles(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -31012,7 +31443,7 @@ func awsRestjson1_deserializeOpErrorListTargetsForSecurityProfile(response *smit } } -func awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(v **ListTargetsForSecurityProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSecurityProfilesOutput(v **ListSecurityProfilesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -31025,9 +31456,9 @@ func awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(v **L return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTargetsForSecurityProfileOutput + var sv *ListSecurityProfilesOutput if *v == nil { - sv = &ListTargetsForSecurityProfileOutput{} + sv = &ListSecurityProfilesOutput{} } else { sv = *v } @@ -31043,8 +31474,8 @@ func awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(v **L sv.NextToken = ptr.String(jtv) } - case "securityProfileTargets": - if err := awsRestjson1_deserializeDocumentSecurityProfileTargets(&sv.SecurityProfileTargets, value); err != nil { + case "securityProfileIdentifiers": + if err := awsRestjson1_deserializeDocumentSecurityProfileIdentifiers(&sv.SecurityProfileIdentifiers, value); err != nil { return err } @@ -31057,14 +31488,14 @@ func awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(v **L return nil } -type awsRestjson1_deserializeOpListThingGroups struct { +type awsRestjson1_deserializeOpListSecurityProfilesForTarget struct { } -func (*awsRestjson1_deserializeOpListThingGroups) ID() string { +func (*awsRestjson1_deserializeOpListSecurityProfilesForTarget) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListSecurityProfilesForTarget) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -31082,9 +31513,9 @@ func (m *awsRestjson1_deserializeOpListThingGroups) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingGroups(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListSecurityProfilesForTarget(response, &metadata) } - output := &ListThingGroupsOutput{} + output := &ListSecurityProfilesForTargetOutput{} out.Result = output var buff [1024]byte @@ -31105,7 +31536,7 @@ func (m *awsRestjson1_deserializeOpListThingGroups) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingGroupsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -31119,7 +31550,7 @@ func (m *awsRestjson1_deserializeOpListThingGroups) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListSecurityProfilesForTarget(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -31182,7 +31613,7 @@ func awsRestjson1_deserializeOpErrorListThingGroups(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListThingGroupsOutput(v **ListThingGroupsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListSecurityProfilesForTargetOutput(v **ListSecurityProfilesForTargetOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -31195,9 +31626,9 @@ func awsRestjson1_deserializeOpDocumentListThingGroupsOutput(v **ListThingGroups return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingGroupsOutput + var sv *ListSecurityProfilesForTargetOutput if *v == nil { - sv = &ListThingGroupsOutput{} + sv = &ListSecurityProfilesForTargetOutput{} } else { sv = *v } @@ -31213,8 +31644,8 @@ func awsRestjson1_deserializeOpDocumentListThingGroupsOutput(v **ListThingGroups sv.NextToken = ptr.String(jtv) } - case "thingGroups": - if err := awsRestjson1_deserializeDocumentThingGroupNameAndArnList(&sv.ThingGroups, value); err != nil { + case "securityProfileTargetMappings": + if err := awsRestjson1_deserializeDocumentSecurityProfileTargetMappings(&sv.SecurityProfileTargetMappings, value); err != nil { return err } @@ -31227,14 +31658,14 @@ func awsRestjson1_deserializeOpDocumentListThingGroupsOutput(v **ListThingGroups return nil } -type awsRestjson1_deserializeOpListThingGroupsForThing struct { +type awsRestjson1_deserializeOpListStreams struct { } -func (*awsRestjson1_deserializeOpListThingGroupsForThing) ID() string { +func (*awsRestjson1_deserializeOpListStreams) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingGroupsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListStreams) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -31252,9 +31683,9 @@ func (m *awsRestjson1_deserializeOpListThingGroupsForThing) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingGroupsForThing(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListStreams(response, &metadata) } - output := &ListThingGroupsForThingOutput{} + output := &ListStreamsOutput{} out.Result = output var buff [1024]byte @@ -31275,7 +31706,7 @@ func (m *awsRestjson1_deserializeOpListThingGroupsForThing) HandleDeserialize(ct return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListStreamsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -31289,7 +31720,7 @@ func (m *awsRestjson1_deserializeOpListThingGroupsForThing) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingGroupsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListStreams(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -31336,12 +31767,15 @@ func awsRestjson1_deserializeOpErrorListThingGroupsForThing(response *smithyhttp case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -31352,7 +31786,7 @@ func awsRestjson1_deserializeOpErrorListThingGroupsForThing(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(v **ListThingGroupsForThingOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListStreamsOutput(v **ListStreamsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -31365,9 +31799,9 @@ func awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(v **ListThi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingGroupsForThingOutput + var sv *ListStreamsOutput if *v == nil { - sv = &ListThingGroupsForThingOutput{} + sv = &ListStreamsOutput{} } else { sv = *v } @@ -31383,8 +31817,8 @@ func awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(v **ListThi sv.NextToken = ptr.String(jtv) } - case "thingGroups": - if err := awsRestjson1_deserializeDocumentThingGroupNameAndArnList(&sv.ThingGroups, value); err != nil { + case "streams": + if err := awsRestjson1_deserializeDocumentStreamsSummary(&sv.Streams, value); err != nil { return err } @@ -31397,14 +31831,14 @@ func awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(v **ListThi return nil } -type awsRestjson1_deserializeOpListThingPrincipals struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpListThingPrincipals) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingPrincipals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -31422,9 +31856,9 @@ func (m *awsRestjson1_deserializeOpListThingPrincipals) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingPrincipals(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &ListThingPrincipalsOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -31445,7 +31879,7 @@ func (m *awsRestjson1_deserializeOpListThingPrincipals) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -31459,7 +31893,7 @@ func (m *awsRestjson1_deserializeOpListThingPrincipals) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingPrincipals(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -31509,15 +31943,9 @@ func awsRestjson1_deserializeOpErrorListThingPrincipals(response *smithyhttp.Res case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -31528,7 +31956,7 @@ func awsRestjson1_deserializeOpErrorListThingPrincipals(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(v **ListThingPrincipalsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -31541,9 +31969,9 @@ func awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(v **ListThingPr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingPrincipalsOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &ListThingPrincipalsOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } @@ -31559,8 +31987,8 @@ func awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(v **ListThingPr sv.NextToken = ptr.String(jtv) } - case "principals": - if err := awsRestjson1_deserializeDocumentPrincipals(&sv.Principals, value); err != nil { + case "tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } @@ -31573,14 +32001,14 @@ func awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(v **ListThingPr return nil } -type awsRestjson1_deserializeOpListThingPrincipalsV2 struct { +type awsRestjson1_deserializeOpListTargetsForPolicy struct { } -func (*awsRestjson1_deserializeOpListThingPrincipalsV2) ID() string { +func (*awsRestjson1_deserializeOpListTargetsForPolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingPrincipalsV2) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTargetsForPolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -31598,9 +32026,9 @@ func (m *awsRestjson1_deserializeOpListThingPrincipalsV2) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingPrincipalsV2(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTargetsForPolicy(response, &metadata) } - output := &ListThingPrincipalsV2Output{} + output := &ListTargetsForPolicyOutput{} out.Result = output var buff [1024]byte @@ -31621,7 +32049,7 @@ func (m *awsRestjson1_deserializeOpListThingPrincipalsV2) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingPrincipalsV2Output(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTargetsForPolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -31635,7 +32063,7 @@ func (m *awsRestjson1_deserializeOpListThingPrincipalsV2) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingPrincipalsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTargetsForPolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -31682,6 +32110,9 @@ func awsRestjson1_deserializeOpErrorListThingPrincipalsV2(response *smithyhttp.R case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -31704,7 +32135,7 @@ func awsRestjson1_deserializeOpErrorListThingPrincipalsV2(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentListThingPrincipalsV2Output(v **ListThingPrincipalsV2Output, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTargetsForPolicyOutput(v **ListTargetsForPolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -31717,26 +32148,26 @@ func awsRestjson1_deserializeOpDocumentListThingPrincipalsV2Output(v **ListThing return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingPrincipalsV2Output + var sv *ListTargetsForPolicyOutput if *v == nil { - sv = &ListThingPrincipalsV2Output{} + sv = &ListTargetsForPolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "nextMarker": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected Marker to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.NextMarker = ptr.String(jtv) } - case "thingPrincipalObjects": - if err := awsRestjson1_deserializeDocumentThingPrincipalObjects(&sv.ThingPrincipalObjects, value); err != nil { + case "targets": + if err := awsRestjson1_deserializeDocumentPolicyTargets(&sv.Targets, value); err != nil { return err } @@ -31749,14 +32180,14 @@ func awsRestjson1_deserializeOpDocumentListThingPrincipalsV2Output(v **ListThing return nil } -type awsRestjson1_deserializeOpListThingRegistrationTaskReports struct { +type awsRestjson1_deserializeOpListTargetsForSecurityProfile struct { } -func (*awsRestjson1_deserializeOpListThingRegistrationTaskReports) ID() string { +func (*awsRestjson1_deserializeOpListTargetsForSecurityProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingRegistrationTaskReports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTargetsForSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -31774,9 +32205,9 @@ func (m *awsRestjson1_deserializeOpListThingRegistrationTaskReports) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingRegistrationTaskReports(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTargetsForSecurityProfile(response, &metadata) } - output := &ListThingRegistrationTaskReportsOutput{} + output := &ListTargetsForSecurityProfileOutput{} out.Result = output var buff [1024]byte @@ -31797,7 +32228,7 @@ func (m *awsRestjson1_deserializeOpListThingRegistrationTaskReports) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -31811,7 +32242,7 @@ func (m *awsRestjson1_deserializeOpListThingRegistrationTaskReports) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingRegistrationTaskReports(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTargetsForSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -31858,12 +32289,12 @@ func awsRestjson1_deserializeOpErrorListThingRegistrationTaskReports(response *s case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -31874,7 +32305,7 @@ func awsRestjson1_deserializeOpErrorListThingRegistrationTaskReports(response *s } } -func awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(v **ListThingRegistrationTaskReportsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTargetsForSecurityProfileOutput(v **ListTargetsForSecurityProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -31887,9 +32318,9 @@ func awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingRegistrationTaskReportsOutput + var sv *ListTargetsForSecurityProfileOutput if *v == nil { - sv = &ListThingRegistrationTaskReportsOutput{} + sv = &ListTargetsForSecurityProfileOutput{} } else { sv = *v } @@ -31905,17 +32336,8 @@ func awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(v sv.NextToken = ptr.String(jtv) } - case "reportType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReportType to be of type string, got %T instead", value) - } - sv.ReportType = types.ReportType(jtv) - } - - case "resourceLinks": - if err := awsRestjson1_deserializeDocumentS3FileUrlList(&sv.ResourceLinks, value); err != nil { + case "securityProfileTargets": + if err := awsRestjson1_deserializeDocumentSecurityProfileTargets(&sv.SecurityProfileTargets, value); err != nil { return err } @@ -31928,14 +32350,14 @@ func awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(v return nil } -type awsRestjson1_deserializeOpListThingRegistrationTasks struct { +type awsRestjson1_deserializeOpListThingGroups struct { } -func (*awsRestjson1_deserializeOpListThingRegistrationTasks) ID() string { +func (*awsRestjson1_deserializeOpListThingGroups) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingRegistrationTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingGroups) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -31953,9 +32375,9 @@ func (m *awsRestjson1_deserializeOpListThingRegistrationTasks) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingRegistrationTasks(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingGroups(response, &metadata) } - output := &ListThingRegistrationTasksOutput{} + output := &ListThingGroupsOutput{} out.Result = output var buff [1024]byte @@ -31976,7 +32398,7 @@ func (m *awsRestjson1_deserializeOpListThingRegistrationTasks) HandleDeserialize return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingGroupsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -31990,7 +32412,7 @@ func (m *awsRestjson1_deserializeOpListThingRegistrationTasks) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingRegistrationTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingGroups(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -32037,12 +32459,12 @@ func awsRestjson1_deserializeOpErrorListThingRegistrationTasks(response *smithyh case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -32053,7 +32475,7 @@ func awsRestjson1_deserializeOpErrorListThingRegistrationTasks(response *smithyh } } -func awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(v **ListThingRegistrationTasksOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingGroupsOutput(v **ListThingGroupsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -32066,9 +32488,9 @@ func awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(v **List return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingRegistrationTasksOutput + var sv *ListThingGroupsOutput if *v == nil { - sv = &ListThingRegistrationTasksOutput{} + sv = &ListThingGroupsOutput{} } else { sv = *v } @@ -32084,8 +32506,8 @@ func awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(v **List sv.NextToken = ptr.String(jtv) } - case "taskIds": - if err := awsRestjson1_deserializeDocumentTaskIdList(&sv.TaskIds, value); err != nil { + case "thingGroups": + if err := awsRestjson1_deserializeDocumentThingGroupNameAndArnList(&sv.ThingGroups, value); err != nil { return err } @@ -32098,14 +32520,14 @@ func awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(v **List return nil } -type awsRestjson1_deserializeOpListThings struct { +type awsRestjson1_deserializeOpListThingGroupsForThing struct { } -func (*awsRestjson1_deserializeOpListThings) ID() string { +func (*awsRestjson1_deserializeOpListThingGroupsForThing) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingGroupsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -32123,9 +32545,9 @@ func (m *awsRestjson1_deserializeOpListThings) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingGroupsForThing(response, &metadata) } - output := &ListThingsOutput{} + output := &ListThingGroupsForThingOutput{} out.Result = output var buff [1024]byte @@ -32146,7 +32568,7 @@ func (m *awsRestjson1_deserializeOpListThings) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -32160,7 +32582,7 @@ func (m *awsRestjson1_deserializeOpListThings) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingGroupsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -32207,15 +32629,12 @@ func awsRestjson1_deserializeOpErrorListThings(response *smithyhttp.Response, me case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -32226,7 +32645,7 @@ func awsRestjson1_deserializeOpErrorListThings(response *smithyhttp.Response, me } } -func awsRestjson1_deserializeOpDocumentListThingsOutput(v **ListThingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingGroupsForThingOutput(v **ListThingGroupsForThingOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -32239,9 +32658,9 @@ func awsRestjson1_deserializeOpDocumentListThingsOutput(v **ListThingsOutput, va return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingsOutput + var sv *ListThingGroupsForThingOutput if *v == nil { - sv = &ListThingsOutput{} + sv = &ListThingGroupsForThingOutput{} } else { sv = *v } @@ -32257,8 +32676,8 @@ func awsRestjson1_deserializeOpDocumentListThingsOutput(v **ListThingsOutput, va sv.NextToken = ptr.String(jtv) } - case "things": - if err := awsRestjson1_deserializeDocumentThingAttributeList(&sv.Things, value); err != nil { + case "thingGroups": + if err := awsRestjson1_deserializeDocumentThingGroupNameAndArnList(&sv.ThingGroups, value); err != nil { return err } @@ -32271,14 +32690,14 @@ func awsRestjson1_deserializeOpDocumentListThingsOutput(v **ListThingsOutput, va return nil } -type awsRestjson1_deserializeOpListThingsInBillingGroup struct { +type awsRestjson1_deserializeOpListThingPrincipals struct { } -func (*awsRestjson1_deserializeOpListThingsInBillingGroup) ID() string { +func (*awsRestjson1_deserializeOpListThingPrincipals) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingsInBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingPrincipals) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -32296,9 +32715,9 @@ func (m *awsRestjson1_deserializeOpListThingsInBillingGroup) HandleDeserialize(c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingsInBillingGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingPrincipals(response, &metadata) } - output := &ListThingsInBillingGroupOutput{} + output := &ListThingPrincipalsOutput{} out.Result = output var buff [1024]byte @@ -32319,7 +32738,7 @@ func (m *awsRestjson1_deserializeOpListThingsInBillingGroup) HandleDeserialize(c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -32333,7 +32752,7 @@ func (m *awsRestjson1_deserializeOpListThingsInBillingGroup) HandleDeserialize(c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingsInBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingPrincipals(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -32383,9 +32802,15 @@ func awsRestjson1_deserializeOpErrorListThingsInBillingGroup(response *smithyhtt case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -32396,7 +32821,7 @@ func awsRestjson1_deserializeOpErrorListThingsInBillingGroup(response *smithyhtt } } -func awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(v **ListThingsInBillingGroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingPrincipalsOutput(v **ListThingPrincipalsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -32409,9 +32834,9 @@ func awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(v **ListTh return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingsInBillingGroupOutput + var sv *ListThingPrincipalsOutput if *v == nil { - sv = &ListThingsInBillingGroupOutput{} + sv = &ListThingPrincipalsOutput{} } else { sv = *v } @@ -32427,8 +32852,8 @@ func awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(v **ListTh sv.NextToken = ptr.String(jtv) } - case "things": - if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil { + case "principals": + if err := awsRestjson1_deserializeDocumentPrincipals(&sv.Principals, value); err != nil { return err } @@ -32441,14 +32866,14 @@ func awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(v **ListTh return nil } -type awsRestjson1_deserializeOpListThingsInThingGroup struct { +type awsRestjson1_deserializeOpListThingPrincipalsV2 struct { } -func (*awsRestjson1_deserializeOpListThingsInThingGroup) ID() string { +func (*awsRestjson1_deserializeOpListThingPrincipalsV2) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingsInThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingPrincipalsV2) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -32466,9 +32891,9 @@ func (m *awsRestjson1_deserializeOpListThingsInThingGroup) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingsInThingGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingPrincipalsV2(response, &metadata) } - output := &ListThingsInThingGroupOutput{} + output := &ListThingPrincipalsV2Output{} out.Result = output var buff [1024]byte @@ -32489,7 +32914,7 @@ func (m *awsRestjson1_deserializeOpListThingsInThingGroup) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingPrincipalsV2Output(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -32503,7 +32928,7 @@ func (m *awsRestjson1_deserializeOpListThingsInThingGroup) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingsInThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingPrincipalsV2(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -32553,9 +32978,15 @@ func awsRestjson1_deserializeOpErrorListThingsInThingGroup(response *smithyhttp. case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -32566,7 +32997,7 @@ func awsRestjson1_deserializeOpErrorListThingsInThingGroup(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(v **ListThingsInThingGroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingPrincipalsV2Output(v **ListThingPrincipalsV2Output, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -32579,9 +33010,9 @@ func awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(v **ListThin return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingsInThingGroupOutput + var sv *ListThingPrincipalsV2Output if *v == nil { - sv = &ListThingsInThingGroupOutput{} + sv = &ListThingPrincipalsV2Output{} } else { sv = *v } @@ -32597,8 +33028,8 @@ func awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(v **ListThin sv.NextToken = ptr.String(jtv) } - case "things": - if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil { + case "thingPrincipalObjects": + if err := awsRestjson1_deserializeDocumentThingPrincipalObjects(&sv.ThingPrincipalObjects, value); err != nil { return err } @@ -32611,14 +33042,14 @@ func awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(v **ListThin return nil } -type awsRestjson1_deserializeOpListThingTypes struct { +type awsRestjson1_deserializeOpListThingRegistrationTaskReports struct { } -func (*awsRestjson1_deserializeOpListThingTypes) ID() string { +func (*awsRestjson1_deserializeOpListThingRegistrationTaskReports) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListThingTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingRegistrationTaskReports) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -32636,9 +33067,9 @@ func (m *awsRestjson1_deserializeOpListThingTypes) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListThingTypes(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingRegistrationTaskReports(response, &metadata) } - output := &ListThingTypesOutput{} + output := &ListThingRegistrationTaskReportsOutput{} out.Result = output var buff [1024]byte @@ -32659,7 +33090,7 @@ func (m *awsRestjson1_deserializeOpListThingTypes) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListThingTypesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -32673,7 +33104,7 @@ func (m *awsRestjson1_deserializeOpListThingTypes) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListThingTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingRegistrationTaskReports(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -32720,9 +33151,6 @@ func awsRestjson1_deserializeOpErrorListThingTypes(response *smithyhttp.Response case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -32739,7 +33167,7 @@ func awsRestjson1_deserializeOpErrorListThingTypes(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListThingTypesOutput(v **ListThingTypesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingRegistrationTaskReportsOutput(v **ListThingRegistrationTaskReportsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -32752,9 +33180,9 @@ func awsRestjson1_deserializeOpDocumentListThingTypesOutput(v **ListThingTypesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListThingTypesOutput + var sv *ListThingRegistrationTaskReportsOutput if *v == nil { - sv = &ListThingTypesOutput{} + sv = &ListThingRegistrationTaskReportsOutput{} } else { sv = *v } @@ -32770,8 +33198,17 @@ func awsRestjson1_deserializeOpDocumentListThingTypesOutput(v **ListThingTypesOu sv.NextToken = ptr.String(jtv) } - case "thingTypes": - if err := awsRestjson1_deserializeDocumentThingTypeList(&sv.ThingTypes, value); err != nil { + case "reportType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReportType to be of type string, got %T instead", value) + } + sv.ReportType = types.ReportType(jtv) + } + + case "resourceLinks": + if err := awsRestjson1_deserializeDocumentS3FileUrlList(&sv.ResourceLinks, value); err != nil { return err } @@ -32784,14 +33221,14 @@ func awsRestjson1_deserializeOpDocumentListThingTypesOutput(v **ListThingTypesOu return nil } -type awsRestjson1_deserializeOpListTopicRuleDestinations struct { +type awsRestjson1_deserializeOpListThingRegistrationTasks struct { } -func (*awsRestjson1_deserializeOpListTopicRuleDestinations) ID() string { +func (*awsRestjson1_deserializeOpListThingRegistrationTasks) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTopicRuleDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingRegistrationTasks) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -32809,9 +33246,9 @@ func (m *awsRestjson1_deserializeOpListTopicRuleDestinations) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTopicRuleDestinations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingRegistrationTasks(response, &metadata) } - output := &ListTopicRuleDestinationsOutput{} + output := &ListThingRegistrationTasksOutput{} out.Result = output var buff [1024]byte @@ -32832,7 +33269,7 @@ func (m *awsRestjson1_deserializeOpListTopicRuleDestinations) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -32846,7 +33283,7 @@ func (m *awsRestjson1_deserializeOpListTopicRuleDestinations) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTopicRuleDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingRegistrationTasks(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -32887,14 +33324,14 @@ func awsRestjson1_deserializeOpErrorListTopicRuleDestinations(response *smithyht } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -32909,7 +33346,7 @@ func awsRestjson1_deserializeOpErrorListTopicRuleDestinations(response *smithyht } } -func awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(v **ListTopicRuleDestinationsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingRegistrationTasksOutput(v **ListThingRegistrationTasksOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -32922,20 +33359,15 @@ func awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(v **ListT return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTopicRuleDestinationsOutput + var sv *ListThingRegistrationTasksOutput if *v == nil { - sv = &ListTopicRuleDestinationsOutput{} + sv = &ListThingRegistrationTasksOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "destinationSummaries": - if err := awsRestjson1_deserializeDocumentTopicRuleDestinationSummaries(&sv.DestinationSummaries, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -32945,6 +33377,11 @@ func awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(v **ListT sv.NextToken = ptr.String(jtv) } + case "taskIds": + if err := awsRestjson1_deserializeDocumentTaskIdList(&sv.TaskIds, value); err != nil { + return err + } + default: _, _ = key, value @@ -32954,14 +33391,14 @@ func awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(v **ListT return nil } -type awsRestjson1_deserializeOpListTopicRules struct { +type awsRestjson1_deserializeOpListThings struct { } -func (*awsRestjson1_deserializeOpListTopicRules) ID() string { +func (*awsRestjson1_deserializeOpListThings) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTopicRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -32979,9 +33416,9 @@ func (m *awsRestjson1_deserializeOpListTopicRules) HandleDeserialize(ctx context } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTopicRules(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThings(response, &metadata) } - output := &ListTopicRulesOutput{} + output := &ListThingsOutput{} out.Result = output var buff [1024]byte @@ -33002,7 +33439,7 @@ func (m *awsRestjson1_deserializeOpListTopicRules) HandleDeserialize(ctx context return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTopicRulesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -33016,7 +33453,7 @@ func (m *awsRestjson1_deserializeOpListTopicRules) HandleDeserialize(ctx context return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTopicRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThings(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -33057,8 +33494,8 @@ func awsRestjson1_deserializeOpErrorListTopicRules(response *smithyhttp.Response } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -33066,6 +33503,12 @@ func awsRestjson1_deserializeOpErrorListTopicRules(response *smithyhttp.Response case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -33076,7 +33519,7 @@ func awsRestjson1_deserializeOpErrorListTopicRules(response *smithyhttp.Response } } -func awsRestjson1_deserializeOpDocumentListTopicRulesOutput(v **ListTopicRulesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingsOutput(v **ListThingsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -33089,9 +33532,9 @@ func awsRestjson1_deserializeOpDocumentListTopicRulesOutput(v **ListTopicRulesOu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTopicRulesOutput + var sv *ListThingsOutput if *v == nil { - sv = &ListTopicRulesOutput{} + sv = &ListThingsOutput{} } else { sv = *v } @@ -33107,8 +33550,8 @@ func awsRestjson1_deserializeOpDocumentListTopicRulesOutput(v **ListTopicRulesOu sv.NextToken = ptr.String(jtv) } - case "rules": - if err := awsRestjson1_deserializeDocumentTopicRuleList(&sv.Rules, value); err != nil { + case "things": + if err := awsRestjson1_deserializeDocumentThingAttributeList(&sv.Things, value); err != nil { return err } @@ -33121,14 +33564,14 @@ func awsRestjson1_deserializeOpDocumentListTopicRulesOutput(v **ListTopicRulesOu return nil } -type awsRestjson1_deserializeOpListV2LoggingLevels struct { +type awsRestjson1_deserializeOpListThingsInBillingGroup struct { } -func (*awsRestjson1_deserializeOpListV2LoggingLevels) ID() string { +func (*awsRestjson1_deserializeOpListThingsInBillingGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListV2LoggingLevels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingsInBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -33146,9 +33589,9 @@ func (m *awsRestjson1_deserializeOpListV2LoggingLevels) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListV2LoggingLevels(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingsInBillingGroup(response, &metadata) } - output := &ListV2LoggingLevelsOutput{} + output := &ListThingsInBillingGroupOutput{} out.Result = output var buff [1024]byte @@ -33169,7 +33612,7 @@ func (m *awsRestjson1_deserializeOpListV2LoggingLevels) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -33183,7 +33626,7 @@ func (m *awsRestjson1_deserializeOpListV2LoggingLevels) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListV2LoggingLevels(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingsInBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -33224,17 +33667,17 @@ func awsRestjson1_deserializeOpErrorListV2LoggingLevels(response *smithyhttp.Res } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("NotConfiguredException", errorCode): - return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -33246,7 +33689,7 @@ func awsRestjson1_deserializeOpErrorListV2LoggingLevels(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(v **ListV2LoggingLevelsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingsInBillingGroupOutput(v **ListThingsInBillingGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -33259,20 +33702,15 @@ func awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(v **ListV2Loggi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListV2LoggingLevelsOutput + var sv *ListThingsInBillingGroupOutput if *v == nil { - sv = &ListV2LoggingLevelsOutput{} + sv = &ListThingsInBillingGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "logTargetConfigurations": - if err := awsRestjson1_deserializeDocumentLogTargetConfigurations(&sv.LogTargetConfigurations, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -33282,6 +33720,11 @@ func awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(v **ListV2Loggi sv.NextToken = ptr.String(jtv) } + case "things": + if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil { + return err + } + default: _, _ = key, value @@ -33291,14 +33734,14 @@ func awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(v **ListV2Loggi return nil } -type awsRestjson1_deserializeOpListViolationEvents struct { +type awsRestjson1_deserializeOpListThingsInThingGroup struct { } -func (*awsRestjson1_deserializeOpListViolationEvents) ID() string { +func (*awsRestjson1_deserializeOpListThingsInThingGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListViolationEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingsInThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -33316,9 +33759,9 @@ func (m *awsRestjson1_deserializeOpListViolationEvents) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListViolationEvents(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingsInThingGroup(response, &metadata) } - output := &ListViolationEventsOutput{} + output := &ListThingsInThingGroupOutput{} out.Result = output var buff [1024]byte @@ -33339,7 +33782,7 @@ func (m *awsRestjson1_deserializeOpListViolationEvents) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListViolationEventsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -33353,7 +33796,7 @@ func (m *awsRestjson1_deserializeOpListViolationEvents) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListViolationEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingsInThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -33400,6 +33843,9 @@ func awsRestjson1_deserializeOpErrorListViolationEvents(response *smithyhttp.Res case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -33413,7 +33859,7 @@ func awsRestjson1_deserializeOpErrorListViolationEvents(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListViolationEventsOutput(v **ListViolationEventsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingsInThingGroupOutput(v **ListThingsInThingGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -33426,9 +33872,9 @@ func awsRestjson1_deserializeOpDocumentListViolationEventsOutput(v **ListViolati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListViolationEventsOutput + var sv *ListThingsInThingGroupOutput if *v == nil { - sv = &ListViolationEventsOutput{} + sv = &ListThingsInThingGroupOutput{} } else { sv = *v } @@ -33444,8 +33890,8 @@ func awsRestjson1_deserializeOpDocumentListViolationEventsOutput(v **ListViolati sv.NextToken = ptr.String(jtv) } - case "violationEvents": - if err := awsRestjson1_deserializeDocumentViolationEvents(&sv.ViolationEvents, value); err != nil { + case "things": + if err := awsRestjson1_deserializeDocumentThingNameList(&sv.Things, value); err != nil { return err } @@ -33458,108 +33904,14 @@ func awsRestjson1_deserializeOpDocumentListViolationEventsOutput(v **ListViolati return nil } -type awsRestjson1_deserializeOpPutVerificationStateOnViolation struct { -} - -func (*awsRestjson1_deserializeOpPutVerificationStateOnViolation) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpPutVerificationStateOnViolation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorPutVerificationStateOnViolation(response, &metadata) - } - output := &PutVerificationStateOnViolationOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorPutVerificationStateOnViolation(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err - } - - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message - } - - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, - } - return genericError - - } -} - -type awsRestjson1_deserializeOpRegisterCACertificate struct { +type awsRestjson1_deserializeOpListThingTypes struct { } -func (*awsRestjson1_deserializeOpRegisterCACertificate) ID() string { +func (*awsRestjson1_deserializeOpListThingTypes) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRegisterCACertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListThingTypes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -33577,9 +33929,9 @@ func (m *awsRestjson1_deserializeOpRegisterCACertificate) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRegisterCACertificate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListThingTypes(response, &metadata) } - output := &RegisterCACertificateOutput{} + output := &ListThingTypesOutput{} out.Result = output var buff [1024]byte @@ -33600,7 +33952,7 @@ func (m *awsRestjson1_deserializeOpRegisterCACertificate) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentRegisterCACertificateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListThingTypesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -33614,7 +33966,7 @@ func (m *awsRestjson1_deserializeOpRegisterCACertificate) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorRegisterCACertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListThingTypes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -33655,27 +34007,12 @@ func awsRestjson1_deserializeOpErrorRegisterCACertificate(response *smithyhttp.R } switch { - case strings.EqualFold("CertificateValidationException", errorCode): - return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("RegistrationCodeValidationException", errorCode): - return awsRestjson1_deserializeErrorRegistrationCodeValidationException(response, errorBody) - - case strings.EqualFold("ResourceAlreadyExistsException", errorCode): - return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -33695,7 +34032,7 @@ func awsRestjson1_deserializeOpErrorRegisterCACertificate(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentRegisterCACertificateOutput(v **RegisterCACertificateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListThingTypesOutput(v **ListThingTypesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -33708,31 +34045,27 @@ func awsRestjson1_deserializeOpDocumentRegisterCACertificateOutput(v **RegisterC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *RegisterCACertificateOutput + var sv *ListThingTypesOutput if *v == nil { - sv = &RegisterCACertificateOutput{} + sv = &ListThingTypesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "certificateArn": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.CertificateArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "certificateId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) - } - sv.CertificateId = ptr.String(jtv) + case "thingTypes": + if err := awsRestjson1_deserializeDocumentThingTypeList(&sv.ThingTypes, value); err != nil { + return err } default: @@ -33744,14 +34077,14 @@ func awsRestjson1_deserializeOpDocumentRegisterCACertificateOutput(v **RegisterC return nil } -type awsRestjson1_deserializeOpRegisterCertificate struct { +type awsRestjson1_deserializeOpListTopicRuleDestinations struct { } -func (*awsRestjson1_deserializeOpRegisterCertificate) ID() string { +func (*awsRestjson1_deserializeOpListTopicRuleDestinations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRegisterCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTopicRuleDestinations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -33769,9 +34102,9 @@ func (m *awsRestjson1_deserializeOpRegisterCertificate) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRegisterCertificate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTopicRuleDestinations(response, &metadata) } - output := &RegisterCertificateOutput{} + output := &ListTopicRuleDestinationsOutput{} out.Result = output var buff [1024]byte @@ -33792,7 +34125,7 @@ func (m *awsRestjson1_deserializeOpRegisterCertificate) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentRegisterCertificateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -33806,7 +34139,7 @@ func (m *awsRestjson1_deserializeOpRegisterCertificate) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorRegisterCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTopicRuleDestinations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -33847,30 +34180,15 @@ func awsRestjson1_deserializeOpErrorRegisterCertificate(response *smithyhttp.Res } switch { - case strings.EqualFold("CertificateConflictException", errorCode): - return awsRestjson1_deserializeErrorCertificateConflictException(response, errorBody) - - case strings.EqualFold("CertificateStateException", errorCode): - return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody) - - case strings.EqualFold("CertificateValidationException", errorCode): - return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody) - - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceAlreadyExistsException", errorCode): - return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -33884,7 +34202,7 @@ func awsRestjson1_deserializeOpErrorRegisterCertificate(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentRegisterCertificateOutput(v **RegisterCertificateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTopicRuleDestinationsOutput(v **ListTopicRuleDestinationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -33897,31 +34215,27 @@ func awsRestjson1_deserializeOpDocumentRegisterCertificateOutput(v **RegisterCer return fmt.Errorf("unexpected JSON type %v", value) } - var sv *RegisterCertificateOutput + var sv *ListTopicRuleDestinationsOutput if *v == nil { - sv = &RegisterCertificateOutput{} + sv = &ListTopicRuleDestinationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "certificateArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) - } - sv.CertificateArn = ptr.String(jtv) + case "destinationSummaries": + if err := awsRestjson1_deserializeDocumentTopicRuleDestinationSummaries(&sv.DestinationSummaries, value); err != nil { + return err } - case "certificateId": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.CertificateId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -33933,14 +34247,14 @@ func awsRestjson1_deserializeOpDocumentRegisterCertificateOutput(v **RegisterCer return nil } -type awsRestjson1_deserializeOpRegisterCertificateWithoutCA struct { +type awsRestjson1_deserializeOpListTopicRules struct { } -func (*awsRestjson1_deserializeOpRegisterCertificateWithoutCA) ID() string { +func (*awsRestjson1_deserializeOpListTopicRules) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRegisterCertificateWithoutCA) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTopicRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -33958,9 +34272,9 @@ func (m *awsRestjson1_deserializeOpRegisterCertificateWithoutCA) HandleDeseriali } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRegisterCertificateWithoutCA(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTopicRules(response, &metadata) } - output := &RegisterCertificateWithoutCAOutput{} + output := &ListTopicRulesOutput{} out.Result = output var buff [1024]byte @@ -33981,7 +34295,7 @@ func (m *awsRestjson1_deserializeOpRegisterCertificateWithoutCA) HandleDeseriali return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentRegisterCertificateWithoutCAOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTopicRulesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -33995,7 +34309,7 @@ func (m *awsRestjson1_deserializeOpRegisterCertificateWithoutCA) HandleDeseriali return out, metadata, err } -func awsRestjson1_deserializeOpErrorRegisterCertificateWithoutCA(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTopicRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -34036,30 +34350,15 @@ func awsRestjson1_deserializeOpErrorRegisterCertificateWithoutCA(response *smith } switch { - case strings.EqualFold("CertificateStateException", errorCode): - return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody) - - case strings.EqualFold("CertificateValidationException", errorCode): - return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody) - - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceAlreadyExistsException", errorCode): - return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -34070,7 +34369,7 @@ func awsRestjson1_deserializeOpErrorRegisterCertificateWithoutCA(response *smith } } -func awsRestjson1_deserializeOpDocumentRegisterCertificateWithoutCAOutput(v **RegisterCertificateWithoutCAOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTopicRulesOutput(v **ListTopicRulesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -34083,31 +34382,27 @@ func awsRestjson1_deserializeOpDocumentRegisterCertificateWithoutCAOutput(v **Re return fmt.Errorf("unexpected JSON type %v", value) } - var sv *RegisterCertificateWithoutCAOutput + var sv *ListTopicRulesOutput if *v == nil { - sv = &RegisterCertificateWithoutCAOutput{} + sv = &ListTopicRulesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "certificateArn": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.CertificateArn = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } - case "certificateId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) - } - sv.CertificateId = ptr.String(jtv) + case "rules": + if err := awsRestjson1_deserializeDocumentTopicRuleList(&sv.Rules, value); err != nil { + return err } default: @@ -34119,14 +34414,14 @@ func awsRestjson1_deserializeOpDocumentRegisterCertificateWithoutCAOutput(v **Re return nil } -type awsRestjson1_deserializeOpRegisterThing struct { +type awsRestjson1_deserializeOpListV2LoggingLevels struct { } -func (*awsRestjson1_deserializeOpRegisterThing) ID() string { +func (*awsRestjson1_deserializeOpListV2LoggingLevels) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRegisterThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListV2LoggingLevels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -34144,9 +34439,9 @@ func (m *awsRestjson1_deserializeOpRegisterThing) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRegisterThing(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListV2LoggingLevels(response, &metadata) } - output := &RegisterThingOutput{} + output := &ListV2LoggingLevelsOutput{} out.Result = output var buff [1024]byte @@ -34167,7 +34462,7 @@ func (m *awsRestjson1_deserializeOpRegisterThing) HandleDeserialize(ctx context. return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentRegisterThingOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -34181,7 +34476,7 @@ func (m *awsRestjson1_deserializeOpRegisterThing) HandleDeserialize(ctx context. return out, metadata, err } -func awsRestjson1_deserializeOpErrorRegisterThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListV2LoggingLevels(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -34222,27 +34517,18 @@ func awsRestjson1_deserializeOpErrorRegisterThing(response *smithyhttp.Response, } switch { - case strings.EqualFold("ConflictingResourceUpdateException", errorCode): - return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) - - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceRegistrationFailureException", errorCode): - return awsRestjson1_deserializeErrorResourceRegistrationFailureException(response, errorBody) + case strings.EqualFold("NotConfiguredException", errorCode): + return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -34253,7 +34539,7 @@ func awsRestjson1_deserializeOpErrorRegisterThing(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentRegisterThingOutput(v **RegisterThingOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListV2LoggingLevelsOutput(v **ListV2LoggingLevelsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -34266,27 +34552,27 @@ func awsRestjson1_deserializeOpDocumentRegisterThingOutput(v **RegisterThingOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *RegisterThingOutput + var sv *ListV2LoggingLevelsOutput if *v == nil { - sv = &RegisterThingOutput{} + sv = &ListV2LoggingLevelsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "certificatePem": + case "logTargetConfigurations": + if err := awsRestjson1_deserializeDocumentLogTargetConfigurations(&sv.LogTargetConfigurations, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.CertificatePem = ptr.String(jtv) - } - - case "resourceArns": - if err := awsRestjson1_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } default: @@ -34298,14 +34584,14 @@ func awsRestjson1_deserializeOpDocumentRegisterThingOutput(v **RegisterThingOutp return nil } -type awsRestjson1_deserializeOpRejectCertificateTransfer struct { +type awsRestjson1_deserializeOpListViolationEvents struct { } -func (*awsRestjson1_deserializeOpRejectCertificateTransfer) ID() string { +func (*awsRestjson1_deserializeOpListViolationEvents) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRejectCertificateTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListViolationEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -34323,14 +34609,36 @@ func (m *awsRestjson1_deserializeOpRejectCertificateTransfer) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRejectCertificateTransfer(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListViolationEvents(response, &metadata) } - output := &RejectCertificateTransferOutput{} + output := &ListViolationEventsOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentListViolationEventsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } @@ -34338,7 +34646,7 @@ func (m *awsRestjson1_deserializeOpRejectCertificateTransfer) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorRejectCertificateTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListViolationEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -34385,21 +34693,9 @@ func awsRestjson1_deserializeOpErrorRejectCertificateTransfer(response *smithyht case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("TransferAlreadyCompletedException", errorCode): - return awsRestjson1_deserializeErrorTransferAlreadyCompletedException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -34410,111 +34706,59 @@ func awsRestjson1_deserializeOpErrorRejectCertificateTransfer(response *smithyht } } -type awsRestjson1_deserializeOpRemoveThingFromBillingGroup struct { -} - -func (*awsRestjson1_deserializeOpRemoveThingFromBillingGroup) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpRemoveThingFromBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorRemoveThingFromBillingGroup(response, &metadata) - } - output := &RemoveThingFromBillingGroupOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorRemoveThingFromBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} +func awsRestjson1_deserializeOpDocumentListViolationEventsOutput(v **ListViolationEventsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) + if value == nil { + return nil } - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() - jsonCode, message, err := restjson.GetErrorInfo(decoder) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - err = &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body, %w", err), - Snapshot: snapshot.Bytes(), - } - return err + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) } - errorBody.Seek(0, io.SeekStart) - if len(headerCode) == 0 && len(jsonCode) != 0 { - errorCode = restjson.SanitizeErrorCode(jsonCode) - } - if len(message) != 0 { - errorMessage = message + var sv *ListViolationEventsOutput + if *v == nil { + sv = &ListViolationEventsOutput{} + } else { + sv = *v } - switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case "violationEvents": + if err := awsRestjson1_deserializeDocumentViolationEvents(&sv.ViolationEvents, value); err != nil { + return err + } - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + default: + _, _ = key, value - default: - genericError := &smithy.GenericAPIError{ - Code: errorCode, - Message: errorMessage, } - return genericError - } + *v = sv + return nil } -type awsRestjson1_deserializeOpRemoveThingFromThingGroup struct { +type awsRestjson1_deserializeOpPutVerificationStateOnViolation struct { } -func (*awsRestjson1_deserializeOpRemoveThingFromThingGroup) ID() string { +func (*awsRestjson1_deserializeOpPutVerificationStateOnViolation) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpRemoveThingFromThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutVerificationStateOnViolation) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -34532,16 +34776,16 @@ func (m *awsRestjson1_deserializeOpRemoveThingFromThingGroup) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorRemoveThingFromThingGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutVerificationStateOnViolation(response, &metadata) } - output := &RemoveThingFromThingGroupOutput{} + output := &PutVerificationStateOnViolationOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorRemoveThingFromThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutVerificationStateOnViolation(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -34588,9 +34832,6 @@ func awsRestjson1_deserializeOpErrorRemoveThingFromThingGroup(response *smithyht case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -34604,14 +34845,14 @@ func awsRestjson1_deserializeOpErrorRemoveThingFromThingGroup(response *smithyht } } -type awsRestjson1_deserializeOpReplaceTopicRule struct { +type awsRestjson1_deserializeOpRegisterCACertificate struct { } -func (*awsRestjson1_deserializeOpReplaceTopicRule) ID() string { +func (*awsRestjson1_deserializeOpRegisterCACertificate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpReplaceTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRegisterCACertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -34629,14 +34870,36 @@ func (m *awsRestjson1_deserializeOpReplaceTopicRule) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorReplaceTopicRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRegisterCACertificate(response, &metadata) } - output := &ReplaceTopicRuleOutput{} + output := &RegisterCACertificateOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentRegisterCACertificateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } @@ -34644,7 +34907,7 @@ func (m *awsRestjson1_deserializeOpReplaceTopicRule) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorReplaceTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRegisterCACertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -34685,20 +34948,32 @@ func awsRestjson1_deserializeOpErrorReplaceTopicRule(response *smithyhttp.Respon } switch { - case strings.EqualFold("ConflictingResourceUpdateException", errorCode): - return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + case strings.EqualFold("CertificateValidationException", errorCode): + return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody) - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("RegistrationCodeValidationException", errorCode): + return awsRestjson1_deserializeErrorRegistrationCodeValidationException(response, errorBody) + + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("SqlParseException", errorCode): - return awsRestjson1_deserializeErrorSqlParseException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -34713,14 +34988,63 @@ func awsRestjson1_deserializeOpErrorReplaceTopicRule(response *smithyhttp.Respon } } -type awsRestjson1_deserializeOpSearchIndex struct { +func awsRestjson1_deserializeOpDocumentRegisterCACertificateOutput(v **RegisterCACertificateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RegisterCACertificateOutput + if *v == nil { + sv = &RegisterCACertificateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "certificateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + } + sv.CertificateArn = ptr.String(jtv) + } + + case "certificateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) + } + sv.CertificateId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpSearchIndex) ID() string { +type awsRestjson1_deserializeOpRegisterCertificate struct { +} + +func (*awsRestjson1_deserializeOpRegisterCertificate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSearchIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRegisterCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -34738,9 +35062,9 @@ func (m *awsRestjson1_deserializeOpSearchIndex) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSearchIndex(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRegisterCertificate(response, &metadata) } - output := &SearchIndexOutput{} + output := &RegisterCertificateOutput{} out.Result = output var buff [1024]byte @@ -34761,7 +35085,7 @@ func (m *awsRestjson1_deserializeOpSearchIndex) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSearchIndexOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentRegisterCertificateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -34775,7 +35099,7 @@ func (m *awsRestjson1_deserializeOpSearchIndex) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorSearchIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRegisterCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -34816,20 +35140,23 @@ func awsRestjson1_deserializeOpErrorSearchIndex(response *smithyhttp.Response, m } switch { - case strings.EqualFold("IndexNotReadyException", errorCode): - return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody) + case strings.EqualFold("CertificateConflictException", errorCode): + return awsRestjson1_deserializeErrorCertificateConflictException(response, errorBody) + + case strings.EqualFold("CertificateStateException", errorCode): + return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody) + + case strings.EqualFold("CertificateValidationException", errorCode): + return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidQueryException", errorCode): - return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -34850,7 +35177,7 @@ func awsRestjson1_deserializeOpErrorSearchIndex(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentSearchIndexOutput(v **SearchIndexOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentRegisterCertificateOutput(v **RegisterCertificateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -34863,32 +35190,31 @@ func awsRestjson1_deserializeOpDocumentSearchIndexOutput(v **SearchIndexOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SearchIndexOutput + var sv *RegisterCertificateOutput if *v == nil { - sv = &SearchIndexOutput{} + sv = &RegisterCertificateOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "nextToken": + case "certificateArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) - } - - case "thingGroups": - if err := awsRestjson1_deserializeDocumentThingGroupDocumentList(&sv.ThingGroups, value); err != nil { - return err + sv.CertificateArn = ptr.String(jtv) } - case "things": - if err := awsRestjson1_deserializeDocumentThingDocumentList(&sv.Things, value); err != nil { - return err + case "certificateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) + } + sv.CertificateId = ptr.String(jtv) } default: @@ -34900,14 +35226,14 @@ func awsRestjson1_deserializeOpDocumentSearchIndexOutput(v **SearchIndexOutput, return nil } -type awsRestjson1_deserializeOpSetDefaultAuthorizer struct { +type awsRestjson1_deserializeOpRegisterCertificateWithoutCA struct { } -func (*awsRestjson1_deserializeOpSetDefaultAuthorizer) ID() string { +func (*awsRestjson1_deserializeOpRegisterCertificateWithoutCA) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSetDefaultAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRegisterCertificateWithoutCA) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -34925,9 +35251,9 @@ func (m *awsRestjson1_deserializeOpSetDefaultAuthorizer) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRegisterCertificateWithoutCA(response, &metadata) } - output := &SetDefaultAuthorizerOutput{} + output := &RegisterCertificateWithoutCAOutput{} out.Result = output var buff [1024]byte @@ -34948,7 +35274,7 @@ func (m *awsRestjson1_deserializeOpSetDefaultAuthorizer) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentSetDefaultAuthorizerOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentRegisterCertificateWithoutCAOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -34962,7 +35288,7 @@ func (m *awsRestjson1_deserializeOpSetDefaultAuthorizer) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRegisterCertificateWithoutCA(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -35003,6 +35329,12 @@ func awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response *smithyhttp.Re } switch { + case strings.EqualFold("CertificateStateException", errorCode): + return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody) + + case strings.EqualFold("CertificateValidationException", errorCode): + return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -35012,9 +35344,6 @@ func awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response *smithyhttp.Re case strings.EqualFold("ResourceAlreadyExistsException", errorCode): return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -35034,7 +35363,7 @@ func awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentSetDefaultAuthorizerOutput(v **SetDefaultAuthorizerOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentRegisterCertificateWithoutCAOutput(v **RegisterCertificateWithoutCAOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35047,31 +35376,31 @@ func awsRestjson1_deserializeOpDocumentSetDefaultAuthorizerOutput(v **SetDefault return fmt.Errorf("unexpected JSON type %v", value) } - var sv *SetDefaultAuthorizerOutput + var sv *RegisterCertificateWithoutCAOutput if *v == nil { - sv = &SetDefaultAuthorizerOutput{} + sv = &RegisterCertificateWithoutCAOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "authorizerArn": + case "certificateArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value) + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) } - sv.AuthorizerArn = ptr.String(jtv) + sv.CertificateArn = ptr.String(jtv) } - case "authorizerName": + case "certificateId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) + return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) } - sv.AuthorizerName = ptr.String(jtv) + sv.CertificateId = ptr.String(jtv) } default: @@ -35083,14 +35412,14 @@ func awsRestjson1_deserializeOpDocumentSetDefaultAuthorizerOutput(v **SetDefault return nil } -type awsRestjson1_deserializeOpSetDefaultPolicyVersion struct { +type awsRestjson1_deserializeOpRegisterThing struct { } -func (*awsRestjson1_deserializeOpSetDefaultPolicyVersion) ID() string { +func (*awsRestjson1_deserializeOpRegisterThing) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSetDefaultPolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRegisterThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -35108,14 +35437,36 @@ func (m *awsRestjson1_deserializeOpSetDefaultPolicyVersion) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSetDefaultPolicyVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRegisterThing(response, &metadata) } - output := &SetDefaultPolicyVersionOutput{} + output := &RegisterThingOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentRegisterThingOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } @@ -35123,7 +35474,7 @@ func (m *awsRestjson1_deserializeOpSetDefaultPolicyVersion) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorSetDefaultPolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRegisterThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -35164,14 +35515,17 @@ func awsRestjson1_deserializeOpErrorSetDefaultPolicyVersion(response *smithyhttp } switch { + case strings.EqualFold("ConflictingResourceUpdateException", errorCode): + return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ResourceRegistrationFailureException", errorCode): + return awsRestjson1_deserializeErrorResourceRegistrationFailureException(response, errorBody) case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -35192,14 +35546,59 @@ func awsRestjson1_deserializeOpErrorSetDefaultPolicyVersion(response *smithyhttp } } -type awsRestjson1_deserializeOpSetLoggingOptions struct { +func awsRestjson1_deserializeOpDocumentRegisterThingOutput(v **RegisterThingOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RegisterThingOutput + if *v == nil { + sv = &RegisterThingOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "certificatePem": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value) + } + sv.CertificatePem = ptr.String(jtv) + } + + case "resourceArns": + if err := awsRestjson1_deserializeDocumentResourceArns(&sv.ResourceArns, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpSetLoggingOptions) ID() string { +type awsRestjson1_deserializeOpRejectCertificateTransfer struct { +} + +func (*awsRestjson1_deserializeOpRejectCertificateTransfer) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSetLoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRejectCertificateTransfer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -35217,9 +35616,9 @@ func (m *awsRestjson1_deserializeOpSetLoggingOptions) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSetLoggingOptions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRejectCertificateTransfer(response, &metadata) } - output := &SetLoggingOptionsOutput{} + output := &RejectCertificateTransferOutput{} out.Result = output if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { @@ -35232,7 +35631,7 @@ func (m *awsRestjson1_deserializeOpSetLoggingOptions) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorSetLoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRejectCertificateTransfer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -35273,15 +35672,27 @@ func awsRestjson1_deserializeOpErrorSetLoggingOptions(response *smithyhttp.Respo } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("TransferAlreadyCompletedException", errorCode): + return awsRestjson1_deserializeErrorTransferAlreadyCompletedException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -35292,14 +35703,14 @@ func awsRestjson1_deserializeOpErrorSetLoggingOptions(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpSetV2LoggingLevel struct { +type awsRestjson1_deserializeOpRemoveThingFromBillingGroup struct { } -func (*awsRestjson1_deserializeOpSetV2LoggingLevel) ID() string { +func (*awsRestjson1_deserializeOpRemoveThingFromBillingGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSetV2LoggingLevel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRemoveThingFromBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -35317,22 +35728,16 @@ func (m *awsRestjson1_deserializeOpSetV2LoggingLevel) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSetV2LoggingLevel(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRemoveThingFromBillingGroup(response, &metadata) } - output := &SetV2LoggingLevelOutput{} + output := &RemoveThingFromBillingGroupOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorSetV2LoggingLevel(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRemoveThingFromBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -35373,20 +35778,17 @@ func awsRestjson1_deserializeOpErrorSetV2LoggingLevel(response *smithyhttp.Respo } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - - case strings.EqualFold("NotConfiguredException", errorCode): - return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -35398,14 +35800,14 @@ func awsRestjson1_deserializeOpErrorSetV2LoggingLevel(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpSetV2LoggingOptions struct { +type awsRestjson1_deserializeOpRemoveThingFromThingGroup struct { } -func (*awsRestjson1_deserializeOpSetV2LoggingOptions) ID() string { +func (*awsRestjson1_deserializeOpRemoveThingFromThingGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpSetV2LoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpRemoveThingFromThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -35423,22 +35825,16 @@ func (m *awsRestjson1_deserializeOpSetV2LoggingOptions) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorSetV2LoggingOptions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorRemoveThingFromThingGroup(response, &metadata) } - output := &SetV2LoggingOptionsOutput{} + output := &RemoveThingFromThingGroupOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorSetV2LoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorRemoveThingFromThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -35479,14 +35875,17 @@ func awsRestjson1_deserializeOpErrorSetV2LoggingOptions(response *smithyhttp.Res } switch { - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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{ @@ -35498,14 +35897,14 @@ func awsRestjson1_deserializeOpErrorSetV2LoggingOptions(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpStartAuditMitigationActionsTask struct { +type awsRestjson1_deserializeOpReplaceTopicRule struct { } -func (*awsRestjson1_deserializeOpStartAuditMitigationActionsTask) ID() string { +func (*awsRestjson1_deserializeOpReplaceTopicRule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartAuditMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpReplaceTopicRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -35523,36 +35922,14 @@ func (m *awsRestjson1_deserializeOpStartAuditMitigationActionsTask) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartAuditMitigationActionsTask(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorReplaceTopicRule(response, &metadata) } - output := &StartAuditMitigationActionsTaskOutput{} + output := &ReplaceTopicRuleOutput{} 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_deserializeOpDocumentStartAuditMitigationActionsTaskOutput(&output, shape) - 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 with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } @@ -35560,7 +35937,7 @@ func (m *awsRestjson1_deserializeOpStartAuditMitigationActionsTask) HandleDeseri return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartAuditMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorReplaceTopicRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -35601,20 +35978,23 @@ func awsRestjson1_deserializeOpErrorStartAuditMitigationActionsTask(response *sm } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("ConflictingResourceUpdateException", errorCode): + return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("TaskAlreadyExistsException", errorCode): - return awsRestjson1_deserializeErrorTaskAlreadyExistsException(response, errorBody) + case strings.EqualFold("SqlParseException", errorCode): + return awsRestjson1_deserializeErrorSqlParseException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -35626,54 +36006,14 @@ func awsRestjson1_deserializeOpErrorStartAuditMitigationActionsTask(response *sm } } -func awsRestjson1_deserializeOpDocumentStartAuditMitigationActionsTaskOutput(v **StartAuditMitigationActionsTaskOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *StartAuditMitigationActionsTaskOutput - if *v == nil { - sv = &StartAuditMitigationActionsTaskOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "taskId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MitigationActionsTaskId to be of type string, got %T instead", value) - } - sv.TaskId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpStartDetectMitigationActionsTask struct { +type awsRestjson1_deserializeOpSearchIndex struct { } -func (*awsRestjson1_deserializeOpStartDetectMitigationActionsTask) ID() string { +func (*awsRestjson1_deserializeOpSearchIndex) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartDetectMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSearchIndex) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -35691,9 +36031,9 @@ func (m *awsRestjson1_deserializeOpStartDetectMitigationActionsTask) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartDetectMitigationActionsTask(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSearchIndex(response, &metadata) } - output := &StartDetectMitigationActionsTaskOutput{} + output := &SearchIndexOutput{} out.Result = output var buff [1024]byte @@ -35714,7 +36054,7 @@ func (m *awsRestjson1_deserializeOpStartDetectMitigationActionsTask) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartDetectMitigationActionsTaskOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSearchIndexOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -35728,7 +36068,7 @@ func (m *awsRestjson1_deserializeOpStartDetectMitigationActionsTask) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartDetectMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSearchIndex(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -35769,21 +36109,30 @@ func awsRestjson1_deserializeOpErrorStartDetectMitigationActionsTask(response *s } switch { + case strings.EqualFold("IndexNotReadyException", errorCode): + return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidQueryException", errorCode): + return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("TaskAlreadyExistsException", errorCode): - return awsRestjson1_deserializeErrorTaskAlreadyExistsException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -35794,7 +36143,7 @@ func awsRestjson1_deserializeOpErrorStartDetectMitigationActionsTask(response *s } } -func awsRestjson1_deserializeOpDocumentStartDetectMitigationActionsTaskOutput(v **StartDetectMitigationActionsTaskOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSearchIndexOutput(v **SearchIndexOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35807,22 +36156,32 @@ func awsRestjson1_deserializeOpDocumentStartDetectMitigationActionsTaskOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartDetectMitigationActionsTaskOutput + var sv *SearchIndexOutput if *v == nil { - sv = &StartDetectMitigationActionsTaskOutput{} + sv = &SearchIndexOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "taskId": + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MitigationActionsTaskId to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.TaskId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) + } + + case "thingGroups": + if err := awsRestjson1_deserializeDocumentThingGroupDocumentList(&sv.ThingGroups, value); err != nil { + return err + } + + case "things": + if err := awsRestjson1_deserializeDocumentThingDocumentList(&sv.Things, value); err != nil { + return err } default: @@ -35834,14 +36193,14 @@ func awsRestjson1_deserializeOpDocumentStartDetectMitigationActionsTaskOutput(v return nil } -type awsRestjson1_deserializeOpStartOnDemandAuditTask struct { +type awsRestjson1_deserializeOpSetDefaultAuthorizer struct { } -func (*awsRestjson1_deserializeOpStartOnDemandAuditTask) ID() string { +func (*awsRestjson1_deserializeOpSetDefaultAuthorizer) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartOnDemandAuditTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSetDefaultAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -35859,9 +36218,9 @@ func (m *awsRestjson1_deserializeOpStartOnDemandAuditTask) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartOnDemandAuditTask(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response, &metadata) } - output := &StartOnDemandAuditTaskOutput{} + output := &SetDefaultAuthorizerOutput{} out.Result = output var buff [1024]byte @@ -35882,7 +36241,7 @@ func (m *awsRestjson1_deserializeOpStartOnDemandAuditTask) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentStartOnDemandAuditTaskOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentSetDefaultAuthorizerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -35896,7 +36255,7 @@ func (m *awsRestjson1_deserializeOpStartOnDemandAuditTask) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartOnDemandAuditTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSetDefaultAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -35943,12 +36302,21 @@ func awsRestjson1_deserializeOpErrorStartOnDemandAuditTask(response *smithyhttp. case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorResourceAlreadyExistsException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -35959,7 +36327,7 @@ func awsRestjson1_deserializeOpErrorStartOnDemandAuditTask(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentStartOnDemandAuditTaskOutput(v **StartOnDemandAuditTaskOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentSetDefaultAuthorizerOutput(v **SetDefaultAuthorizerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -35972,22 +36340,31 @@ func awsRestjson1_deserializeOpDocumentStartOnDemandAuditTaskOutput(v **StartOnD return fmt.Errorf("unexpected JSON type %v", value) } - var sv *StartOnDemandAuditTaskOutput + var sv *SetDefaultAuthorizerOutput if *v == nil { - sv = &StartOnDemandAuditTaskOutput{} + sv = &SetDefaultAuthorizerOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "taskId": + case "authorizerArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value) } - sv.TaskId = ptr.String(jtv) + sv.AuthorizerArn = ptr.String(jtv) + } + + case "authorizerName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) + } + sv.AuthorizerName = ptr.String(jtv) } default: @@ -35999,14 +36376,14 @@ func awsRestjson1_deserializeOpDocumentStartOnDemandAuditTaskOutput(v **StartOnD return nil } -type awsRestjson1_deserializeOpStartThingRegistrationTask struct { +type awsRestjson1_deserializeOpSetDefaultPolicyVersion struct { } -func (*awsRestjson1_deserializeOpStartThingRegistrationTask) ID() string { +func (*awsRestjson1_deserializeOpSetDefaultPolicyVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStartThingRegistrationTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSetDefaultPolicyVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -36024,36 +36401,14 @@ func (m *awsRestjson1_deserializeOpStartThingRegistrationTask) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStartThingRegistrationTask(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSetDefaultPolicyVersion(response, &metadata) } - output := &StartThingRegistrationTaskOutput{} + output := &SetDefaultPolicyVersionOutput{} 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_deserializeOpDocumentStartThingRegistrationTaskOutput(&output, shape) - 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 with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } @@ -36061,7 +36416,7 @@ func (m *awsRestjson1_deserializeOpStartThingRegistrationTask) HandleDeserialize return out, metadata, err } -func awsRestjson1_deserializeOpErrorStartThingRegistrationTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSetDefaultPolicyVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -36108,6 +36463,12 @@ func awsRestjson1_deserializeOpErrorStartThingRegistrationTask(response *smithyh case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -36124,54 +36485,14 @@ func awsRestjson1_deserializeOpErrorStartThingRegistrationTask(response *smithyh } } -func awsRestjson1_deserializeOpDocumentStartThingRegistrationTaskOutput(v **StartThingRegistrationTaskOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *StartThingRegistrationTaskOutput - if *v == nil { - sv = &StartThingRegistrationTaskOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "taskId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TaskId to be of type string, got %T instead", value) - } - sv.TaskId = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpStopThingRegistrationTask struct { +type awsRestjson1_deserializeOpSetLoggingOptions struct { } -func (*awsRestjson1_deserializeOpStopThingRegistrationTask) ID() string { +func (*awsRestjson1_deserializeOpSetLoggingOptions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpStopThingRegistrationTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSetLoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -36189,16 +36510,22 @@ func (m *awsRestjson1_deserializeOpStopThingRegistrationTask) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorStopThingRegistrationTask(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSetLoggingOptions(response, &metadata) } - output := &StopThingRegistrationTaskOutput{} + output := &SetLoggingOptionsOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorStopThingRegistrationTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSetLoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -36239,20 +36566,14 @@ func awsRestjson1_deserializeOpErrorStopThingRegistrationTask(response *smithyht } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -36264,14 +36585,14 @@ func awsRestjson1_deserializeOpErrorStopThingRegistrationTask(response *smithyht } } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpSetV2LoggingLevel struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpSetV2LoggingLevel) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSetV2LoggingLevel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -36289,16 +36610,22 @@ 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_deserializeOpErrorSetV2LoggingLevel(response, &metadata) } - output := &TagResourceOutput{} + output := &SetV2LoggingLevelOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSetV2LoggingLevel(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -36339,8 +36666,8 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -36348,11 +36675,11 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("LimitExceededException", errorCode): return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("NotConfiguredException", errorCode): + return awsRestjson1_deserializeErrorNotConfiguredException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -36364,14 +36691,14 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpTestAuthorization struct { +type awsRestjson1_deserializeOpSetV2LoggingOptions struct { } -func (*awsRestjson1_deserializeOpTestAuthorization) ID() string { +func (*awsRestjson1_deserializeOpSetV2LoggingOptions) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTestAuthorization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpSetV2LoggingOptions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -36389,36 +36716,14 @@ func (m *awsRestjson1_deserializeOpTestAuthorization) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTestAuthorization(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorSetV2LoggingOptions(response, &metadata) } - output := &TestAuthorizationOutput{} + output := &SetV2LoggingOptionsOutput{} 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_deserializeOpDocumentTestAuthorizationOutput(&output, shape) - 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 with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } @@ -36426,7 +36731,7 @@ func (m *awsRestjson1_deserializeOpTestAuthorization) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorTestAuthorization(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorSetV2LoggingOptions(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -36467,27 +36772,15 @@ func awsRestjson1_deserializeOpErrorTestAuthorization(response *smithyhttp.Respo } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -36498,50 +36791,14 @@ func awsRestjson1_deserializeOpErrorTestAuthorization(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentTestAuthorizationOutput(v **TestAuthorizationOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *TestAuthorizationOutput - if *v == nil { - sv = &TestAuthorizationOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "authResults": - if err := awsRestjson1_deserializeDocumentAuthResults(&sv.AuthResults, value); err != nil { - return err - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpTestInvokeAuthorizer struct { +type awsRestjson1_deserializeOpStartAuditMitigationActionsTask struct { } -func (*awsRestjson1_deserializeOpTestInvokeAuthorizer) ID() string { +func (*awsRestjson1_deserializeOpStartAuditMitigationActionsTask) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTestInvokeAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartAuditMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -36559,9 +36816,9 @@ func (m *awsRestjson1_deserializeOpTestInvokeAuthorizer) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTestInvokeAuthorizer(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartAuditMitigationActionsTask(response, &metadata) } - output := &TestInvokeAuthorizerOutput{} + output := &StartAuditMitigationActionsTaskOutput{} out.Result = output var buff [1024]byte @@ -36582,7 +36839,7 @@ func (m *awsRestjson1_deserializeOpTestInvokeAuthorizer) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentTestInvokeAuthorizerOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartAuditMitigationActionsTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -36596,7 +36853,7 @@ func (m *awsRestjson1_deserializeOpTestInvokeAuthorizer) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorTestInvokeAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartAuditMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -36643,21 +36900,15 @@ func awsRestjson1_deserializeOpErrorTestInvokeAuthorizer(response *smithyhttp.Re case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("InvalidResponseException", errorCode): - return awsRestjson1_deserializeErrorInvalidResponseException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("TaskAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorTaskAlreadyExistsException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -36668,7 +36919,7 @@ func awsRestjson1_deserializeOpErrorTestInvokeAuthorizer(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentTestInvokeAuthorizerOutput(v **TestInvokeAuthorizerOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartAuditMitigationActionsTaskOutput(v **StartAuditMitigationActionsTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -36681,62 +36932,22 @@ func awsRestjson1_deserializeOpDocumentTestInvokeAuthorizerOutput(v **TestInvoke return fmt.Errorf("unexpected JSON type %v", value) } - var sv *TestInvokeAuthorizerOutput + var sv *StartAuditMitigationActionsTaskOutput if *v == nil { - sv = &TestInvokeAuthorizerOutput{} + sv = &StartAuditMitigationActionsTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "disconnectAfterInSeconds": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.DisconnectAfterInSeconds = ptr.Int32(int32(i64)) - } - - case "isAuthenticated": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected IsAuthenticated to be of type *bool, got %T instead", value) - } - sv.IsAuthenticated = ptr.Bool(jtv) - } - - case "policyDocuments": - if err := awsRestjson1_deserializeDocumentPolicyDocuments(&sv.PolicyDocuments, value); err != nil { - return err - } - - case "principalId": + case "taskId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected PrincipalId to be of type string, got %T instead", value) - } - sv.PrincipalId = ptr.String(jtv) - } - - case "refreshAfterInSeconds": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected MitigationActionsTaskId to be of type string, got %T instead", value) } - sv.RefreshAfterInSeconds = ptr.Int32(int32(i64)) + sv.TaskId = ptr.String(jtv) } default: @@ -36748,14 +36959,14 @@ func awsRestjson1_deserializeOpDocumentTestInvokeAuthorizerOutput(v **TestInvoke return nil } -type awsRestjson1_deserializeOpTransferCertificate struct { +type awsRestjson1_deserializeOpStartDetectMitigationActionsTask struct { } -func (*awsRestjson1_deserializeOpTransferCertificate) ID() string { +func (*awsRestjson1_deserializeOpStartDetectMitigationActionsTask) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTransferCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartDetectMitigationActionsTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -36773,9 +36984,9 @@ func (m *awsRestjson1_deserializeOpTransferCertificate) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorTransferCertificate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartDetectMitigationActionsTask(response, &metadata) } - output := &TransferCertificateOutput{} + output := &StartDetectMitigationActionsTaskOutput{} out.Result = output var buff [1024]byte @@ -36796,7 +37007,7 @@ func (m *awsRestjson1_deserializeOpTransferCertificate) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentTransferCertificateOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentStartDetectMitigationActionsTaskOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -36810,7 +37021,7 @@ func (m *awsRestjson1_deserializeOpTransferCertificate) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorTransferCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartDetectMitigationActionsTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -36851,30 +37062,21 @@ func awsRestjson1_deserializeOpErrorTransferCertificate(response *smithyhttp.Res } switch { - case strings.EqualFold("CertificateStateException", errorCode): - return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("TaskAlreadyExistsException", errorCode): + return awsRestjson1_deserializeErrorTaskAlreadyExistsException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("TransferConflictException", errorCode): - return awsRestjson1_deserializeErrorTransferConflictException(response, errorBody) - - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -36885,7 +37087,7 @@ func awsRestjson1_deserializeOpErrorTransferCertificate(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentTransferCertificateOutput(v **TransferCertificateOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentStartDetectMitigationActionsTaskOutput(v **StartDetectMitigationActionsTaskOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -36898,22 +37100,22 @@ func awsRestjson1_deserializeOpDocumentTransferCertificateOutput(v **TransferCer return fmt.Errorf("unexpected JSON type %v", value) } - var sv *TransferCertificateOutput + var sv *StartDetectMitigationActionsTaskOutput if *v == nil { - sv = &TransferCertificateOutput{} + sv = &StartDetectMitigationActionsTaskOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "transferredCertificateArn": + case "taskId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + return fmt.Errorf("expected MitigationActionsTaskId to be of type string, got %T instead", value) } - sv.TransferredCertificateArn = ptr.String(jtv) + sv.TaskId = ptr.String(jtv) } default: @@ -36925,14 +37127,14 @@ func awsRestjson1_deserializeOpDocumentTransferCertificateOutput(v **TransferCer return nil } -type awsRestjson1_deserializeOpUntagResource struct { +type awsRestjson1_deserializeOpStartOnDemandAuditTask struct { } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +func (*awsRestjson1_deserializeOpStartOnDemandAuditTask) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartOnDemandAuditTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -36950,16 +37152,44 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartOnDemandAuditTask(response, &metadata) } - output := &UntagResourceOutput{} + output := &StartOnDemandAuditTaskOutput{} 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_deserializeOpDocumentStartOnDemandAuditTaskOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartOnDemandAuditTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -37006,8 +37236,8 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): + return awsRestjson1_deserializeErrorLimitExceededException(response, errorBody) case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -37022,14 +37252,54 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateAccountAuditConfiguration struct { +func awsRestjson1_deserializeOpDocumentStartOnDemandAuditTaskOutput(v **StartOnDemandAuditTaskOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartOnDemandAuditTaskOutput + if *v == nil { + sv = &StartOnDemandAuditTaskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value) + } + sv.TaskId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateAccountAuditConfiguration) ID() string { +type awsRestjson1_deserializeOpStartThingRegistrationTask struct { +} + +func (*awsRestjson1_deserializeOpStartThingRegistrationTask) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAccountAuditConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStartThingRegistrationTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -37047,16 +37317,44 @@ func (m *awsRestjson1_deserializeOpUpdateAccountAuditConfiguration) HandleDeseri } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAccountAuditConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStartThingRegistrationTask(response, &metadata) } - output := &UpdateAccountAuditConfigurationOutput{} + output := &StartThingRegistrationTaskOutput{} 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_deserializeOpDocumentStartThingRegistrationTaskOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAccountAuditConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStartThingRegistrationTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -37106,6 +37404,9 @@ func awsRestjson1_deserializeOpErrorUpdateAccountAuditConfiguration(response *sm case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -37116,14 +37417,54 @@ func awsRestjson1_deserializeOpErrorUpdateAccountAuditConfiguration(response *sm } } -type awsRestjson1_deserializeOpUpdateAuditSuppression struct { +func awsRestjson1_deserializeOpDocumentStartThingRegistrationTaskOutput(v **StartThingRegistrationTaskOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartThingRegistrationTaskOutput + if *v == nil { + sv = &StartThingRegistrationTaskOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TaskId to be of type string, got %T instead", value) + } + sv.TaskId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateAuditSuppression) ID() string { +type awsRestjson1_deserializeOpStopThingRegistrationTask struct { +} + +func (*awsRestjson1_deserializeOpStopThingRegistrationTask) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAuditSuppression) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpStopThingRegistrationTask) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -37141,16 +37482,16 @@ func (m *awsRestjson1_deserializeOpUpdateAuditSuppression) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAuditSuppression(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorStopThingRegistrationTask(response, &metadata) } - output := &UpdateAuditSuppressionOutput{} + output := &StopThingRegistrationTaskOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAuditSuppression(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorStopThingRegistrationTask(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -37203,6 +37544,9 @@ func awsRestjson1_deserializeOpErrorUpdateAuditSuppression(response *smithyhttp. case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -37213,14 +37557,14 @@ func awsRestjson1_deserializeOpErrorUpdateAuditSuppression(response *smithyhttp. } } -type awsRestjson1_deserializeOpUpdateAuthorizer struct { +type awsRestjson1_deserializeOpTagResource struct { } -func (*awsRestjson1_deserializeOpUpdateAuthorizer) ID() string { +func (*awsRestjson1_deserializeOpTagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +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) @@ -37238,9 +37582,109 @@ func (m *awsRestjson1_deserializeOpUpdateAuthorizer) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateAuthorizer(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorTagResource(response, &metadata) } - output := &UpdateAuthorizerOutput{} + output := &TagResourceOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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 + + } +} + +type awsRestjson1_deserializeOpTestAuthorization struct { +} + +func (*awsRestjson1_deserializeOpTestAuthorization) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTestAuthorization) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorTestAuthorization(response, &metadata) + } + output := &TestAuthorizationOutput{} out.Result = output var buff [1024]byte @@ -37261,7 +37705,7 @@ func (m *awsRestjson1_deserializeOpUpdateAuthorizer) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateAuthorizerOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentTestAuthorizationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -37275,7 +37719,7 @@ func (m *awsRestjson1_deserializeOpUpdateAuthorizer) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorTestAuthorization(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -37347,7 +37791,7 @@ func awsRestjson1_deserializeOpErrorUpdateAuthorizer(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentUpdateAuthorizerOutput(v **UpdateAuthorizerOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentTestAuthorizationOutput(v **TestAuthorizationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -37360,31 +37804,18 @@ func awsRestjson1_deserializeOpDocumentUpdateAuthorizerOutput(v **UpdateAuthoriz return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateAuthorizerOutput + var sv *TestAuthorizationOutput if *v == nil { - sv = &UpdateAuthorizerOutput{} + sv = &TestAuthorizationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "authorizerArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value) - } - sv.AuthorizerArn = ptr.String(jtv) - } - - case "authorizerName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) - } - sv.AuthorizerName = ptr.String(jtv) + case "authResults": + if err := awsRestjson1_deserializeDocumentAuthResults(&sv.AuthResults, value); err != nil { + return err } default: @@ -37396,14 +37827,14 @@ func awsRestjson1_deserializeOpDocumentUpdateAuthorizerOutput(v **UpdateAuthoriz return nil } -type awsRestjson1_deserializeOpUpdateBillingGroup struct { +type awsRestjson1_deserializeOpTestInvokeAuthorizer struct { } -func (*awsRestjson1_deserializeOpUpdateBillingGroup) ID() string { +func (*awsRestjson1_deserializeOpTestInvokeAuthorizer) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpTestInvokeAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -37421,9 +37852,9 @@ func (m *awsRestjson1_deserializeOpUpdateBillingGroup) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateBillingGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorTestInvokeAuthorizer(response, &metadata) } - output := &UpdateBillingGroupOutput{} + output := &TestInvokeAuthorizerOutput{} out.Result = output var buff [1024]byte @@ -37444,7 +37875,7 @@ func (m *awsRestjson1_deserializeOpUpdateBillingGroup) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateBillingGroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentTestInvokeAuthorizerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -37458,7 +37889,7 @@ func (m *awsRestjson1_deserializeOpUpdateBillingGroup) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorTestInvokeAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -37505,14 +37936,20 @@ func awsRestjson1_deserializeOpErrorUpdateBillingGroup(response *smithyhttp.Resp case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidResponseException", errorCode): + return awsRestjson1_deserializeErrorInvalidResponseException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -37524,7 +37961,7 @@ func awsRestjson1_deserializeOpErrorUpdateBillingGroup(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentUpdateBillingGroupOutput(v **UpdateBillingGroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentTestInvokeAuthorizerOutput(v **TestInvokeAuthorizerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -37537,26 +37974,62 @@ func awsRestjson1_deserializeOpDocumentUpdateBillingGroupOutput(v **UpdateBillin return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateBillingGroupOutput + var sv *TestInvokeAuthorizerOutput if *v == nil { - sv = &UpdateBillingGroupOutput{} + sv = &TestInvokeAuthorizerOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "version": + case "disconnectAfterInSeconds": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.Version = i64 + sv.DisconnectAfterInSeconds = ptr.Int32(int32(i64)) + } + + case "isAuthenticated": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected IsAuthenticated to be of type *bool, got %T instead", value) + } + sv.IsAuthenticated = ptr.Bool(jtv) + } + + case "policyDocuments": + if err := awsRestjson1_deserializeDocumentPolicyDocuments(&sv.PolicyDocuments, value); err != nil { + return err + } + + case "principalId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PrincipalId to be of type string, got %T instead", value) + } + sv.PrincipalId = ptr.String(jtv) + } + + case "refreshAfterInSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Seconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RefreshAfterInSeconds = ptr.Int32(int32(i64)) } default: @@ -37568,14 +38041,14 @@ func awsRestjson1_deserializeOpDocumentUpdateBillingGroupOutput(v **UpdateBillin return nil } -type awsRestjson1_deserializeOpUpdateCACertificate struct { +type awsRestjson1_deserializeOpTransferCertificate struct { } -func (*awsRestjson1_deserializeOpUpdateCACertificate) ID() string { +func (*awsRestjson1_deserializeOpTransferCertificate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateCACertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpTransferCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -37593,14 +38066,36 @@ func (m *awsRestjson1_deserializeOpUpdateCACertificate) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateCACertificate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorTransferCertificate(response, &metadata) } - output := &UpdateCACertificateOutput{} + output := &TransferCertificateOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentTransferCertificateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } @@ -37608,7 +38103,7 @@ func (m *awsRestjson1_deserializeOpUpdateCACertificate) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateCACertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorTransferCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -37649,6 +38144,9 @@ func awsRestjson1_deserializeOpErrorUpdateCACertificate(response *smithyhttp.Res } switch { + case strings.EqualFold("CertificateStateException", errorCode): + return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -37664,6 +38162,9 @@ func awsRestjson1_deserializeOpErrorUpdateCACertificate(response *smithyhttp.Res case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("TransferConflictException", errorCode): + return awsRestjson1_deserializeErrorTransferConflictException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) @@ -37677,14 +38178,54 @@ func awsRestjson1_deserializeOpErrorUpdateCACertificate(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpUpdateCertificate struct { +func awsRestjson1_deserializeOpDocumentTransferCertificateOutput(v **TransferCertificateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *TransferCertificateOutput + if *v == nil { + sv = &TransferCertificateOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "transferredCertificateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + } + sv.TransferredCertificateArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateCertificate) ID() string { +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -37702,22 +38243,16 @@ func (m *awsRestjson1_deserializeOpUpdateCertificate) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateCertificate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) } - output := &UpdateCertificateOutput{} + 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), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -37758,9 +38293,6 @@ func awsRestjson1_deserializeOpErrorUpdateCertificate(response *smithyhttp.Respo } switch { - case strings.EqualFold("CertificateStateException", errorCode): - return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -37770,15 +38302,9 @@ func awsRestjson1_deserializeOpErrorUpdateCertificate(response *smithyhttp.Respo case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -37789,14 +38315,14 @@ func awsRestjson1_deserializeOpErrorUpdateCertificate(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpUpdateCertificateProvider struct { +type awsRestjson1_deserializeOpUpdateAccountAuditConfiguration struct { } -func (*awsRestjson1_deserializeOpUpdateCertificateProvider) ID() string { +func (*awsRestjson1_deserializeOpUpdateAccountAuditConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateCertificateProvider) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateAccountAuditConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -37814,44 +38340,16 @@ func (m *awsRestjson1_deserializeOpUpdateCertificateProvider) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateCertificateProvider(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAccountAuditConfiguration(response, &metadata) } - output := &UpdateCertificateProviderOutput{} + output := &UpdateAccountAuditConfigurationOutput{} 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_deserializeOpDocumentUpdateCertificateProviderOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateCertificateProvider(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateAccountAuditConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -37898,18 +38396,9 @@ func awsRestjson1_deserializeOpErrorUpdateCertificateProvider(response *smithyht case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -37920,63 +38409,14 @@ func awsRestjson1_deserializeOpErrorUpdateCertificateProvider(response *smithyht } } -func awsRestjson1_deserializeOpDocumentUpdateCertificateProviderOutput(v **UpdateCertificateProviderOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateCertificateProviderOutput - if *v == nil { - sv = &UpdateCertificateProviderOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "certificateProviderArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateProviderArn to be of type string, got %T instead", value) - } - sv.CertificateProviderArn = ptr.String(jtv) - } - - case "certificateProviderName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateProviderName to be of type string, got %T instead", value) - } - sv.CertificateProviderName = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateCustomMetric struct { +type awsRestjson1_deserializeOpUpdateAuditSuppression struct { } -func (*awsRestjson1_deserializeOpUpdateCustomMetric) ID() string { +func (*awsRestjson1_deserializeOpUpdateAuditSuppression) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateCustomMetric) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateAuditSuppression) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -37994,62 +38434,34 @@ func (m *awsRestjson1_deserializeOpUpdateCustomMetric) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateCustomMetric(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAuditSuppression(response, &metadata) } - output := &UpdateCustomMetricOutput{} + output := &UpdateAuditSuppressionOutput{} out.Result = output + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateAuditSuppression(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) - body := io.TeeReader(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_deserializeOpDocumentUpdateCustomMetricOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateCustomMetric(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer - if _, err := io.Copy(&errorBuffer, response.Body); err != nil { - return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} - } - errorBody := bytes.NewReader(errorBuffer.Bytes()) - - errorCode := "UnknownError" - errorMessage := errorCode - - headerCode := response.Header.Get("X-Amzn-ErrorType") - if len(headerCode) != 0 { - errorCode = restjson.SanitizeErrorCode(headerCode) - } - - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) - - body := io.TeeReader(errorBody, ringBuffer) + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() jsonCode, message, err := restjson.GetErrorInfo(decoder) @@ -38094,113 +38506,14 @@ func awsRestjson1_deserializeOpErrorUpdateCustomMetric(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentUpdateCustomMetricOutput(v **UpdateCustomMetricOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateCustomMetricOutput - if *v == nil { - sv = &UpdateCustomMetricOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "displayName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CustomMetricDisplayName to be of type string, got %T instead", value) - } - sv.DisplayName = ptr.String(jtv) - } - - case "lastModifiedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "metricArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CustomMetricArn to be of type string, got %T instead", value) - } - sv.MetricArn = ptr.String(jtv) - } - - case "metricName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) - } - sv.MetricName = ptr.String(jtv) - } - - case "metricType": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CustomMetricType to be of type string, got %T instead", value) - } - sv.MetricType = types.CustomMetricType(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateDimension struct { +type awsRestjson1_deserializeOpUpdateAuthorizer struct { } -func (*awsRestjson1_deserializeOpUpdateDimension) ID() string { +func (*awsRestjson1_deserializeOpUpdateAuthorizer) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDimension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateAuthorizer) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -38218,9 +38531,9 @@ func (m *awsRestjson1_deserializeOpUpdateDimension) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDimension(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateAuthorizer(response, &metadata) } - output := &UpdateDimensionOutput{} + output := &UpdateAuthorizerOutput{} out.Result = output var buff [1024]byte @@ -38241,7 +38554,7 @@ func (m *awsRestjson1_deserializeOpUpdateDimension) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateDimensionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateAuthorizerOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38255,7 +38568,7 @@ func (m *awsRestjson1_deserializeOpUpdateDimension) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateDimension(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateAuthorizer(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -38302,12 +38615,21 @@ func awsRestjson1_deserializeOpErrorUpdateDimension(response *smithyhttp.Respons case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -38318,7 +38640,7 @@ func awsRestjson1_deserializeOpErrorUpdateDimension(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentUpdateDimensionOutput(v **UpdateDimensionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateAuthorizerOutput(v **UpdateAuthorizerOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -38331,77 +38653,31 @@ func awsRestjson1_deserializeOpDocumentUpdateDimensionOutput(v **UpdateDimension return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateDimensionOutput + var sv *UpdateAuthorizerOutput if *v == nil { - sv = &UpdateDimensionOutput{} + sv = &UpdateAuthorizerOutput{} } 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 DimensionArn to be of type string, got %T instead", value) - } - sv.Arn = ptr.String(jtv) - } - - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "lastModifiedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "name": + case "authorizerArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) - } - - case "stringValues": - if err := awsRestjson1_deserializeDocumentDimensionStringValues(&sv.StringValues, value); err != nil { - return err + sv.AuthorizerArn = ptr.String(jtv) } - case "type": + case "authorizerName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DimensionType to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) } - sv.Type = types.DimensionType(jtv) + sv.AuthorizerName = ptr.String(jtv) } default: @@ -38413,14 +38689,14 @@ func awsRestjson1_deserializeOpDocumentUpdateDimensionOutput(v **UpdateDimension return nil } -type awsRestjson1_deserializeOpUpdateDomainConfiguration struct { +type awsRestjson1_deserializeOpUpdateBillingGroup struct { } -func (*awsRestjson1_deserializeOpUpdateDomainConfiguration) ID() string { +func (*awsRestjson1_deserializeOpUpdateBillingGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDomainConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateBillingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -38438,9 +38714,9 @@ func (m *awsRestjson1_deserializeOpUpdateDomainConfiguration) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateBillingGroup(response, &metadata) } - output := &UpdateDomainConfigurationOutput{} + output := &UpdateBillingGroupOutput{} out.Result = output var buff [1024]byte @@ -38461,7 +38737,7 @@ func (m *awsRestjson1_deserializeOpUpdateDomainConfiguration) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateDomainConfigurationOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateBillingGroupOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -38475,7 +38751,7 @@ func (m *awsRestjson1_deserializeOpUpdateDomainConfiguration) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateBillingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -38516,9 +38792,6 @@ func awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response *smithyht } switch { - case strings.EqualFold("CertificateValidationException", errorCode): - return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -38528,14 +38801,11 @@ func awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response *smithyht case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -38547,7 +38817,7 @@ func awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response *smithyht } } -func awsRestjson1_deserializeOpDocumentUpdateDomainConfigurationOutput(v **UpdateDomainConfigurationOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateBillingGroupOutput(v **UpdateBillingGroupOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -38560,31 +38830,26 @@ func awsRestjson1_deserializeOpDocumentUpdateDomainConfigurationOutput(v **Updat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateDomainConfigurationOutput + var sv *UpdateBillingGroupOutput if *v == nil { - sv = &UpdateDomainConfigurationOutput{} + sv = &UpdateBillingGroupOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "domainConfigurationArn": + case "version": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected DomainConfigurationArn to be of type string, got %T instead", value) + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) } - sv.DomainConfigurationArn = ptr.String(jtv) - } - - case "domainConfigurationName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ReservedDomainConfigurationName to be of type string, got %T instead", value) + i64, err := jtv.Int64() + if err != nil { + return err } - sv.DomainConfigurationName = ptr.String(jtv) + sv.Version = i64 } default: @@ -38596,14 +38861,14 @@ func awsRestjson1_deserializeOpDocumentUpdateDomainConfigurationOutput(v **Updat return nil } -type awsRestjson1_deserializeOpUpdateDynamicThingGroup struct { +type awsRestjson1_deserializeOpUpdateCACertificate struct { } -func (*awsRestjson1_deserializeOpUpdateDynamicThingGroup) ID() string { +func (*awsRestjson1_deserializeOpUpdateCACertificate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateDynamicThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateCACertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -38621,36 +38886,14 @@ func (m *awsRestjson1_deserializeOpUpdateDynamicThingGroup) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateDynamicThingGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCACertificate(response, &metadata) } - output := &UpdateDynamicThingGroupOutput{} + output := &UpdateCACertificateOutput{} 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_deserializeOpDocumentUpdateDynamicThingGroupOutput(&output, shape) - 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 with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } @@ -38658,7 +38901,7 @@ func (m *awsRestjson1_deserializeOpUpdateDynamicThingGroup) HandleDeserialize(ct return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateDynamicThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateCACertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -38702,20 +38945,20 @@ func awsRestjson1_deserializeOpErrorUpdateDynamicThingGroup(response *smithyhttp case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidQueryException", errorCode): - return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -38727,58 +38970,14 @@ func awsRestjson1_deserializeOpErrorUpdateDynamicThingGroup(response *smithyhttp } } -func awsRestjson1_deserializeOpDocumentUpdateDynamicThingGroupOutput(v **UpdateDynamicThingGroupOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateDynamicThingGroupOutput - if *v == nil { - sv = &UpdateDynamicThingGroupOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "version": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Version to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Version = i64 - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateEventConfigurations struct { +type awsRestjson1_deserializeOpUpdateCertificate struct { } -func (*awsRestjson1_deserializeOpUpdateEventConfigurations) ID() string { +func (*awsRestjson1_deserializeOpUpdateCertificate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateEventConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateCertificate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -38796,16 +38995,22 @@ func (m *awsRestjson1_deserializeOpUpdateEventConfigurations) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateEventConfigurations(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCertificate(response, &metadata) } - output := &UpdateEventConfigurationsOutput{} + output := &UpdateCertificateOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateEventConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateCertificate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -38846,15 +39051,27 @@ func awsRestjson1_deserializeOpErrorUpdateEventConfigurations(response *smithyht } switch { + case strings.EqualFold("CertificateStateException", errorCode): + return awsRestjson1_deserializeErrorCertificateStateException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -38865,14 +39082,14 @@ func awsRestjson1_deserializeOpErrorUpdateEventConfigurations(response *smithyht } } -type awsRestjson1_deserializeOpUpdateFleetMetric struct { +type awsRestjson1_deserializeOpUpdateCertificateProvider struct { } -func (*awsRestjson1_deserializeOpUpdateFleetMetric) ID() string { +func (*awsRestjson1_deserializeOpUpdateCertificateProvider) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateFleetMetric) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateCertificateProvider) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -38890,14 +39107,36 @@ func (m *awsRestjson1_deserializeOpUpdateFleetMetric) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateFleetMetric(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCertificateProvider(response, &metadata) } - output := &UpdateFleetMetricOutput{} + output := &UpdateCertificateProviderOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentUpdateCertificateProviderOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } @@ -38905,7 +39144,7 @@ func (m *awsRestjson1_deserializeOpUpdateFleetMetric) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateFleetMetric(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateCertificateProvider(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -38946,18 +39185,9 @@ func awsRestjson1_deserializeOpErrorUpdateFleetMetric(response *smithyhttp.Respo } switch { - case strings.EqualFold("IndexNotReadyException", errorCode): - return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody) - case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidAggregationException", errorCode): - return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody) - - case strings.EqualFold("InvalidQueryException", errorCode): - return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) @@ -38973,9 +39203,6 @@ func awsRestjson1_deserializeOpErrorUpdateFleetMetric(response *smithyhttp.Respo case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -38986,14 +39213,63 @@ func awsRestjson1_deserializeOpErrorUpdateFleetMetric(response *smithyhttp.Respo } } -type awsRestjson1_deserializeOpUpdateIndexingConfiguration struct { +func awsRestjson1_deserializeOpDocumentUpdateCertificateProviderOutput(v **UpdateCertificateProviderOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateCertificateProviderOutput + if *v == nil { + sv = &UpdateCertificateProviderOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "certificateProviderArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateProviderArn to be of type string, got %T instead", value) + } + sv.CertificateProviderArn = ptr.String(jtv) + } + + case "certificateProviderName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateProviderName to be of type string, got %T instead", value) + } + sv.CertificateProviderName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateIndexingConfiguration) ID() string { +type awsRestjson1_deserializeOpUpdateCommand struct { +} + +func (*awsRestjson1_deserializeOpUpdateCommand) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateIndexingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateCommand) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39011,17 +39287,45 @@ func (m *awsRestjson1_deserializeOpUpdateIndexingConfiguration) HandleDeserializ } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateIndexingConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCommand(response, &metadata) } - output := &UpdateIndexingConfigurationOutput{} + output := &UpdateCommandOutput{} out.Result = output - span.End() - return out, metadata, err -} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) -func awsRestjson1_deserializeOpErrorUpdateIndexingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { - var errorBuffer bytes.Buffer + 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_deserializeOpDocumentUpdateCommandOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateCommand(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} } @@ -39061,20 +39365,20 @@ func awsRestjson1_deserializeOpErrorUpdateIndexingConfiguration(response *smithy } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -39086,14 +39390,97 @@ func awsRestjson1_deserializeOpErrorUpdateIndexingConfiguration(response *smithy } } -type awsRestjson1_deserializeOpUpdateJob struct { +func awsRestjson1_deserializeOpDocumentUpdateCommandOutput(v **UpdateCommandOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateCommandOutput + if *v == nil { + sv = &UpdateCommandOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "commandId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandId to be of type string, got %T instead", value) + } + sv.CommandId = ptr.String(jtv) + } + + case "deprecated": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected DeprecationFlag to be of type *bool, got %T instead", value) + } + sv.Deprecated = ptr.Bool(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + + case "lastUpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateJob) ID() string { +type awsRestjson1_deserializeOpUpdateCustomMetric struct { +} + +func (*awsRestjson1_deserializeOpUpdateCustomMetric) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateCustomMetric) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39111,14 +39498,36 @@ func (m *awsRestjson1_deserializeOpUpdateJob) HandleDeserialize(ctx context.Cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateJob(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateCustomMetric(response, &metadata) } - output := &UpdateJobOutput{} + output := &UpdateCustomMetricOutput{} out.Result = output - if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + 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_deserializeOpDocumentUpdateCustomMetricOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to discard response body, %w", err), + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), } } @@ -39126,7 +39535,7 @@ func (m *awsRestjson1_deserializeOpUpdateJob) HandleDeserialize(ctx context.Cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateCustomMetric(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -39167,15 +39576,15 @@ func awsRestjson1_deserializeOpErrorUpdateJob(response *smithyhttp.Response, met } switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -39189,14 +39598,113 @@ func awsRestjson1_deserializeOpErrorUpdateJob(response *smithyhttp.Response, met } } -type awsRestjson1_deserializeOpUpdateMitigationAction struct { +func awsRestjson1_deserializeOpDocumentUpdateCustomMetricOutput(v **UpdateCustomMetricOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateCustomMetricOutput + if *v == nil { + sv = &UpdateCustomMetricOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "displayName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomMetricDisplayName to be of type string, got %T instead", value) + } + sv.DisplayName = ptr.String(jtv) + } + + case "lastModifiedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "metricArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomMetricArn to be of type string, got %T instead", value) + } + sv.MetricArn = ptr.String(jtv) + } + + case "metricName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricName to be of type string, got %T instead", value) + } + sv.MetricName = ptr.String(jtv) + } + + case "metricType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomMetricType to be of type string, got %T instead", value) + } + sv.MetricType = types.CustomMetricType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateMitigationAction) ID() string { +type awsRestjson1_deserializeOpUpdateDimension struct { +} + +func (*awsRestjson1_deserializeOpUpdateDimension) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateMitigationAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateDimension) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39214,9 +39722,9 @@ func (m *awsRestjson1_deserializeOpUpdateMitigationAction) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateMitigationAction(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateDimension(response, &metadata) } - output := &UpdateMitigationActionOutput{} + output := &UpdateDimensionOutput{} out.Result = output var buff [1024]byte @@ -39237,7 +39745,7 @@ func (m *awsRestjson1_deserializeOpUpdateMitigationAction) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateMitigationActionOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateDimensionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -39251,7 +39759,7 @@ func (m *awsRestjson1_deserializeOpUpdateMitigationAction) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateMitigationAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateDimension(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -39314,7 +39822,7 @@ func awsRestjson1_deserializeOpErrorUpdateMitigationAction(response *smithyhttp. } } -func awsRestjson1_deserializeOpDocumentUpdateMitigationActionOutput(v **UpdateMitigationActionOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateDimensionOutput(v **UpdateDimensionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -39327,31 +39835,77 @@ func awsRestjson1_deserializeOpDocumentUpdateMitigationActionOutput(v **UpdateMi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateMitigationActionOutput + var sv *UpdateDimensionOutput if *v == nil { - sv = &UpdateMitigationActionOutput{} + sv = &UpdateDimensionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "actionArn": + case "arn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MitigationActionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected DimensionArn to be of type string, got %T instead", value) } - sv.ActionArn = ptr.String(jtv) + sv.Arn = ptr.String(jtv) } - case "actionId": + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "lastModifiedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = 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 MitigationActionId to be of type string, got %T instead", value) + return fmt.Errorf("expected DimensionName to be of type string, got %T instead", value) } - sv.ActionId = ptr.String(jtv) + sv.Name = ptr.String(jtv) + } + + case "stringValues": + if err := awsRestjson1_deserializeDocumentDimensionStringValues(&sv.StringValues, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DimensionType to be of type string, got %T instead", value) + } + sv.Type = types.DimensionType(jtv) } default: @@ -39363,14 +39917,14 @@ func awsRestjson1_deserializeOpDocumentUpdateMitigationActionOutput(v **UpdateMi return nil } -type awsRestjson1_deserializeOpUpdatePackage struct { +type awsRestjson1_deserializeOpUpdateDomainConfiguration struct { } -func (*awsRestjson1_deserializeOpUpdatePackage) ID() string { +func (*awsRestjson1_deserializeOpUpdateDomainConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateDomainConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39388,16 +39942,44 @@ func (m *awsRestjson1_deserializeOpUpdatePackage) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePackage(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response, &metadata) } - output := &UpdatePackageOutput{} + output := &UpdateDomainConfigurationOutput{} 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_deserializeOpDocumentUpdateDomainConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateDomainConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -39438,20 +40020,26 @@ func awsRestjson1_deserializeOpErrorUpdatePackage(response *smithyhttp.Response, } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("CertificateValidationException", errorCode): + return awsRestjson1_deserializeErrorCertificateValidationException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("ValidationException", errorCode): - return awsRestjson1_deserializeErrorValidationException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -39463,14 +40051,63 @@ func awsRestjson1_deserializeOpErrorUpdatePackage(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdatePackageConfiguration struct { +func awsRestjson1_deserializeOpDocumentUpdateDomainConfigurationOutput(v **UpdateDomainConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateDomainConfigurationOutput + if *v == nil { + sv = &UpdateDomainConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "domainConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DomainConfigurationArn to be of type string, got %T instead", value) + } + sv.DomainConfigurationArn = ptr.String(jtv) + } + + case "domainConfigurationName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ReservedDomainConfigurationName to be of type string, got %T instead", value) + } + sv.DomainConfigurationName = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdatePackageConfiguration) ID() string { +type awsRestjson1_deserializeOpUpdateDynamicThingGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateDynamicThingGroup) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdatePackageConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateDynamicThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39488,16 +40125,44 @@ func (m *awsRestjson1_deserializeOpUpdatePackageConfiguration) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePackageConfiguration(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateDynamicThingGroup(response, &metadata) } - output := &UpdatePackageConfigurationOutput{} + output := &UpdateDynamicThingGroupOutput{} 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_deserializeOpDocumentUpdateDynamicThingGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdatePackageConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateDynamicThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -39538,17 +40203,23 @@ func awsRestjson1_deserializeOpErrorUpdatePackageConfiguration(response *smithyh } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("InvalidQueryException", errorCode): + return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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) + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -39560,14 +40231,58 @@ func awsRestjson1_deserializeOpErrorUpdatePackageConfiguration(response *smithyh } } -type awsRestjson1_deserializeOpUpdatePackageVersion struct { -} - -func (*awsRestjson1_deserializeOpUpdatePackageVersion) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdatePackageVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func awsRestjson1_deserializeOpDocumentUpdateDynamicThingGroupOutput(v **UpdateDynamicThingGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateDynamicThingGroupOutput + if *v == nil { + sv = &UpdateDynamicThingGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "version": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Version = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateEventConfigurations struct { +} + +func (*awsRestjson1_deserializeOpUpdateEventConfigurations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateEventConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39585,16 +40300,16 @@ func (m *awsRestjson1_deserializeOpUpdatePackageVersion) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdatePackageVersion(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateEventConfigurations(response, &metadata) } - output := &UpdatePackageVersionOutput{} + output := &UpdateEventConfigurationsOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdatePackageVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateEventConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -39635,21 +40350,15 @@ func awsRestjson1_deserializeOpErrorUpdatePackageVersion(response *smithyhttp.Re } switch { - case strings.EqualFold("ConflictException", errorCode): - return awsRestjson1_deserializeErrorConflictException(response, errorBody) - - case strings.EqualFold("InternalServerException", errorCode): - return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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, @@ -39660,14 +40369,14 @@ func awsRestjson1_deserializeOpErrorUpdatePackageVersion(response *smithyhttp.Re } } -type awsRestjson1_deserializeOpUpdateProvisioningTemplate struct { +type awsRestjson1_deserializeOpUpdateFleetMetric struct { } -func (*awsRestjson1_deserializeOpUpdateProvisioningTemplate) ID() string { +func (*awsRestjson1_deserializeOpUpdateFleetMetric) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateProvisioningTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateFleetMetric) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39685,16 +40394,22 @@ func (m *awsRestjson1_deserializeOpUpdateProvisioningTemplate) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateProvisioningTemplate(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateFleetMetric(response, &metadata) } - output := &UpdateProvisioningTemplateOutput{} + output := &UpdateFleetMetricOutput{} out.Result = output + if _, err = io.Copy(ioutil.Discard, response.Body); err != nil { + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to discard response body, %w", err), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateProvisioningTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateFleetMetric(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -39735,21 +40450,36 @@ func awsRestjson1_deserializeOpErrorUpdateProvisioningTemplate(response *smithyh } switch { - case strings.EqualFold("ConflictingResourceUpdateException", errorCode): - return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + case strings.EqualFold("IndexNotReadyException", errorCode): + return awsRestjson1_deserializeErrorIndexNotReadyException(response, errorBody) case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("InvalidAggregationException", errorCode): + return awsRestjson1_deserializeErrorInvalidAggregationException(response, errorBody) + + case strings.EqualFold("InvalidQueryException", errorCode): + return awsRestjson1_deserializeErrorInvalidQueryException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -39760,14 +40490,14 @@ func awsRestjson1_deserializeOpErrorUpdateProvisioningTemplate(response *smithyh } } -type awsRestjson1_deserializeOpUpdateRoleAlias struct { +type awsRestjson1_deserializeOpUpdateIndexingConfiguration struct { } -func (*awsRestjson1_deserializeOpUpdateRoleAlias) ID() string { +func (*awsRestjson1_deserializeOpUpdateIndexingConfiguration) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateRoleAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateIndexingConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39785,44 +40515,16 @@ func (m *awsRestjson1_deserializeOpUpdateRoleAlias) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoleAlias(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateIndexingConfiguration(response, &metadata) } - output := &UpdateRoleAliasOutput{} + output := &UpdateIndexingConfigurationOutput{} 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_deserializeOpDocumentUpdateRoleAliasOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateRoleAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateIndexingConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -39869,9 +40571,6 @@ func awsRestjson1_deserializeOpErrorUpdateRoleAlias(response *smithyhttp.Respons case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) @@ -39891,63 +40590,14 @@ func awsRestjson1_deserializeOpErrorUpdateRoleAlias(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentUpdateRoleAliasOutput(v **UpdateRoleAliasOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateRoleAliasOutput - if *v == nil { - sv = &UpdateRoleAliasOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "roleAlias": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RoleAlias to be of type string, got %T instead", value) - } - sv.RoleAlias = ptr.String(jtv) - } - - case "roleAliasArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected RoleAliasArn to be of type string, got %T instead", value) - } - sv.RoleAliasArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateScheduledAudit struct { +type awsRestjson1_deserializeOpUpdateJob struct { } -func (*awsRestjson1_deserializeOpUpdateScheduledAudit) ID() string { +func (*awsRestjson1_deserializeOpUpdateJob) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateScheduledAudit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateJob) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -39965,36 +40615,14 @@ func (m *awsRestjson1_deserializeOpUpdateScheduledAudit) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateScheduledAudit(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateJob(response, &metadata) } - output := &UpdateScheduledAuditOutput{} + output := &UpdateJobOutput{} 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_deserializeOpDocumentUpdateScheduledAuditOutput(&output, shape) - 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 with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), + Err: fmt.Errorf("failed to discard response body, %w", err), } } @@ -40002,7 +40630,7 @@ func (m *awsRestjson1_deserializeOpUpdateScheduledAudit) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateScheduledAudit(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateJob(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -40043,15 +40671,15 @@ func awsRestjson1_deserializeOpErrorUpdateScheduledAudit(response *smithyhttp.Re } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) @@ -40065,54 +40693,14 @@ func awsRestjson1_deserializeOpErrorUpdateScheduledAudit(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentUpdateScheduledAuditOutput(v **UpdateScheduledAuditOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateScheduledAuditOutput - if *v == nil { - sv = &UpdateScheduledAuditOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "scheduledAuditArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ScheduledAuditArn to be of type string, got %T instead", value) - } - sv.ScheduledAuditArn = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateSecurityProfile struct { +type awsRestjson1_deserializeOpUpdateMitigationAction struct { } -func (*awsRestjson1_deserializeOpUpdateSecurityProfile) ID() string { +func (*awsRestjson1_deserializeOpUpdateMitigationAction) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateMitigationAction) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -40130,9 +40718,9 @@ func (m *awsRestjson1_deserializeOpUpdateSecurityProfile) HandleDeserialize(ctx } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateSecurityProfile(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateMitigationAction(response, &metadata) } - output := &UpdateSecurityProfileOutput{} + output := &UpdateMitigationActionOutput{} out.Result = output var buff [1024]byte @@ -40153,7 +40741,7 @@ func (m *awsRestjson1_deserializeOpUpdateSecurityProfile) HandleDeserialize(ctx return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateSecurityProfileOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateMitigationActionOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -40167,7 +40755,7 @@ func (m *awsRestjson1_deserializeOpUpdateSecurityProfile) HandleDeserialize(ctx return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateMitigationAction(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -40220,9 +40808,6 @@ func awsRestjson1_deserializeOpErrorUpdateSecurityProfile(response *smithyhttp.R case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) - default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -40233,7 +40818,7 @@ func awsRestjson1_deserializeOpErrorUpdateSecurityProfile(response *smithyhttp.R } } -func awsRestjson1_deserializeOpDocumentUpdateSecurityProfileOutput(v **UpdateSecurityProfileOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateMitigationActionOutput(v **UpdateMitigationActionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -40246,110 +40831,31 @@ func awsRestjson1_deserializeOpDocumentUpdateSecurityProfileOutput(v **UpdateSec return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateSecurityProfileOutput + var sv *UpdateMitigationActionOutput if *v == nil { - sv = &UpdateSecurityProfileOutput{} + sv = &UpdateMitigationActionOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "additionalMetricsToRetain": - if err := awsRestjson1_deserializeDocumentAdditionalMetricsToRetainList(&sv.AdditionalMetricsToRetain, value); err != nil { - return err - } - - case "additionalMetricsToRetainV2": - if err := awsRestjson1_deserializeDocumentAdditionalMetricsToRetainV2List(&sv.AdditionalMetricsToRetainV2, value); err != nil { - return err - } - - case "alertTargets": - if err := awsRestjson1_deserializeDocumentAlertTargets(&sv.AlertTargets, value); err != nil { - return err - } - - case "behaviors": - if err := awsRestjson1_deserializeDocumentBehaviors(&sv.Behaviors, value); err != nil { - return err - } - - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "lastModifiedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "metricsExportConfig": - if err := awsRestjson1_deserializeDocumentMetricsExportConfig(&sv.MetricsExportConfig, value); err != nil { - return err - } - - case "securityProfileArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected SecurityProfileArn to be of type string, got %T instead", value) - } - sv.SecurityProfileArn = ptr.String(jtv) - } - - case "securityProfileDescription": + case "actionArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SecurityProfileDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected MitigationActionArn to be of type string, got %T instead", value) } - sv.SecurityProfileDescription = ptr.String(jtv) + sv.ActionArn = ptr.String(jtv) } - case "securityProfileName": + case "actionId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value) - } - sv.SecurityProfileName = ptr.String(jtv) - } - - case "version": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Version to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected MitigationActionId to be of type string, got %T instead", value) } - sv.Version = i64 + sv.ActionId = ptr.String(jtv) } default: @@ -40361,14 +40867,14 @@ func awsRestjson1_deserializeOpDocumentUpdateSecurityProfileOutput(v **UpdateSec return nil } -type awsRestjson1_deserializeOpUpdateStream struct { +type awsRestjson1_deserializeOpUpdatePackage struct { } -func (*awsRestjson1_deserializeOpUpdateStream) ID() string { +func (*awsRestjson1_deserializeOpUpdatePackage) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdatePackage) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -40386,44 +40892,16 @@ func (m *awsRestjson1_deserializeOpUpdateStream) HandleDeserialize(ctx context.C } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateStream(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePackage(response, &metadata) } - output := &UpdateStreamOutput{} + output := &UpdatePackageOutput{} 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_deserializeOpDocumentUpdateStreamOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdatePackage(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -40464,26 +40942,20 @@ func awsRestjson1_deserializeOpErrorUpdateStream(response *smithyhttp.Response, } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("LimitExceededException", errorCode): - return awsRestjson1_deserializeErrorLimitExceededException(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("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -40495,112 +40967,41 @@ func awsRestjson1_deserializeOpErrorUpdateStream(response *smithyhttp.Response, } } -func awsRestjson1_deserializeOpDocumentUpdateStreamOutput(v **UpdateStreamOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil +type awsRestjson1_deserializeOpUpdatePackageConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdatePackageConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdatePackageConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err } - shape, ok := value.(map[string]interface{}) + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) if !ok { - return fmt.Errorf("unexpected JSON type %v", value) + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} } - var sv *UpdateStreamOutput - if *v == nil { - sv = &UpdateStreamOutput{} - } else { - sv = *v + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePackageConfiguration(response, &metadata) } + output := &UpdatePackageConfigurationOutput{} + out.Result = output - for key, value := range shape { - switch key { - case "description": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StreamDescription to be of type string, got %T instead", value) - } - sv.Description = ptr.String(jtv) - } + span.End() + return out, metadata, err +} - case "streamArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value) - } - sv.StreamArn = ptr.String(jtv) - } - - case "streamId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected StreamId to be of type string, got %T instead", value) - } - sv.StreamId = ptr.String(jtv) - } - - case "streamVersion": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected StreamVersion to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.StreamVersion = ptr.Int32(int32(i64)) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateThing struct { -} - -func (*awsRestjson1_deserializeOpUpdateThing) ID() string { - return "OperationDeserializer" -} - -func (m *awsRestjson1_deserializeOpUpdateThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( - out middleware.DeserializeOutput, metadata middleware.Metadata, err error, -) { - out, metadata, err = next.HandleDeserialize(ctx, in) - if err != nil { - return out, metadata, err - } - - _, span := tracing.StartSpan(ctx, "OperationDeserializer") - endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") - defer endTimer() - defer span.End() - response, ok := out.RawResponse.(*smithyhttp.Response) - if !ok { - 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_deserializeOpErrorUpdateThing(response, &metadata) - } - output := &UpdateThingOutput{} - out.Result = output - - span.End() - return out, metadata, err -} - -func awsRestjson1_deserializeOpErrorUpdateThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdatePackageConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -40641,26 +41042,17 @@ func awsRestjson1_deserializeOpErrorUpdateThing(response *smithyhttp.Response, m } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) - - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(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("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) - - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -40672,14 +41064,14 @@ func awsRestjson1_deserializeOpErrorUpdateThing(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUpdateThingGroup struct { +type awsRestjson1_deserializeOpUpdatePackageVersion struct { } -func (*awsRestjson1_deserializeOpUpdateThingGroup) ID() string { +func (*awsRestjson1_deserializeOpUpdatePackageVersion) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdatePackageVersion) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -40697,44 +41089,16 @@ func (m *awsRestjson1_deserializeOpUpdateThingGroup) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateThingGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdatePackageVersion(response, &metadata) } - output := &UpdateThingGroupOutput{} + output := &UpdatePackageVersionOutput{} 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_deserializeOpDocumentUpdateThingGroupOutput(&output, shape) - if err != nil { - var snapshot bytes.Buffer - io.Copy(&snapshot, ringBuffer) - return out, metadata, &smithy.DeserializationError{ - Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), - Snapshot: snapshot.Bytes(), - } - } - span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdatePackageVersion(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -40775,11 +41139,11 @@ func awsRestjson1_deserializeOpErrorUpdateThingGroup(response *smithyhttp.Respon } switch { - case strings.EqualFold("InternalFailureException", errorCode): - return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) @@ -40787,8 +41151,8 @@ func awsRestjson1_deserializeOpErrorUpdateThingGroup(response *smithyhttp.Respon case strings.EqualFold("ThrottlingException", errorCode): return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) - case strings.EqualFold("VersionConflictException", errorCode): - return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -40800,58 +41164,14 @@ func awsRestjson1_deserializeOpErrorUpdateThingGroup(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentUpdateThingGroupOutput(v **UpdateThingGroupOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *UpdateThingGroupOutput - if *v == nil { - sv = &UpdateThingGroupOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "version": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected Version to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.Version = i64 - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -type awsRestjson1_deserializeOpUpdateThingGroupsForThing struct { +type awsRestjson1_deserializeOpUpdateProvisioningTemplate struct { } -func (*awsRestjson1_deserializeOpUpdateThingGroupsForThing) ID() string { +func (*awsRestjson1_deserializeOpUpdateProvisioningTemplate) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateThingGroupsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateProvisioningTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -40869,16 +41189,16 @@ func (m *awsRestjson1_deserializeOpUpdateThingGroupsForThing) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateProvisioningTemplate(response, &metadata) } - output := &UpdateThingGroupsForThingOutput{} + output := &UpdateProvisioningTemplateOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateProvisioningTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -40919,6 +41239,9 @@ func awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response *smithyht } switch { + case strings.EqualFold("ConflictingResourceUpdateException", errorCode): + return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) @@ -40928,8 +41251,8 @@ func awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response *smithyht case strings.EqualFold("ResourceNotFoundException", errorCode): return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottlingException", errorCode): - return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -40941,14 +41264,14 @@ func awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response *smithyht } } -type awsRestjson1_deserializeOpUpdateThingType struct { +type awsRestjson1_deserializeOpUpdateRoleAlias struct { } -func (*awsRestjson1_deserializeOpUpdateThingType) ID() string { +func (*awsRestjson1_deserializeOpUpdateRoleAlias) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateRoleAlias) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -40966,16 +41289,44 @@ func (m *awsRestjson1_deserializeOpUpdateThingType) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateThingType(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateRoleAlias(response, &metadata) } - output := &UpdateThingTypeOutput{} + output := &UpdateRoleAliasOutput{} 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_deserializeOpDocumentUpdateRoleAliasOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateRoleAlias(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -41044,14 +41395,63 @@ func awsRestjson1_deserializeOpErrorUpdateThingType(response *smithyhttp.Respons } } -type awsRestjson1_deserializeOpUpdateTopicRuleDestination struct { +func awsRestjson1_deserializeOpDocumentUpdateRoleAliasOutput(v **UpdateRoleAliasOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateRoleAliasOutput + if *v == nil { + sv = &UpdateRoleAliasOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "roleAlias": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleAlias to be of type string, got %T instead", value) + } + sv.RoleAlias = ptr.String(jtv) + } + + case "roleAliasArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RoleAliasArn to be of type string, got %T instead", value) + } + sv.RoleAliasArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateTopicRuleDestination) ID() string { +type awsRestjson1_deserializeOpUpdateScheduledAudit struct { +} + +func (*awsRestjson1_deserializeOpUpdateScheduledAudit) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateScheduledAudit) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -41069,16 +41469,44 @@ func (m *awsRestjson1_deserializeOpUpdateTopicRuleDestination) HandleDeserialize } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateTopicRuleDestination(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateScheduledAudit(response, &metadata) } - output := &UpdateTopicRuleDestinationOutput{} + output := &UpdateScheduledAuditOutput{} 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_deserializeOpDocumentUpdateScheduledAuditOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateScheduledAudit(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -41119,20 +41547,17 @@ func awsRestjson1_deserializeOpErrorUpdateTopicRuleDestination(response *smithyh } switch { - case strings.EqualFold("ConflictingResourceUpdateException", errorCode): - return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) - - case strings.EqualFold("InternalException", errorCode): - return awsRestjson1_deserializeErrorInternalException(response, errorBody) + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ServiceUnavailableException", errorCode): - return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("UnauthorizedException", errorCode): - return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -41144,14 +41569,54 @@ func awsRestjson1_deserializeOpErrorUpdateTopicRuleDestination(response *smithyh } } -type awsRestjson1_deserializeOpValidateSecurityProfileBehaviors struct { +func awsRestjson1_deserializeOpDocumentUpdateScheduledAuditOutput(v **UpdateScheduledAuditOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateScheduledAuditOutput + if *v == nil { + sv = &UpdateScheduledAuditOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "scheduledAuditArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ScheduledAuditArn to be of type string, got %T instead", value) + } + sv.ScheduledAuditArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) ID() string { +type awsRestjson1_deserializeOpUpdateSecurityProfile struct { +} + +func (*awsRestjson1_deserializeOpUpdateSecurityProfile) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateSecurityProfile) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -41169,9 +41634,9 @@ func (m *awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) HandleDeser } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorValidateSecurityProfileBehaviors(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateSecurityProfile(response, &metadata) } - output := &ValidateSecurityProfileBehaviorsOutput{} + output := &UpdateSecurityProfileOutput{} out.Result = output var buff [1024]byte @@ -41192,7 +41657,7 @@ func (m *awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) HandleDeser return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentValidateSecurityProfileBehaviorsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateSecurityProfileOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -41206,7 +41671,7 @@ func (m *awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) HandleDeser return out, metadata, err } -func awsRestjson1_deserializeOpErrorValidateSecurityProfileBehaviors(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateSecurityProfile(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -41253,9 +41718,15 @@ func awsRestjson1_deserializeOpErrorValidateSecurityProfileBehaviors(response *s case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(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("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -41266,7 +41737,7 @@ func awsRestjson1_deserializeOpErrorValidateSecurityProfileBehaviors(response *s } } -func awsRestjson1_deserializeOpDocumentValidateSecurityProfileBehaviorsOutput(v **ValidateSecurityProfileBehaviorsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateSecurityProfileOutput(v **UpdateSecurityProfileOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -41279,82 +41750,1115 @@ func awsRestjson1_deserializeOpDocumentValidateSecurityProfileBehaviorsOutput(v return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ValidateSecurityProfileBehaviorsOutput + var sv *UpdateSecurityProfileOutput if *v == nil { - sv = &ValidateSecurityProfileBehaviorsOutput{} + sv = &UpdateSecurityProfileOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "valid": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected Valid to be of type *bool, got %T instead", value) - } - sv.Valid = jtv + case "additionalMetricsToRetain": + if err := awsRestjson1_deserializeDocumentAdditionalMetricsToRetainList(&sv.AdditionalMetricsToRetain, value); err != nil { + return err } - case "validationErrors": - if err := awsRestjson1_deserializeDocumentValidationErrors(&sv.ValidationErrors, value); err != nil { + case "additionalMetricsToRetainV2": + if err := awsRestjson1_deserializeDocumentAdditionalMetricsToRetainV2List(&sv.AdditionalMetricsToRetainV2, value); err != nil { return err } - default: - _, _ = key, value + case "alertTargets": + if err := awsRestjson1_deserializeDocumentAlertTargets(&sv.AlertTargets, value); err != nil { + return err + } - } - } - *v = sv - return nil -} + case "behaviors": + if err := awsRestjson1_deserializeDocumentBehaviors(&sv.Behaviors, value); err != nil { + return err + } -func awsRestjson1_deserializeErrorCertificateConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.CertificateConflictException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - 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 - } + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - err := awsRestjson1_deserializeDocumentCertificateConflictException(&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 - } + case "lastModifiedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - errorBody.Seek(0, io.SeekStart) + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - return output -} + } + } -func awsRestjson1_deserializeErrorCertificateStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - output := &types.CertificateStateException{} - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) + case "metricsExportConfig": + if err := awsRestjson1_deserializeDocumentMetricsExportConfig(&sv.MetricsExportConfig, value); err != nil { + return err + } - body := io.TeeReader(errorBody, ringBuffer) - decoder := json.NewDecoder(body) - decoder.UseNumber() + case "securityProfileArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecurityProfileArn to be of type string, got %T instead", value) + } + sv.SecurityProfileArn = ptr.String(jtv) + } + + case "securityProfileDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecurityProfileDescription to be of type string, got %T instead", value) + } + sv.SecurityProfileDescription = ptr.String(jtv) + } + + case "securityProfileName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value) + } + sv.SecurityProfileName = ptr.String(jtv) + } + + case "version": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Version = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateStream struct { +} + +func (*awsRestjson1_deserializeOpUpdateStream) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateStream) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateStream(response, &metadata) + } + output := &UpdateStreamOutput{} + 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_deserializeOpDocumentUpdateStreamOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateStream(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateStreamOutput(v **UpdateStreamOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateStreamOutput + if *v == nil { + sv = &UpdateStreamOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StreamDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "streamArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StreamArn to be of type string, got %T instead", value) + } + sv.StreamArn = ptr.String(jtv) + } + + case "streamId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StreamId to be of type string, got %T instead", value) + } + sv.StreamId = ptr.String(jtv) + } + + case "streamVersion": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected StreamVersion to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.StreamVersion = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateThing struct { +} + +func (*awsRestjson1_deserializeOpUpdateThing) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateThing(response, &metadata) + } + output := &UpdateThingOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + case strings.EqualFold("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateThingGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateThingGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateThingGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateThingGroup(response, &metadata) + } + output := &UpdateThingGroupOutput{} + 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_deserializeOpDocumentUpdateThingGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateThingGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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("VersionConflictException", errorCode): + return awsRestjson1_deserializeErrorVersionConflictException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateThingGroupOutput(v **UpdateThingGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateThingGroupOutput + if *v == nil { + sv = &UpdateThingGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "version": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Version to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Version = i64 + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateThingGroupsForThing struct { +} + +func (*awsRestjson1_deserializeOpUpdateThingGroupsForThing) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateThingGroupsForThing) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateThingGroupsForThing(response, &metadata) + } + output := &UpdateThingGroupsForThingOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateThingGroupsForThing(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(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 + + } +} + +type awsRestjson1_deserializeOpUpdateThingType struct { +} + +func (*awsRestjson1_deserializeOpUpdateThingType) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateThingType) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateThingType(response, &metadata) + } + output := &UpdateThingTypeOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateThingType(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateTopicRuleDestination struct { +} + +func (*awsRestjson1_deserializeOpUpdateTopicRuleDestination) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateTopicRuleDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateTopicRuleDestination(response, &metadata) + } + output := &UpdateTopicRuleDestinationOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateTopicRuleDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("ConflictingResourceUpdateException", errorCode): + return awsRestjson1_deserializeErrorConflictingResourceUpdateException(response, errorBody) + + case strings.EqualFold("InternalException", errorCode): + return awsRestjson1_deserializeErrorInternalException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ServiceUnavailableException", errorCode): + return awsRestjson1_deserializeErrorServiceUnavailableException(response, errorBody) + + case strings.EqualFold("UnauthorizedException", errorCode): + return awsRestjson1_deserializeErrorUnauthorizedException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpValidateSecurityProfileBehaviors struct { +} + +func (*awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpValidateSecurityProfileBehaviors) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorValidateSecurityProfileBehaviors(response, &metadata) + } + output := &ValidateSecurityProfileBehaviorsOutput{} + 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_deserializeOpDocumentValidateSecurityProfileBehaviorsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorValidateSecurityProfileBehaviors(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InternalFailureException", errorCode): + return awsRestjson1_deserializeErrorInternalFailureException(response, errorBody) + + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentValidateSecurityProfileBehaviorsOutput(v **ValidateSecurityProfileBehaviorsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ValidateSecurityProfileBehaviorsOutput + if *v == nil { + sv = &ValidateSecurityProfileBehaviorsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "valid": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Valid to be of type *bool, got %T instead", value) + } + sv.Valid = jtv + } + + case "validationErrors": + if err := awsRestjson1_deserializeDocumentValidationErrors(&sv.ValidationErrors, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeErrorCertificateConflictException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CertificateConflictException{} + 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_deserializeDocumentCertificateConflictException(&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_deserializeErrorCertificateStateException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.CertificateStateException{} + 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 @@ -44334,22 +45838,405 @@ func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadata(v **type } } - case "taskId": + case "taskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MitigationActionsTaskId to be of type string, got %T instead", value) + } + sv.TaskId = ptr.String(jtv) + } + + case "taskStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuditMitigationActionsTaskStatus to be of type string, got %T instead", value) + } + sv.TaskStatus = types.AuditMitigationActionsTaskStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadataList(v *[]types.AuditMitigationActionsTaskMetadata, 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.AuditMitigationActionsTaskMetadata + if *v == nil { + cv = []types.AuditMitigationActionsTaskMetadata{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AuditMitigationActionsTaskMetadata + destAddr := &col + if err := awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadata(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskStatistics(v *map[string]types.TaskStatisticsForAuditCheck, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]types.TaskStatisticsForAuditCheck + if *v == nil { + mv = map[string]types.TaskStatisticsForAuditCheck{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.TaskStatisticsForAuditCheck + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentTaskStatisticsForAuditCheck(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskTarget(v **types.AuditMitigationActionsTaskTarget, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AuditMitigationActionsTaskTarget + if *v == nil { + sv = &types.AuditMitigationActionsTaskTarget{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "auditCheckToReasonCodeFilter": + if err := awsRestjson1_deserializeDocumentAuditCheckToReasonCodeFilter(&sv.AuditCheckToReasonCodeFilter, value); err != nil { + return err + } + + case "auditTaskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value) + } + sv.AuditTaskId = ptr.String(jtv) + } + + case "findingIds": + if err := awsRestjson1_deserializeDocumentFindingIds(&sv.FindingIds, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuditNotificationTarget(v **types.AuditNotificationTarget, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AuditNotificationTarget + if *v == nil { + sv = &types.AuditNotificationTarget{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "enabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) + } + sv.Enabled = jtv + } + + 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 "targetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value) + } + sv.TargetArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuditNotificationTargetConfigurations(v *map[string]types.AuditNotificationTarget, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]types.AuditNotificationTarget + if *v == nil { + mv = map[string]types.AuditNotificationTarget{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.AuditNotificationTarget + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentAuditNotificationTarget(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentAuditSuppression(v **types.AuditSuppression, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AuditSuppression + if *v == nil { + sv = &types.AuditSuppression{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "checkName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuditCheckName to be of type string, got %T instead", value) + } + sv.CheckName = ptr.String(jtv) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuditDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "expirationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "resourceIdentifier": + if err := awsRestjson1_deserializeDocumentResourceIdentifier(&sv.ResourceIdentifier, value); err != nil { + return err + } + + case "suppressIndefinitely": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected SuppressIndefinitely to be of type *bool, got %T instead", value) + } + sv.SuppressIndefinitely = ptr.Bool(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAuditSuppressionList(v *[]types.AuditSuppression, 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.AuditSuppression + if *v == nil { + cv = []types.AuditSuppression{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.AuditSuppression + destAddr := &col + if err := awsRestjson1_deserializeDocumentAuditSuppression(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentAuditTaskMetadata(v **types.AuditTaskMetadata, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AuditTaskMetadata + if *v == nil { + sv = &types.AuditTaskMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "taskId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value) + } + sv.TaskId = ptr.String(jtv) + } + + case "taskStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected MitigationActionsTaskId to be of type string, got %T instead", value) + return fmt.Errorf("expected AuditTaskStatus to be of type string, got %T instead", value) } - sv.TaskId = ptr.String(jtv) + sv.TaskStatus = types.AuditTaskStatus(jtv) } - case "taskStatus": + case "taskType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuditMitigationActionsTaskStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected AuditTaskType to be of type string, got %T instead", value) } - sv.TaskStatus = types.AuditMitigationActionsTaskStatus(jtv) + sv.TaskType = types.AuditTaskType(jtv) } default: @@ -44361,7 +46248,7 @@ func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadata(v **type return nil } -func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadataList(v *[]types.AuditMitigationActionsTaskMetadata, value interface{}) error { +func awsRestjson1_deserializeDocumentAuditTaskMetadataList(v *[]types.AuditTaskMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44374,17 +46261,17 @@ func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadataList(v *[ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AuditMitigationActionsTaskMetadata + var cv []types.AuditTaskMetadata if *v == nil { - cv = []types.AuditMitigationActionsTaskMetadata{} + cv = []types.AuditTaskMetadata{} } else { cv = *v } for _, value := range shape { - var col types.AuditMitigationActionsTaskMetadata + var col types.AuditTaskMetadata destAddr := &col - if err := awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadata(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAuditTaskMetadata(&destAddr, value); err != nil { return err } col = *destAddr @@ -44395,7 +46282,7 @@ func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskMetadataList(v *[ return nil } -func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskStatistics(v *map[string]types.TaskStatisticsForAuditCheck, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthInfo(v **types.AuthInfo, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44408,29 +46295,39 @@ func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskStatistics(v *map return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.TaskStatisticsForAuditCheck + var sv *types.AuthInfo if *v == nil { - mv = map[string]types.TaskStatisticsForAuditCheck{} + sv = &types.AuthInfo{} } else { - mv = *v + sv = *v } for key, value := range shape { - var parsedVal types.TaskStatisticsForAuditCheck - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentTaskStatisticsForAuditCheck(&destAddr, value); err != nil { - return err - } - parsedVal = *destAddr - mv[key] = parsedVal + switch key { + case "actionType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ActionType to be of type string, got %T instead", value) + } + sv.ActionType = types.ActionType(jtv) + } + + case "resources": + if err := awsRestjson1_deserializeDocumentResources(&sv.Resources, value); err != nil { + return err + } + default: + _, _ = key, value + + } } - *v = mv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskTarget(v **types.AuditMitigationActionsTaskTarget, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthorizerConfig(v **types.AuthorizerConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44443,32 +46340,31 @@ func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskTarget(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuditMitigationActionsTaskTarget + var sv *types.AuthorizerConfig if *v == nil { - sv = &types.AuditMitigationActionsTaskTarget{} + sv = &types.AuthorizerConfig{} } else { sv = *v } for key, value := range shape { switch key { - case "auditCheckToReasonCodeFilter": - if err := awsRestjson1_deserializeDocumentAuditCheckToReasonCodeFilter(&sv.AuditCheckToReasonCodeFilter, value); err != nil { - return err + case "allowAuthorizerOverride": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected AllowAuthorizerOverride to be of type *bool, got %T instead", value) + } + sv.AllowAuthorizerOverride = ptr.Bool(jtv) } - case "auditTaskId": + case "defaultAuthorizerName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) } - sv.AuditTaskId = ptr.String(jtv) - } - - case "findingIds": - if err := awsRestjson1_deserializeDocumentFindingIds(&sv.FindingIds, value); err != nil { - return err + sv.DefaultAuthorizerName = ptr.String(jtv) } default: @@ -44480,7 +46376,7 @@ func awsRestjson1_deserializeDocumentAuditMitigationActionsTaskTarget(v **types. return nil } -func awsRestjson1_deserializeDocumentAuditNotificationTarget(v **types.AuditNotificationTarget, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthorizerDescription(v **types.AuthorizerDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44493,40 +46389,113 @@ func awsRestjson1_deserializeDocumentAuditNotificationTarget(v **types.AuditNoti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuditNotificationTarget + var sv *types.AuthorizerDescription if *v == nil { - sv = &types.AuditNotificationTarget{} + sv = &types.AuthorizerDescription{} } else { sv = *v } for key, value := range shape { switch key { - case "enabled": + case "authorizerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value) + } + sv.AuthorizerArn = ptr.String(jtv) + } + + case "authorizerFunctionArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthorizerFunctionArn to be of type string, got %T instead", value) + } + sv.AuthorizerFunctionArn = ptr.String(jtv) + } + + case "authorizerName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) + } + sv.AuthorizerName = ptr.String(jtv) + } + + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "enableCachingForHttp": if value != nil { jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected Enabled to be of type *bool, got %T instead", value) + return fmt.Errorf("expected EnableCachingForHttp to be of type *bool, got %T instead", value) } - sv.Enabled = jtv + sv.EnableCachingForHttp = ptr.Bool(jtv) } - case "roleArn": + case "lastModifiedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "signingDisabled": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BooleanKey to be of type *bool, got %T instead", value) + } + sv.SigningDisabled = ptr.Bool(jtv) + } + + case "status": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected RoleArn to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthorizerStatus to be of type string, got %T instead", value) } - sv.RoleArn = ptr.String(jtv) + sv.Status = types.AuthorizerStatus(jtv) } - case "targetArn": + case "tokenKeyName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value) + return fmt.Errorf("expected TokenKeyName to be of type string, got %T instead", value) } - sv.TargetArn = ptr.String(jtv) + sv.TokenKeyName = ptr.String(jtv) + } + + case "tokenSigningPublicKeys": + if err := awsRestjson1_deserializeDocumentPublicKeyMap(&sv.TokenSigningPublicKeys, value); err != nil { + return err } default: @@ -44538,7 +46507,7 @@ func awsRestjson1_deserializeDocumentAuditNotificationTarget(v **types.AuditNoti return nil } -func awsRestjson1_deserializeDocumentAuditNotificationTargetConfigurations(v *map[string]types.AuditNotificationTarget, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthorizers(v *[]types.AuthorizerSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44546,34 +46515,33 @@ func awsRestjson1_deserializeDocumentAuditNotificationTargetConfigurations(v *ma return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]types.AuditNotificationTarget + var cv []types.AuthorizerSummary if *v == nil { - mv = map[string]types.AuditNotificationTarget{} + cv = []types.AuthorizerSummary{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal types.AuditNotificationTarget - mapVar := parsedVal - destAddr := &mapVar - if err := awsRestjson1_deserializeDocumentAuditNotificationTarget(&destAddr, value); err != nil { + for _, value := range shape { + var col types.AuthorizerSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentAuthorizerSummary(&destAddr, value); err != nil { return err } - parsedVal = *destAddr - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAuditSuppression(v **types.AuditSuppression, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthorizerSummary(v **types.AuthorizerSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44586,61 +46554,91 @@ func awsRestjson1_deserializeDocumentAuditSuppression(v **types.AuditSuppression return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuditSuppression + var sv *types.AuthorizerSummary if *v == nil { - sv = &types.AuditSuppression{} + sv = &types.AuthorizerSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "checkName": + case "authorizerArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuditCheckName to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value) } - sv.CheckName = ptr.String(jtv) + sv.AuthorizerArn = ptr.String(jtv) } - case "description": + case "authorizerName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuditDescription to be of type string, got %T instead", value) + return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) } - sv.Description = ptr.String(jtv) + sv.AuthorizerName = ptr.String(jtv) } - case "expirationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ExpirationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + default: + _, _ = key, value - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + } + } + *v = sv + return nil +} - } - } +func awsRestjson1_deserializeDocumentAuthResult(v **types.AuthResult, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "resourceIdentifier": - if err := awsRestjson1_deserializeDocumentResourceIdentifier(&sv.ResourceIdentifier, value); err != nil { + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.AuthResult + if *v == nil { + sv = &types.AuthResult{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "allowed": + if err := awsRestjson1_deserializeDocumentAllowed(&sv.Allowed, value); err != nil { return err } - case "suppressIndefinitely": + case "authDecision": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SuppressIndefinitely to be of type *bool, got %T instead", value) + return fmt.Errorf("expected AuthDecision to be of type string, got %T instead", value) } - sv.SuppressIndefinitely = ptr.Bool(jtv) + sv.AuthDecision = types.AuthDecision(jtv) + } + + case "authInfo": + if err := awsRestjson1_deserializeDocumentAuthInfo(&sv.AuthInfo, value); err != nil { + return err + } + + case "denied": + if err := awsRestjson1_deserializeDocumentDenied(&sv.Denied, value); err != nil { + return err + } + + case "missingContextValues": + if err := awsRestjson1_deserializeDocumentMissingContextValues(&sv.MissingContextValues, value); err != nil { + return err } default: @@ -44652,7 +46650,7 @@ func awsRestjson1_deserializeDocumentAuditSuppression(v **types.AuditSuppression return nil } -func awsRestjson1_deserializeDocumentAuditSuppressionList(v *[]types.AuditSuppression, value interface{}) error { +func awsRestjson1_deserializeDocumentAuthResults(v *[]types.AuthResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44665,17 +46663,17 @@ func awsRestjson1_deserializeDocumentAuditSuppressionList(v *[]types.AuditSuppre return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AuditSuppression + var cv []types.AuthResult if *v == nil { - cv = []types.AuditSuppression{} + cv = []types.AuthResult{} } else { cv = *v } for _, value := range shape { - var col types.AuditSuppression + var col types.AuthResult destAddr := &col - if err := awsRestjson1_deserializeDocumentAuditSuppression(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentAuthResult(&destAddr, value); err != nil { return err } col = *destAddr @@ -44686,7 +46684,7 @@ func awsRestjson1_deserializeDocumentAuditSuppressionList(v *[]types.AuditSuppre return nil } -func awsRestjson1_deserializeDocumentAuditTaskMetadata(v **types.AuditTaskMetadata, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsJobExecutionsRolloutConfig(v **types.AwsJobExecutionsRolloutConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44699,40 +46697,114 @@ func awsRestjson1_deserializeDocumentAuditTaskMetadata(v **types.AuditTaskMetada return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuditTaskMetadata + var sv *types.AwsJobExecutionsRolloutConfig if *v == nil { - sv = &types.AuditTaskMetadata{} + sv = &types.AwsJobExecutionsRolloutConfig{} } else { sv = *v } for key, value := range shape { switch key { - case "taskId": + case "exponentialRate": + if err := awsRestjson1_deserializeDocumentAwsJobExponentialRolloutRate(&sv.ExponentialRate, value); err != nil { + return err + } + + case "maximumPerMinute": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected AuditTaskId to be of type string, got %T instead", value) + return fmt.Errorf("expected MaximumPerMinute to be json.Number, got %T instead", value) } - sv.TaskId = ptr.String(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaximumPerMinute = ptr.Int32(int32(i64)) } - case "taskStatus": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentAwsJobExponentialRolloutRate(v **types.AwsJobExponentialRolloutRate, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AwsJobExponentialRolloutRate + if *v == nil { + sv = &types.AwsJobExponentialRolloutRate{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "baseRatePerMinute": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected AuditTaskStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsJobRolloutRatePerMinute to be json.Number, got %T instead", value) } - sv.TaskStatus = types.AuditTaskStatus(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.BaseRatePerMinute = ptr.Int32(int32(i64)) } - case "taskType": + case "incrementFactor": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AuditTaskType to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.IncrementFactor = 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.IncrementFactor = f64 + + default: + return fmt.Errorf("expected AwsJobRolloutIncrementFactor to be a JSON Number, got %T instead", value) + } - sv.TaskType = types.AuditTaskType(jtv) + } + + case "rateIncreaseCriteria": + if err := awsRestjson1_deserializeDocumentAwsJobRateIncreaseCriteria(&sv.RateIncreaseCriteria, value); err != nil { + return err } default: @@ -44744,7 +46816,7 @@ func awsRestjson1_deserializeDocumentAuditTaskMetadata(v **types.AuditTaskMetada return nil } -func awsRestjson1_deserializeDocumentAuditTaskMetadataList(v *[]types.AuditTaskMetadata, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsJobPresignedUrlConfig(v **types.AwsJobPresignedUrlConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44752,33 +46824,43 @@ func awsRestjson1_deserializeDocumentAuditTaskMetadataList(v *[]types.AuditTaskM return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AuditTaskMetadata + var sv *types.AwsJobPresignedUrlConfig if *v == nil { - cv = []types.AuditTaskMetadata{} + sv = &types.AwsJobPresignedUrlConfig{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.AuditTaskMetadata - destAddr := &col - if err := awsRestjson1_deserializeDocumentAuditTaskMetadata(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "expiresInSec": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected ExpiresInSeconds to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExpiresInSec = ptr.Int64(i64) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentAuthInfo(v **types.AuthInfo, value interface{}) error { +func awsRestjson1_deserializeDocumentAwsJobRateIncreaseCriteria(v **types.AwsJobRateIncreaseCriteria, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44791,27 +46873,39 @@ func awsRestjson1_deserializeDocumentAuthInfo(v **types.AuthInfo, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuthInfo + var sv *types.AwsJobRateIncreaseCriteria if *v == nil { - sv = &types.AuthInfo{} + sv = &types.AwsJobRateIncreaseCriteria{} } else { sv = *v } for key, value := range shape { switch key { - case "actionType": + case "numberOfNotifiedThings": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected ActionType to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsJobRateIncreaseCriteriaNumberOfThings to be json.Number, got %T instead", value) } - sv.ActionType = types.ActionType(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfNotifiedThings = ptr.Int32(int32(i64)) } - case "resources": - if err := awsRestjson1_deserializeDocumentResources(&sv.Resources, value); err != nil { - return err + case "numberOfSucceededThings": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected AwsJobRateIncreaseCriteriaNumberOfThings to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.NumberOfSucceededThings = ptr.Int32(int32(i64)) } default: @@ -44823,7 +46917,7 @@ func awsRestjson1_deserializeDocumentAuthInfo(v **types.AuthInfo, value interfac return nil } -func awsRestjson1_deserializeDocumentAuthorizerConfig(v **types.AuthorizerConfig, value interface{}) error { +func awsRestjson1_deserializeDocumentBehavior(v **types.Behavior, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44836,31 +46930,59 @@ func awsRestjson1_deserializeDocumentAuthorizerConfig(v **types.AuthorizerConfig return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuthorizerConfig + var sv *types.Behavior if *v == nil { - sv = &types.AuthorizerConfig{} + sv = &types.Behavior{} } else { sv = *v } for key, value := range shape { switch key { - case "allowAuthorizerOverride": + case "criteria": + if err := awsRestjson1_deserializeDocumentBehaviorCriteria(&sv.Criteria, value); err != nil { + return err + } + + case "exportMetric": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected ExportMetric to be of type *bool, got %T instead", value) + } + sv.ExportMetric = ptr.Bool(jtv) + } + + case "metric": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected BehaviorMetric to be of type string, got %T instead", value) + } + sv.Metric = ptr.String(jtv) + } + + case "metricDimension": + if err := awsRestjson1_deserializeDocumentMetricDimension(&sv.MetricDimension, value); err != nil { + return err + } + + case "name": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AllowAuthorizerOverride to be of type *bool, got %T instead", value) + return fmt.Errorf("expected BehaviorName to be of type string, got %T instead", value) } - sv.AllowAuthorizerOverride = ptr.Bool(jtv) + sv.Name = ptr.String(jtv) } - case "defaultAuthorizerName": + case "suppressAlerts": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) + return fmt.Errorf("expected SuppressAlerts to be of type *bool, got %T instead", value) } - sv.DefaultAuthorizerName = ptr.String(jtv) + sv.SuppressAlerts = ptr.Bool(jtv) } default: @@ -44872,7 +46994,7 @@ func awsRestjson1_deserializeDocumentAuthorizerConfig(v **types.AuthorizerConfig return nil } -func awsRestjson1_deserializeDocumentAuthorizerDescription(v **types.AuthorizerDescription, value interface{}) error { +func awsRestjson1_deserializeDocumentBehaviorCriteria(v **types.BehaviorCriteria, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -44885,112 +47007,75 @@ func awsRestjson1_deserializeDocumentAuthorizerDescription(v **types.AuthorizerD return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuthorizerDescription + var sv *types.BehaviorCriteria if *v == nil { - sv = &types.AuthorizerDescription{} + sv = &types.BehaviorCriteria{} } else { sv = *v } for key, value := range shape { switch key { - case "authorizerArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value) - } - sv.AuthorizerArn = ptr.String(jtv) - } - - case "authorizerFunctionArn": + case "comparisonOperator": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuthorizerFunctionArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ComparisonOperator to be of type string, got %T instead", value) } - sv.AuthorizerFunctionArn = ptr.String(jtv) + sv.ComparisonOperator = types.ComparisonOperator(jtv) } - case "authorizerName": + case "consecutiveDatapointsToAlarm": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) + return fmt.Errorf("expected ConsecutiveDatapointsToAlarm to be json.Number, got %T instead", value) } - sv.AuthorizerName = ptr.String(jtv) - } - - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - + i64, err := jtv.Int64() + if err != nil { + return err } + sv.ConsecutiveDatapointsToAlarm = ptr.Int32(int32(i64)) } - case "enableCachingForHttp": + case "consecutiveDatapointsToClear": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected EnableCachingForHttp to be of type *bool, got %T instead", value) + return fmt.Errorf("expected ConsecutiveDatapointsToClear to be json.Number, got %T instead", value) } - sv.EnableCachingForHttp = ptr.Bool(jtv) - } - - case "lastModifiedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - + i64, err := jtv.Int64() + if err != nil { + return err } + sv.ConsecutiveDatapointsToClear = ptr.Int32(int32(i64)) } - case "signingDisabled": + case "durationSeconds": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected BooleanKey to be of type *bool, got %T instead", value) + return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) } - sv.SigningDisabled = ptr.Bool(jtv) + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.DurationSeconds = ptr.Int32(int32(i64)) } - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AuthorizerStatus to be of type string, got %T instead", value) - } - sv.Status = types.AuthorizerStatus(jtv) + case "mlDetectionConfig": + if err := awsRestjson1_deserializeDocumentMachineLearningDetectionConfig(&sv.MlDetectionConfig, value); err != nil { + return err } - case "tokenKeyName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected TokenKeyName to be of type string, got %T instead", value) - } - sv.TokenKeyName = ptr.String(jtv) + case "statisticalThreshold": + if err := awsRestjson1_deserializeDocumentStatisticalThreshold(&sv.StatisticalThreshold, value); err != nil { + return err } - case "tokenSigningPublicKeys": - if err := awsRestjson1_deserializeDocumentPublicKeyMap(&sv.TokenSigningPublicKeys, value); err != nil { + case "value": + if err := awsRestjson1_deserializeDocumentMetricValue(&sv.Value, value); err != nil { return err } @@ -45003,7 +47088,7 @@ func awsRestjson1_deserializeDocumentAuthorizerDescription(v **types.AuthorizerD return nil } -func awsRestjson1_deserializeDocumentAuthorizers(v *[]types.AuthorizerSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummaries(v *[]types.BehaviorModelTrainingSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45016,17 +47101,17 @@ func awsRestjson1_deserializeDocumentAuthorizers(v *[]types.AuthorizerSummary, v return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AuthorizerSummary + var cv []types.BehaviorModelTrainingSummary if *v == nil { - cv = []types.AuthorizerSummary{} + cv = []types.BehaviorModelTrainingSummary{} } else { cv = *v } for _, value := range shape { - var col types.AuthorizerSummary + var col types.BehaviorModelTrainingSummary destAddr := &col - if err := awsRestjson1_deserializeDocumentAuthorizerSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBehaviorModelTrainingSummary(&destAddr, value); err != nil { return err } col = *destAddr @@ -45037,7 +47122,7 @@ func awsRestjson1_deserializeDocumentAuthorizers(v *[]types.AuthorizerSummary, v return nil } -func awsRestjson1_deserializeDocumentAuthorizerSummary(v **types.AuthorizerSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummary(v **types.BehaviorModelTrainingSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45050,91 +47135,106 @@ func awsRestjson1_deserializeDocumentAuthorizerSummary(v **types.AuthorizerSumma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AuthorizerSummary + var sv *types.BehaviorModelTrainingSummary if *v == nil { - sv = &types.AuthorizerSummary{} + sv = &types.BehaviorModelTrainingSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "authorizerArn": + case "behaviorName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuthorizerArn to be of type string, got %T instead", value) + return fmt.Errorf("expected BehaviorName to be of type string, got %T instead", value) } - sv.AuthorizerArn = ptr.String(jtv) + sv.BehaviorName = ptr.String(jtv) } - case "authorizerName": + case "datapointsCollectionPercentage": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AuthorizerName to be of type string, got %T instead", value) - } - sv.AuthorizerName = ptr.String(jtv) - } + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DatapointsCollectionPercentage = ptr.Float64(f64) - default: - _, _ = key, value + case string: + var f64 float64 + switch { + case strings.EqualFold(jtv, "NaN"): + f64 = math.NaN() - } - } - *v = sv - return nil -} + case strings.EqualFold(jtv, "Infinity"): + f64 = math.Inf(1) -func awsRestjson1_deserializeDocumentAuthResult(v **types.AuthResult, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } + case strings.EqualFold(jtv, "-Infinity"): + f64 = math.Inf(-1) - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + default: + return fmt.Errorf("unknown JSON number value: %s", jtv) - var sv *types.AuthResult - if *v == nil { - sv = &types.AuthResult{} - } else { - sv = *v - } + } + sv.DatapointsCollectionPercentage = ptr.Float64(f64) - for key, value := range shape { - switch key { - case "allowed": - if err := awsRestjson1_deserializeDocumentAllowed(&sv.Allowed, value); err != nil { - return err + default: + return fmt.Errorf("expected DataCollectionPercentage to be a JSON Number, got %T instead", value) + + } } - case "authDecision": + case "lastModelRefreshDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModelRefreshDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "modelStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AuthDecision to be of type string, got %T instead", value) + return fmt.Errorf("expected ModelStatus to be of type string, got %T instead", value) } - sv.AuthDecision = types.AuthDecision(jtv) + sv.ModelStatus = types.ModelStatus(jtv) } - case "authInfo": - if err := awsRestjson1_deserializeDocumentAuthInfo(&sv.AuthInfo, value); err != nil { - return err + case "securityProfileName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value) + } + sv.SecurityProfileName = ptr.String(jtv) } - case "denied": - if err := awsRestjson1_deserializeDocumentDenied(&sv.Denied, value); err != nil { - return err - } + case "trainingDataCollectionStartDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.TrainingDataCollectionStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - case "missingContextValues": - if err := awsRestjson1_deserializeDocumentMissingContextValues(&sv.MissingContextValues, value); err != nil { - return err + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } } default: @@ -45146,7 +47246,7 @@ func awsRestjson1_deserializeDocumentAuthResult(v **types.AuthResult, value inte return nil } -func awsRestjson1_deserializeDocumentAuthResults(v *[]types.AuthResult, value interface{}) error { +func awsRestjson1_deserializeDocumentBehaviors(v *[]types.Behavior, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45159,17 +47259,17 @@ func awsRestjson1_deserializeDocumentAuthResults(v *[]types.AuthResult, value in return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.AuthResult + var cv []types.Behavior if *v == nil { - cv = []types.AuthResult{} + cv = []types.Behavior{} } else { cv = *v } for _, value := range shape { - var col types.AuthResult + var col types.Behavior destAddr := &col - if err := awsRestjson1_deserializeDocumentAuthResult(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentBehavior(&destAddr, value); err != nil { return err } col = *destAddr @@ -45180,7 +47280,7 @@ func awsRestjson1_deserializeDocumentAuthResults(v *[]types.AuthResult, value in return nil } -func awsRestjson1_deserializeDocumentAwsJobExecutionsRolloutConfig(v **types.AwsJobExecutionsRolloutConfig, value interface{}) error { +func awsRestjson1_deserializeDocumentBillingGroupMetadata(v **types.BillingGroupMetadata, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45193,31 +47293,29 @@ func awsRestjson1_deserializeDocumentAwsJobExecutionsRolloutConfig(v **types.Aws return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsJobExecutionsRolloutConfig + var sv *types.BillingGroupMetadata if *v == nil { - sv = &types.AwsJobExecutionsRolloutConfig{} + sv = &types.BillingGroupMetadata{} } else { sv = *v } for key, value := range shape { switch key { - case "exponentialRate": - if err := awsRestjson1_deserializeDocumentAwsJobExponentialRolloutRate(&sv.ExponentialRate, value); err != nil { - return err - } - - case "maximumPerMinute": + case "creationDate": if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected MaximumPerMinute to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected CreationDate to be a JSON Number, got %T instead", value) + } - sv.MaximumPerMinute = ptr.Int32(int32(i64)) } default: @@ -45229,7 +47327,7 @@ func awsRestjson1_deserializeDocumentAwsJobExecutionsRolloutConfig(v **types.Aws return nil } -func awsRestjson1_deserializeDocumentAwsJobExponentialRolloutRate(v **types.AwsJobExponentialRolloutRate, value interface{}) error { +func awsRestjson1_deserializeDocumentBillingGroupNameAndArnList(v *[]types.GroupNameAndArn, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45237,82 +47335,33 @@ func awsRestjson1_deserializeDocumentAwsJobExponentialRolloutRate(v **types.AwsJ return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsJobExponentialRolloutRate + var cv []types.GroupNameAndArn if *v == nil { - sv = &types.AwsJobExponentialRolloutRate{} + cv = []types.GroupNameAndArn{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "baseRatePerMinute": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected AwsJobRolloutRatePerMinute to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.BaseRatePerMinute = ptr.Int32(int32(i64)) - } - - case "incrementFactor": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.IncrementFactor = 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.IncrementFactor = f64 - - default: - return fmt.Errorf("expected AwsJobRolloutIncrementFactor to be a JSON Number, got %T instead", value) - - } - } - - case "rateIncreaseCriteria": - if err := awsRestjson1_deserializeDocumentAwsJobRateIncreaseCriteria(&sv.RateIncreaseCriteria, value); err != nil { - return err - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.GroupNameAndArn + destAddr := &col + if err := awsRestjson1_deserializeDocumentGroupNameAndArn(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentAwsJobPresignedUrlConfig(v **types.AwsJobPresignedUrlConfig, value interface{}) error { +func awsRestjson1_deserializeDocumentBillingGroupProperties(v **types.BillingGroupProperties, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45325,26 +47374,22 @@ func awsRestjson1_deserializeDocumentAwsJobPresignedUrlConfig(v **types.AwsJobPr return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsJobPresignedUrlConfig + var sv *types.BillingGroupProperties if *v == nil { - sv = &types.AwsJobPresignedUrlConfig{} + sv = &types.BillingGroupProperties{} } else { sv = *v } for key, value := range shape { switch key { - case "expiresInSec": + case "billingGroupDescription": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExpiresInSeconds to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected BillingGroupDescription to be of type string, got %T instead", value) } - sv.ExpiresInSec = ptr.Int64(i64) + sv.BillingGroupDescription = ptr.String(jtv) } default: @@ -45356,7 +47401,7 @@ func awsRestjson1_deserializeDocumentAwsJobPresignedUrlConfig(v **types.AwsJobPr return nil } -func awsRestjson1_deserializeDocumentAwsJobRateIncreaseCriteria(v **types.AwsJobRateIncreaseCriteria, value interface{}) error { +func awsRestjson1_deserializeDocumentBucket(v **types.Bucket, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45369,39 +47414,35 @@ func awsRestjson1_deserializeDocumentAwsJobRateIncreaseCriteria(v **types.AwsJob return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.AwsJobRateIncreaseCriteria + var sv *types.Bucket if *v == nil { - sv = &types.AwsJobRateIncreaseCriteria{} + sv = &types.Bucket{} } else { sv = *v } for key, value := range shape { switch key { - case "numberOfNotifiedThings": + case "count": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected AwsJobRateIncreaseCriteriaNumberOfThings to be json.Number, got %T instead", value) + return fmt.Errorf("expected Count to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.NumberOfNotifiedThings = ptr.Int32(int32(i64)) + sv.Count = int32(i64) } - case "numberOfSucceededThings": + case "keyValue": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AwsJobRateIncreaseCriteriaNumberOfThings to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected BucketKeyValue to be of type string, got %T instead", value) } - sv.NumberOfSucceededThings = ptr.Int32(int32(i64)) + sv.KeyValue = ptr.String(jtv) } default: @@ -45413,7 +47454,41 @@ func awsRestjson1_deserializeDocumentAwsJobRateIncreaseCriteria(v **types.AwsJob return nil } -func awsRestjson1_deserializeDocumentBehavior(v **types.Behavior, value interface{}) error { +func awsRestjson1_deserializeDocumentBuckets(v *[]types.Bucket, 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.Bucket + if *v == nil { + cv = []types.Bucket{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Bucket + destAddr := &col + if err := awsRestjson1_deserializeDocumentBucket(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentCACertificate(v **types.CACertificate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45426,59 +47501,56 @@ func awsRestjson1_deserializeDocumentBehavior(v **types.Behavior, value interfac return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Behavior + var sv *types.CACertificate if *v == nil { - sv = &types.Behavior{} + sv = &types.CACertificate{} } else { sv = *v } for key, value := range shape { switch key { - case "criteria": - if err := awsRestjson1_deserializeDocumentBehaviorCriteria(&sv.Criteria, value); err != nil { - return err - } - - case "exportMetric": + case "certificateArn": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ExportMetric to be of type *bool, got %T instead", value) + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) } - sv.ExportMetric = ptr.Bool(jtv) + sv.CertificateArn = ptr.String(jtv) } - case "metric": + case "certificateId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BehaviorMetric to be of type string, got %T instead", value) + return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) } - sv.Metric = ptr.String(jtv) - } - - case "metricDimension": - if err := awsRestjson1_deserializeDocumentMetricDimension(&sv.MetricDimension, value); err != nil { - return err + sv.CertificateId = ptr.String(jtv) } - case "name": + case "creationDate": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BehaviorName to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + } - sv.Name = ptr.String(jtv) } - case "suppressAlerts": + case "status": if value != nil { - jtv, ok := value.(bool) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SuppressAlerts to be of type *bool, got %T instead", value) + return fmt.Errorf("expected CACertificateStatus to be of type string, got %T instead", value) } - sv.SuppressAlerts = ptr.Bool(jtv) + sv.Status = types.CACertificateStatus(jtv) } default: @@ -45490,7 +47562,7 @@ func awsRestjson1_deserializeDocumentBehavior(v **types.Behavior, value interfac return nil } -func awsRestjson1_deserializeDocumentBehaviorCriteria(v **types.BehaviorCriteria, value interface{}) error { +func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertificateDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45503,75 +47575,134 @@ func awsRestjson1_deserializeDocumentBehaviorCriteria(v **types.BehaviorCriteria return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BehaviorCriteria + var sv *types.CACertificateDescription if *v == nil { - sv = &types.BehaviorCriteria{} + sv = &types.CACertificateDescription{} } else { sv = *v } for key, value := range shape { switch key { - case "comparisonOperator": + case "autoRegistrationStatus": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ComparisonOperator to be of type string, got %T instead", value) + return fmt.Errorf("expected AutoRegistrationStatus to be of type string, got %T instead", value) } - sv.ComparisonOperator = types.ComparisonOperator(jtv) + sv.AutoRegistrationStatus = types.AutoRegistrationStatus(jtv) } - case "consecutiveDatapointsToAlarm": + case "certificateArn": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ConsecutiveDatapointsToAlarm to be json.Number, got %T instead", value) + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.CertificateArn = ptr.String(jtv) + } + + case "certificateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) } - sv.ConsecutiveDatapointsToAlarm = ptr.Int32(int32(i64)) + sv.CertificateId = ptr.String(jtv) } - case "consecutiveDatapointsToClear": + case "certificateMode": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ConsecutiveDatapointsToClear to be json.Number, got %T instead", value) + return fmt.Errorf("expected CertificateMode to be of type string, got %T instead", value) } - i64, err := jtv.Int64() - if err != nil { - return err + sv.CertificateMode = types.CertificateMode(jtv) + } + + case "certificatePem": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value) } - sv.ConsecutiveDatapointsToClear = ptr.Int32(int32(i64)) + sv.CertificatePem = ptr.String(jtv) } - case "durationSeconds": + case "creationDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "customerVersion": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected DurationSeconds to be json.Number, got %T instead", value) + return fmt.Errorf("expected CustomerVersion to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.DurationSeconds = ptr.Int32(int32(i64)) + sv.CustomerVersion = ptr.Int32(int32(i64)) } - case "mlDetectionConfig": - if err := awsRestjson1_deserializeDocumentMachineLearningDetectionConfig(&sv.MlDetectionConfig, value); err != nil { - return err + case "generationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value) + } + sv.GenerationId = ptr.String(jtv) } - case "statisticalThreshold": - if err := awsRestjson1_deserializeDocumentStatisticalThreshold(&sv.StatisticalThreshold, value); err != nil { - return err + case "lastModifiedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } } - case "value": - if err := awsRestjson1_deserializeDocumentMetricValue(&sv.Value, value); err != nil { + case "ownedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.OwnedBy = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CACertificateStatus to be of type string, got %T instead", value) + } + sv.Status = types.CACertificateStatus(jtv) + } + + case "validity": + if err := awsRestjson1_deserializeDocumentCertificateValidity(&sv.Validity, value); err != nil { return err } @@ -45584,7 +47715,7 @@ func awsRestjson1_deserializeDocumentBehaviorCriteria(v **types.BehaviorCriteria return nil } -func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummaries(v *[]types.BehaviorModelTrainingSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentCACertificates(v *[]types.CACertificate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45597,17 +47728,17 @@ func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummaries(v *[]types.B return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.BehaviorModelTrainingSummary + var cv []types.CACertificate if *v == nil { - cv = []types.BehaviorModelTrainingSummary{} + cv = []types.CACertificate{} } else { cv = *v } for _, value := range shape { - var col types.BehaviorModelTrainingSummary + var col types.CACertificate destAddr := &col - if err := awsRestjson1_deserializeDocumentBehaviorModelTrainingSummary(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentCACertificate(&destAddr, value); err != nil { return err } col = *destAddr @@ -45618,7 +47749,7 @@ func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummaries(v *[]types.B return nil } -func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummary(v **types.BehaviorModelTrainingSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificate(v **types.Certificate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45631,93 +47762,43 @@ func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummary(v **types.Beha return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BehaviorModelTrainingSummary + var sv *types.Certificate if *v == nil { - sv = &types.BehaviorModelTrainingSummary{} + sv = &types.Certificate{} } else { sv = *v } for key, value := range shape { switch key { - case "behaviorName": + case "certificateArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BehaviorName to be of type string, got %T instead", value) - } - sv.BehaviorName = ptr.String(jtv) - } - - case "datapointsCollectionPercentage": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.DatapointsCollectionPercentage = 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.DatapointsCollectionPercentage = ptr.Float64(f64) - - default: - return fmt.Errorf("expected DataCollectionPercentage to be a JSON Number, got %T instead", value) - - } - } - - case "lastModelRefreshDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModelRefreshDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) } + sv.CertificateArn = ptr.String(jtv) } - case "modelStatus": + case "certificateId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ModelStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) } - sv.ModelStatus = types.ModelStatus(jtv) + sv.CertificateId = ptr.String(jtv) } - case "securityProfileName": + case "certificateMode": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SecurityProfileName to be of type string, got %T instead", value) + return fmt.Errorf("expected CertificateMode to be of type string, got %T instead", value) } - sv.SecurityProfileName = ptr.String(jtv) + sv.CertificateMode = types.CertificateMode(jtv) } - case "trainingDataCollectionStartDate": + case "creationDate": if value != nil { switch jtv := value.(type) { case json.Number: @@ -45725,12 +47806,21 @@ func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummary(v **types.Beha if err != nil { return err } - sv.TrainingDataCollectionStartDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateStatus to be of type string, got %T instead", value) } + sv.Status = types.CertificateStatus(jtv) } default: @@ -45742,7 +47832,7 @@ func awsRestjson1_deserializeDocumentBehaviorModelTrainingSummary(v **types.Beha return nil } -func awsRestjson1_deserializeDocumentBehaviors(v *[]types.Behavior, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificateConflictException(v **types.CertificateConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45750,33 +47840,39 @@ func awsRestjson1_deserializeDocumentBehaviors(v *[]types.Behavior, value interf return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Behavior + var sv *types.CertificateConflictException if *v == nil { - cv = []types.Behavior{} + sv = &types.CertificateConflictException{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.Behavior - destAddr := &col - if err := awsRestjson1_deserializeDocumentBehavior(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentBillingGroupMetadata(v **types.BillingGroupMetadata, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificateDescription(v **types.CertificateDescription, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45789,15 +47885,60 @@ func awsRestjson1_deserializeDocumentBillingGroupMetadata(v **types.BillingGroup return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BillingGroupMetadata + var sv *types.CertificateDescription if *v == nil { - sv = &types.BillingGroupMetadata{} + sv = &types.CertificateDescription{} } else { sv = *v } for key, value := range shape { switch key { + case "caCertificateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) + } + sv.CaCertificateId = ptr.String(jtv) + } + + case "certificateArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + } + sv.CertificateArn = ptr.String(jtv) + } + + case "certificateId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) + } + sv.CertificateId = ptr.String(jtv) + } + + case "certificateMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateMode to be of type string, got %T instead", value) + } + sv.CertificateMode = types.CertificateMode(jtv) + } + + case "certificatePem": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value) + } + sv.CertificatePem = ptr.String(jtv) + } + case "creationDate": if value != nil { switch jtv := value.(type) { @@ -45809,9 +47950,84 @@ func awsRestjson1_deserializeDocumentBillingGroupMetadata(v **types.BillingGroup sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: - return fmt.Errorf("expected CreationDate to be a JSON Number, got %T instead", value) + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "customerVersion": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected CustomerVersion to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.CustomerVersion = ptr.Int32(int32(i64)) + } + + case "generationId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value) + } + sv.GenerationId = ptr.String(jtv) + } + + case "lastModifiedDate": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "ownedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.OwnedBy = ptr.String(jtv) + } + + case "previousOwnedBy": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + } + sv.PreviousOwnedBy = ptr.String(jtv) + } + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateStatus to be of type string, got %T instead", value) } + sv.Status = types.CertificateStatus(jtv) + } + + case "transferData": + if err := awsRestjson1_deserializeDocumentTransferData(&sv.TransferData, value); err != nil { + return err + } + + case "validity": + if err := awsRestjson1_deserializeDocumentCertificateValidity(&sv.Validity, value); err != nil { + return err } default: @@ -45823,7 +48039,7 @@ func awsRestjson1_deserializeDocumentBillingGroupMetadata(v **types.BillingGroup return nil } -func awsRestjson1_deserializeDocumentBillingGroupNameAndArnList(v *[]types.GroupNameAndArn, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificateProviderAccountDefaultForOperations(v *[]types.CertificateProviderOperation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45836,20 +48052,22 @@ func awsRestjson1_deserializeDocumentBillingGroupNameAndArnList(v *[]types.Group return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.GroupNameAndArn + var cv []types.CertificateProviderOperation if *v == nil { - cv = []types.GroupNameAndArn{} + cv = []types.CertificateProviderOperation{} } else { cv = *v } for _, value := range shape { - var col types.GroupNameAndArn - destAddr := &col - if err := awsRestjson1_deserializeDocumentGroupNameAndArn(&destAddr, value); err != nil { - return err + var col types.CertificateProviderOperation + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateProviderOperation to be of type string, got %T instead", value) + } + col = types.CertificateProviderOperation(jtv) } - col = *destAddr cv = append(cv, col) } @@ -45857,7 +48075,7 @@ func awsRestjson1_deserializeDocumentBillingGroupNameAndArnList(v *[]types.Group return nil } -func awsRestjson1_deserializeDocumentBillingGroupProperties(v **types.BillingGroupProperties, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificateProviders(v *[]types.CertificateProviderSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45865,39 +48083,33 @@ func awsRestjson1_deserializeDocumentBillingGroupProperties(v **types.BillingGro return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.BillingGroupProperties + var cv []types.CertificateProviderSummary if *v == nil { - sv = &types.BillingGroupProperties{} + cv = []types.CertificateProviderSummary{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "billingGroupDescription": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected BillingGroupDescription to be of type string, got %T instead", value) - } - sv.BillingGroupDescription = ptr.String(jtv) - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.CertificateProviderSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentCertificateProviderSummary(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } -func awsRestjson1_deserializeDocumentBucket(v **types.Bucket, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificateProviderSummary(v **types.CertificateProviderSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45910,35 +48122,31 @@ func awsRestjson1_deserializeDocumentBucket(v **types.Bucket, value interface{}) return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Bucket + var sv *types.CertificateProviderSummary if *v == nil { - sv = &types.Bucket{} + sv = &types.CertificateProviderSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "count": + case "certificateProviderArn": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected Count to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected CertificateProviderArn to be of type string, got %T instead", value) } - sv.Count = int32(i64) + sv.CertificateProviderArn = ptr.String(jtv) } - case "keyValue": + case "certificateProviderName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected BucketKeyValue to be of type string, got %T instead", value) + return fmt.Errorf("expected CertificateProviderName to be of type string, got %T instead", value) } - sv.KeyValue = ptr.String(jtv) + sv.CertificateProviderName = ptr.String(jtv) } default: @@ -45950,7 +48158,7 @@ func awsRestjson1_deserializeDocumentBucket(v **types.Bucket, value interface{}) return nil } -func awsRestjson1_deserializeDocumentBuckets(v *[]types.Bucket, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificates(v *[]types.Certificate, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45963,17 +48171,17 @@ func awsRestjson1_deserializeDocumentBuckets(v *[]types.Bucket, value interface{ return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Bucket + var cv []types.Certificate if *v == nil { - cv = []types.Bucket{} + cv = []types.Certificate{} } else { cv = *v } for _, value := range shape { - var col types.Bucket + var col types.Certificate destAddr := &col - if err := awsRestjson1_deserializeDocumentBucket(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentCertificate(&destAddr, value); err != nil { return err } col = *destAddr @@ -45984,7 +48192,7 @@ func awsRestjson1_deserializeDocumentBuckets(v *[]types.Bucket, value interface{ return nil } -func awsRestjson1_deserializeDocumentCACertificate(v **types.CACertificate, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificateStateException(v **types.CertificateStateException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -45997,56 +48205,22 @@ func awsRestjson1_deserializeDocumentCACertificate(v **types.CACertificate, valu return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CACertificate + var sv *types.CertificateStateException if *v == nil { - sv = &types.CACertificate{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "certificateArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) - } - sv.CertificateArn = ptr.String(jtv) - } - - case "certificateId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) - } - sv.CertificateId = ptr.String(jtv) - } - - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - - } - } + sv = &types.CertificateStateException{} + } else { + sv = *v + } - case "status": + for key, value := range shape { + switch key { + case "message", "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CACertificateStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value) } - sv.Status = types.CACertificateStatus(jtv) + sv.Message = ptr.String(jtv) } default: @@ -46058,7 +48232,7 @@ func awsRestjson1_deserializeDocumentCACertificate(v **types.CACertificate, valu return nil } -func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertificateDescription, value interface{}) error { +func awsRestjson1_deserializeDocumentCertificateValidationException(v **types.CertificateValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46071,61 +48245,56 @@ func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertif return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CACertificateDescription + var sv *types.CertificateValidationException if *v == nil { - sv = &types.CACertificateDescription{} + sv = &types.CertificateValidationException{} } else { sv = *v } for key, value := range shape { switch key { - case "autoRegistrationStatus": + case "message", "Message": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AutoRegistrationStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value) } - sv.AutoRegistrationStatus = types.AutoRegistrationStatus(jtv) + sv.Message = ptr.String(jtv) } - case "certificateArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) - } - sv.CertificateArn = ptr.String(jtv) - } + default: + _, _ = key, value - case "certificateId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) - } - sv.CertificateId = ptr.String(jtv) - } + } + } + *v = sv + return nil +} - case "certificateMode": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateMode to be of type string, got %T instead", value) - } - sv.CertificateMode = types.CertificateMode(jtv) - } +func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateValidity, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "certificatePem": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value) - } - sv.CertificatePem = ptr.String(jtv) - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "creationDate": + var sv *types.CertificateValidity + if *v == nil { + sv = &types.CertificateValidity{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "notAfter": if value != nil { switch jtv := value.(type) { case json.Number: @@ -46133,7 +48302,7 @@ func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertif if err != nil { return err } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.NotAfter = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) @@ -46141,29 +48310,7 @@ func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertif } } - case "customerVersion": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected CustomerVersion to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err - } - sv.CustomerVersion = ptr.Int32(int32(i64)) - } - - case "generationId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value) - } - sv.GenerationId = ptr.String(jtv) - } - - case "lastModifiedDate": + case "notBefore": if value != nil { switch jtv := value.(type) { case json.Number: @@ -46171,7 +48318,7 @@ func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertif if err != nil { return err } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.NotBefore = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) @@ -46179,29 +48326,6 @@ func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertif } } - case "ownedBy": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) - } - sv.OwnedBy = ptr.String(jtv) - } - - case "status": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CACertificateStatus to be of type string, got %T instead", value) - } - sv.Status = types.CACertificateStatus(jtv) - } - - case "validity": - if err := awsRestjson1_deserializeDocumentCertificateValidity(&sv.Validity, value); err != nil { - return err - } - default: _, _ = key, value @@ -46211,7 +48335,7 @@ func awsRestjson1_deserializeDocumentCACertificateDescription(v **types.CACertif return nil } -func awsRestjson1_deserializeDocumentCACertificates(v *[]types.CACertificate, value interface{}) error { +func awsRestjson1_deserializeDocumentCidrs(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46224,20 +48348,22 @@ func awsRestjson1_deserializeDocumentCACertificates(v *[]types.CACertificate, va return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.CACertificate + var cv []string if *v == nil { - cv = []types.CACertificate{} + cv = []string{} } else { cv = *v } for _, value := range shape { - var col types.CACertificate - destAddr := &col - if err := awsRestjson1_deserializeDocumentCACertificate(&destAddr, value); err != nil { - return err + var col string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Cidr to be of type string, got %T instead", value) + } + col = jtv } - col = *destAddr cv = append(cv, col) } @@ -46245,7 +48371,7 @@ func awsRestjson1_deserializeDocumentCACertificates(v *[]types.CACertificate, va return nil } -func awsRestjson1_deserializeDocumentCertificate(v **types.Certificate, value interface{}) error { +func awsRestjson1_deserializeDocumentClientCertificateConfig(v **types.ClientCertificateConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46258,65 +48384,125 @@ func awsRestjson1_deserializeDocumentCertificate(v **types.Certificate, value in return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.Certificate + var sv *types.ClientCertificateConfig if *v == nil { - sv = &types.Certificate{} + sv = &types.ClientCertificateConfig{} } else { sv = *v } for key, value := range shape { switch key { - case "certificateArn": + case "clientCertificateCallbackArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) + return fmt.Errorf("expected ClientCertificateCallbackArn to be of type string, got %T instead", value) } - sv.CertificateArn = ptr.String(jtv) + sv.ClientCertificateCallbackArn = ptr.String(jtv) } - case "certificateId": + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentClientProperties(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentCloudwatchAlarmAction(v **types.CloudwatchAlarmAction, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CloudwatchAlarmAction + if *v == nil { + sv = &types.CloudwatchAlarmAction{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "alarmName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) + return fmt.Errorf("expected AlarmName to be of type string, got %T instead", value) } - sv.CertificateId = ptr.String(jtv) + sv.AlarmName = ptr.String(jtv) } - case "certificateMode": + case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateMode to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) } - sv.CertificateMode = types.CertificateMode(jtv) + sv.RoleArn = ptr.String(jtv) } - case "creationDate": + case "stateReason": if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StateReason to be of type string, got %T instead", value) } + sv.StateReason = ptr.String(jtv) } - case "status": + case "stateValue": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected StateValue to be of type string, got %T instead", value) } - sv.Status = types.CertificateStatus(jtv) + sv.StateValue = ptr.String(jtv) } default: @@ -46328,7 +48514,7 @@ func awsRestjson1_deserializeDocumentCertificate(v **types.Certificate, value in return nil } -func awsRestjson1_deserializeDocumentCertificateConflictException(v **types.CertificateConflictException, value interface{}) error { +func awsRestjson1_deserializeDocumentCloudwatchLogsAction(v **types.CloudwatchLogsAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46341,22 +48527,40 @@ func awsRestjson1_deserializeDocumentCertificateConflictException(v **types.Cert return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CertificateConflictException + var sv *types.CloudwatchLogsAction if *v == nil { - sv = &types.CertificateConflictException{} + sv = &types.CloudwatchLogsAction{} } else { sv = *v } for key, value := range shape { switch key { - case "message", "Message": + case "batchMode": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BatchMode to be of type *bool, got %T instead", value) + } + sv.BatchMode = ptr.Bool(jtv) + } + + case "logGroupName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value) + return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value) } - sv.Message = ptr.String(jtv) + sv.LogGroupName = ptr.String(jtv) + } + + case "roleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) + } + sv.RoleArn = ptr.String(jtv) } default: @@ -46368,7 +48572,7 @@ func awsRestjson1_deserializeDocumentCertificateConflictException(v **types.Cert return nil } -func awsRestjson1_deserializeDocumentCertificateDescription(v **types.CertificateDescription, value interface{}) error { +func awsRestjson1_deserializeDocumentCloudwatchMetricAction(v **types.CloudwatchMetricAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46381,149 +48585,67 @@ func awsRestjson1_deserializeDocumentCertificateDescription(v **types.Certificat return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CertificateDescription + var sv *types.CloudwatchMetricAction if *v == nil { - sv = &types.CertificateDescription{} + sv = &types.CloudwatchMetricAction{} } else { sv = *v } for key, value := range shape { switch key { - case "caCertificateId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) - } - sv.CaCertificateId = ptr.String(jtv) - } - - case "certificateArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateArn to be of type string, got %T instead", value) - } - sv.CertificateArn = ptr.String(jtv) - } - - case "certificateId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateId to be of type string, got %T instead", value) - } - sv.CertificateId = ptr.String(jtv) - } - - case "certificateMode": + case "metricName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateMode to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.CertificateMode = types.CertificateMode(jtv) + sv.MetricName = ptr.String(jtv) } - case "certificatePem": + case "metricNamespace": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificatePem to be of type string, got %T instead", value) - } - sv.CertificatePem = ptr.String(jtv) - } - - case "creationDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.CreationDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - - } - } - - case "customerVersion": - if value != nil { - jtv, ok := value.(json.Number) - if !ok { - return fmt.Errorf("expected CustomerVersion to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.CustomerVersion = ptr.Int32(int32(i64)) + sv.MetricNamespace = ptr.String(jtv) } - case "generationId": + case "metricTimestamp": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected GenerationId to be of type string, got %T instead", value) - } - sv.GenerationId = ptr.String(jtv) - } - - case "lastModifiedDate": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.LastModifiedDate = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - + return fmt.Errorf("expected String to be of type string, got %T instead", value) } + sv.MetricTimestamp = ptr.String(jtv) } - case "ownedBy": + case "metricUnit": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.OwnedBy = ptr.String(jtv) + sv.MetricUnit = ptr.String(jtv) } - case "previousOwnedBy": + case "metricValue": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AwsAccountId to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.PreviousOwnedBy = ptr.String(jtv) + sv.MetricValue = ptr.String(jtv) } - case "status": + case "roleArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateStatus to be of type string, got %T instead", value) + return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) } - sv.Status = types.CertificateStatus(jtv) - } - - case "transferData": - if err := awsRestjson1_deserializeDocumentTransferData(&sv.TransferData, value); err != nil { - return err - } - - case "validity": - if err := awsRestjson1_deserializeDocumentCertificateValidity(&sv.Validity, value); err != nil { - return err + sv.RoleArn = ptr.String(jtv) } default: @@ -46535,7 +48657,7 @@ func awsRestjson1_deserializeDocumentCertificateDescription(v **types.Certificat return nil } -func awsRestjson1_deserializeDocumentCertificateProviderAccountDefaultForOperations(v *[]types.CertificateProviderOperation, value interface{}) error { +func awsRestjson1_deserializeDocumentCodeSigning(v **types.CodeSigning, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46543,35 +48665,49 @@ func awsRestjson1_deserializeDocumentCertificateProviderAccountDefaultForOperati return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.CertificateProviderOperation + var sv *types.CodeSigning if *v == nil { - cv = []types.CertificateProviderOperation{} + sv = &types.CodeSigning{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.CertificateProviderOperation - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateProviderOperation to be of type string, got %T instead", value) + for key, value := range shape { + switch key { + case "awsSignerJobId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SigningJobId to be of type string, got %T instead", value) + } + sv.AwsSignerJobId = ptr.String(jtv) } - col = types.CertificateProviderOperation(jtv) - } - cv = append(cv, col) + case "customCodeSigning": + if err := awsRestjson1_deserializeDocumentCustomCodeSigning(&sv.CustomCodeSigning, value); err != nil { + return err + } + + case "startSigningJobParameter": + if err := awsRestjson1_deserializeDocumentStartSigningJobParameter(&sv.StartSigningJobParameter, value); err != nil { + return err + } + + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentCertificateProviders(v *[]types.CertificateProviderSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentCodeSigningCertificateChain(v **types.CodeSigningCertificateChain, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46579,33 +48715,48 @@ func awsRestjson1_deserializeDocumentCertificateProviders(v *[]types.Certificate return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.CertificateProviderSummary + var sv *types.CodeSigningCertificateChain if *v == nil { - cv = []types.CertificateProviderSummary{} + sv = &types.CodeSigningCertificateChain{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.CertificateProviderSummary - destAddr := &col - if err := awsRestjson1_deserializeDocumentCertificateProviderSummary(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "certificateName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CertificateName to be of type string, got %T instead", value) + } + sv.CertificateName = ptr.String(jtv) + } + + case "inlineDocument": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InlineDocument to be of type string, got %T instead", value) + } + sv.InlineDocument = ptr.String(jtv) + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentCertificateProviderSummary(v **types.CertificateProviderSummary, value interface{}) error { +func awsRestjson1_deserializeDocumentCodeSigningSignature(v **types.CodeSigningSignature, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46618,31 +48769,26 @@ func awsRestjson1_deserializeDocumentCertificateProviderSummary(v **types.Certif return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CertificateProviderSummary + var sv *types.CodeSigningSignature if *v == nil { - sv = &types.CertificateProviderSummary{} + sv = &types.CodeSigningSignature{} } else { sv = *v } for key, value := range shape { switch key { - case "certificateProviderArn": + case "inlineDocument": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected CertificateProviderArn to be of type string, got %T instead", value) + return fmt.Errorf("expected Signature to be []byte, got %T instead", value) } - sv.CertificateProviderArn = ptr.String(jtv) - } - - case "certificateProviderName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateProviderName to be of type string, got %T instead", value) + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode Signature, %w", err) } - sv.CertificateProviderName = ptr.String(jtv) + sv.InlineDocument = dv } default: @@ -46654,7 +48800,7 @@ func awsRestjson1_deserializeDocumentCertificateProviderSummary(v **types.Certif return nil } -func awsRestjson1_deserializeDocumentCertificates(v *[]types.Certificate, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandExecutionParameterMap(v *map[string]types.CommandParameterValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46662,33 +48808,34 @@ func awsRestjson1_deserializeDocumentCertificates(v *[]types.Certificate, value return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.Certificate + var mv map[string]types.CommandParameterValue if *v == nil { - cv = []types.Certificate{} + mv = map[string]types.CommandParameterValue{} } else { - cv = *v + mv = *v } - for _, value := range shape { - var col types.Certificate - destAddr := &col - if err := awsRestjson1_deserializeDocumentCertificate(&destAddr, value); err != nil { + for key, value := range shape { + var parsedVal types.CommandParameterValue + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentCommandParameterValue(&destAddr, value); err != nil { return err } - col = *destAddr - cv = append(cv, col) + parsedVal = *destAddr + mv[key] = parsedVal } - *v = cv + *v = mv return nil } -func awsRestjson1_deserializeDocumentCertificateStateException(v **types.CertificateStateException, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandExecutionResult(v **types.CommandExecutionResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46701,22 +48848,44 @@ func awsRestjson1_deserializeDocumentCertificateStateException(v **types.Certifi return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CertificateStateException + var sv *types.CommandExecutionResult if *v == nil { - sv = &types.CertificateStateException{} + sv = &types.CommandExecutionResult{} } else { sv = *v } for key, value := range shape { switch key { - case "message", "Message": + case "B": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected BooleanCommandExecutionResult to be of type *bool, got %T instead", value) + } + sv.B = ptr.Bool(jtv) + } + + case "BIN": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value) + return fmt.Errorf("expected BinaryCommandExecutionResult to be []byte, got %T instead", value) } - sv.Message = ptr.String(jtv) + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode BinaryCommandExecutionResult, %w", err) + } + sv.BIN = dv + } + + case "S": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StringCommandExecutionResult to be of type string, got %T instead", value) + } + sv.S = ptr.String(jtv) } default: @@ -46728,7 +48897,7 @@ func awsRestjson1_deserializeDocumentCertificateStateException(v **types.Certifi return nil } -func awsRestjson1_deserializeDocumentCertificateValidationException(v **types.CertificateValidationException, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandExecutionResultMap(v *map[string]types.CommandExecutionResult, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46741,34 +48910,29 @@ func awsRestjson1_deserializeDocumentCertificateValidationException(v **types.Ce return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CertificateValidationException + var mv map[string]types.CommandExecutionResult if *v == nil { - sv = &types.CertificateValidationException{} + mv = map[string]types.CommandExecutionResult{} } else { - sv = *v + mv = *v } for key, value := range shape { - switch key { - case "message", "Message": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage2 to be of type string, got %T instead", value) - } - sv.Message = ptr.String(jtv) - } - - default: - _, _ = key, value - + var parsedVal types.CommandExecutionResult + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentCommandExecutionResult(&destAddr, value); err != nil { + return err } + parsedVal = *destAddr + mv[key] = parsedVal + } - *v = sv + *v = mv return nil } -func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateValidity, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandExecutionSummary(v **types.CommandExecutionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46781,16 +48945,25 @@ func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateVa return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CertificateValidity + var sv *types.CommandExecutionSummary if *v == nil { - sv = &types.CertificateValidity{} + sv = &types.CommandExecutionSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "notAfter": + case "commandArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandArn to be of type string, got %T instead", value) + } + sv.CommandArn = ptr.String(jtv) + } + + case "completedAt": if value != nil { switch jtv := value.(type) { case json.Number: @@ -46798,7 +48971,7 @@ func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateVa if err != nil { return err } - sv.NotAfter = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.CompletedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) @@ -46806,7 +48979,7 @@ func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateVa } } - case "notBefore": + case "createdAt": if value != nil { switch jtv := value.(type) { case json.Number: @@ -46814,7 +48987,32 @@ func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateVa if err != nil { return err } - sv.NotBefore = ptr.Time(smithytime.ParseEpochSeconds(f64)) + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) + + } + } + + case "executionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandExecutionId to be of type string, got %T instead", value) + } + sv.ExecutionId = ptr.String(jtv) + } + + case "startedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.StartedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) default: return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) @@ -46822,6 +49020,24 @@ func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateVa } } + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandExecutionStatus to be of type string, got %T instead", value) + } + sv.Status = types.CommandExecutionStatus(jtv) + } + + case "targetArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TargetArn to be of type string, got %T instead", value) + } + sv.TargetArn = ptr.String(jtv) + } + default: _, _ = key, value @@ -46831,7 +49047,7 @@ func awsRestjson1_deserializeDocumentCertificateValidity(v **types.CertificateVa return nil } -func awsRestjson1_deserializeDocumentCidrs(v *[]string, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandExecutionSummaryList(v *[]types.CommandExecutionSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46844,22 +49060,20 @@ func awsRestjson1_deserializeDocumentCidrs(v *[]string, value interface{}) error return fmt.Errorf("unexpected JSON type %v", value) } - var cv []string + var cv []types.CommandExecutionSummary if *v == nil { - cv = []string{} + cv = []types.CommandExecutionSummary{} } else { cv = *v } for _, value := range shape { - var col string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Cidr to be of type string, got %T instead", value) - } - col = jtv + var col types.CommandExecutionSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentCommandExecutionSummary(&destAddr, value); err != nil { + return err } + col = *destAddr cv = append(cv, col) } @@ -46867,7 +49081,7 @@ func awsRestjson1_deserializeDocumentCidrs(v *[]string, value interface{}) error return nil } -func awsRestjson1_deserializeDocumentClientCertificateConfig(v **types.ClientCertificateConfig, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandParameter(v **types.CommandParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46880,22 +49094,41 @@ func awsRestjson1_deserializeDocumentClientCertificateConfig(v **types.ClientCer return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ClientCertificateConfig + var sv *types.CommandParameter if *v == nil { - sv = &types.ClientCertificateConfig{} + sv = &types.CommandParameter{} } else { sv = *v } for key, value := range shape { switch key { - case "clientCertificateCallbackArn": + case "defaultValue": + if err := awsRestjson1_deserializeDocumentCommandParameterValue(&sv.DefaultValue, value); err != nil { + return err + } + + case "description": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ClientCertificateCallbackArn to be of type string, got %T instead", value) + return fmt.Errorf("expected CommandParameterDescription to be of type string, got %T instead", value) } - sv.ClientCertificateCallbackArn = ptr.String(jtv) + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandParameterName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "value": + if err := awsRestjson1_deserializeDocumentCommandParameterValue(&sv.Value, value); err != nil { + return err } default: @@ -46907,7 +49140,7 @@ func awsRestjson1_deserializeDocumentClientCertificateConfig(v **types.ClientCer return nil } -func awsRestjson1_deserializeDocumentClientProperties(v *map[string]string, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandParameterList(v *[]types.CommandParameter, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46915,35 +49148,33 @@ func awsRestjson1_deserializeDocumentClientProperties(v *map[string]string, valu return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var mv map[string]string + var cv []types.CommandParameter if *v == nil { - mv = map[string]string{} + cv = []types.CommandParameter{} } else { - mv = *v + cv = *v } - for key, value := range shape { - var parsedVal string - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - parsedVal = jtv + for _, value := range shape { + var col types.CommandParameter + destAddr := &col + if err := awsRestjson1_deserializeDocumentCommandParameter(&destAddr, value); err != nil { + return err } - mv[key] = parsedVal + col = *destAddr + cv = append(cv, col) } - *v = mv + *v = cv return nil } -func awsRestjson1_deserializeDocumentCloudwatchAlarmAction(v **types.CloudwatchAlarmAction, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandParameterValue(v **types.CommandParameterValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -46956,49 +49187,113 @@ func awsRestjson1_deserializeDocumentCloudwatchAlarmAction(v **types.CloudwatchA return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CloudwatchAlarmAction + var sv *types.CommandParameterValue if *v == nil { - sv = &types.CloudwatchAlarmAction{} + sv = &types.CommandParameterValue{} } else { sv = *v } for key, value := range shape { switch key { - case "alarmName": + case "B": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected AlarmName to be of type string, got %T instead", value) + return fmt.Errorf("expected BooleanParameterValue to be of type *bool, got %T instead", value) } - sv.AlarmName = ptr.String(jtv) + sv.B = ptr.Bool(jtv) } - case "roleArn": + case "BIN": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) + return fmt.Errorf("expected BinaryParameterValue to be []byte, got %T instead", value) } - sv.RoleArn = ptr.String(jtv) + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode BinaryParameterValue, %w", err) + } + sv.BIN = dv } - case "stateReason": + case "D": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.D = 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.D = ptr.Float64(f64) + + default: + return fmt.Errorf("expected DoubleParameterValue to be a JSON Number, got %T instead", value) + + } + } + + case "I": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected IntegerParameterValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.I = ptr.Int32(int32(i64)) + } + + case "L": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected LongParameterValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.L = ptr.Int64(i64) + } + + case "S": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected StateReason to be of type string, got %T instead", value) + return fmt.Errorf("expected StringParameterValue to be of type string, got %T instead", value) } - sv.StateReason = ptr.String(jtv) + sv.S = ptr.String(jtv) } - case "stateValue": + case "UL": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected StateValue to be of type string, got %T instead", value) + return fmt.Errorf("expected UnsignedLongParameterValue to be of type string, got %T instead", value) } - sv.StateValue = ptr.String(jtv) + sv.UL = ptr.String(jtv) } default: @@ -47010,7 +49305,7 @@ func awsRestjson1_deserializeDocumentCloudwatchAlarmAction(v **types.CloudwatchA return nil } -func awsRestjson1_deserializeDocumentCloudwatchLogsAction(v **types.CloudwatchLogsAction, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandPayload(v **types.CommandPayload, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -47023,40 +49318,35 @@ func awsRestjson1_deserializeDocumentCloudwatchLogsAction(v **types.CloudwatchLo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CloudwatchLogsAction + var sv *types.CommandPayload if *v == nil { - sv = &types.CloudwatchLogsAction{} + sv = &types.CommandPayload{} } else { sv = *v } for key, value := range shape { switch key { - case "batchMode": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected BatchMode to be of type *bool, got %T instead", value) - } - sv.BatchMode = ptr.Bool(jtv) - } - - case "logGroupName": + case "content": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected LogGroupName to be of type string, got %T instead", value) + return fmt.Errorf("expected CommandPayloadBlob to be []byte, got %T instead", value) } - sv.LogGroupName = ptr.String(jtv) + dv, err := base64.StdEncoding.DecodeString(jtv) + if err != nil { + return fmt.Errorf("failed to base64 decode CommandPayloadBlob, %w", err) + } + sv.Content = dv } - case "roleArn": + case "contentType": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) + return fmt.Errorf("expected MimeType to be of type string, got %T instead", value) } - sv.RoleArn = ptr.String(jtv) + sv.ContentType = ptr.String(jtv) } default: @@ -47068,7 +49358,7 @@ func awsRestjson1_deserializeDocumentCloudwatchLogsAction(v **types.CloudwatchLo return nil } -func awsRestjson1_deserializeDocumentCloudwatchMetricAction(v **types.CloudwatchMetricAction, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandSummary(v **types.CommandSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -47081,166 +49371,90 @@ func awsRestjson1_deserializeDocumentCloudwatchMetricAction(v **types.Cloudwatch return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CloudwatchMetricAction + var sv *types.CommandSummary if *v == nil { - sv = &types.CloudwatchMetricAction{} + sv = &types.CommandSummary{} } else { sv = *v } for key, value := range shape { switch key { - case "metricName": + case "commandArn": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected CommandArn to be of type string, got %T instead", value) } - sv.MetricName = ptr.String(jtv) + sv.CommandArn = ptr.String(jtv) } - case "metricNamespace": + case "commandId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected CommandId to be of type string, got %T instead", value) } - sv.MetricNamespace = ptr.String(jtv) + sv.CommandId = ptr.String(jtv) } - case "metricTimestamp": + case "createdAt": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.MetricTimestamp = ptr.String(jtv) - } + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - case "metricUnit": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.MetricUnit = ptr.String(jtv) - } + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - case "metricValue": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) } - sv.MetricValue = ptr.String(jtv) } - case "roleArn": + case "deprecated": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected AwsArn to be of type string, got %T instead", value) + return fmt.Errorf("expected DeprecationFlag to be of type *bool, got %T instead", value) } - sv.RoleArn = ptr.String(jtv) + sv.Deprecated = ptr.Bool(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCodeSigning(v **types.CodeSigning, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", 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.CodeSigning - if *v == nil { - sv = &types.CodeSigning{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "awsSignerJobId": + case "displayName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected SigningJobId to be of type string, got %T instead", value) + return fmt.Errorf("expected DisplayName to be of type string, got %T instead", value) } - sv.AwsSignerJobId = ptr.String(jtv) - } - - case "customCodeSigning": - if err := awsRestjson1_deserializeDocumentCustomCodeSigning(&sv.CustomCodeSigning, value); err != nil { - return err - } - - case "startSigningJobParameter": - if err := awsRestjson1_deserializeDocumentStartSigningJobParameter(&sv.StartSigningJobParameter, value); err != nil { - return err + sv.DisplayName = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsRestjson1_deserializeDocumentCodeSigningCertificateChain(v **types.CodeSigningCertificateChain, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } + case "lastUpdatedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastUpdatedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) - var sv *types.CodeSigningCertificateChain - if *v == nil { - sv = &types.CodeSigningCertificateChain{} - } else { - sv = *v - } + default: + return fmt.Errorf("expected DateType to be a JSON Number, got %T instead", value) - for key, value := range shape { - switch key { - case "certificateName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected CertificateName to be of type string, got %T instead", value) } - sv.CertificateName = ptr.String(jtv) } - case "inlineDocument": + case "pendingDeletion": if value != nil { - jtv, ok := value.(string) + jtv, ok := value.(bool) if !ok { - return fmt.Errorf("expected InlineDocument to be of type string, got %T instead", value) + return fmt.Errorf("expected BooleanWrapperObject to be of type *bool, got %T instead", value) } - sv.InlineDocument = ptr.String(jtv) + sv.PendingDeletion = ptr.Bool(jtv) } default: @@ -47252,7 +49466,7 @@ func awsRestjson1_deserializeDocumentCodeSigningCertificateChain(v **types.CodeS return nil } -func awsRestjson1_deserializeDocumentCodeSigningSignature(v **types.CodeSigningSignature, value interface{}) error { +func awsRestjson1_deserializeDocumentCommandSummaryList(v *[]types.CommandSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -47260,39 +49474,29 @@ func awsRestjson1_deserializeDocumentCodeSigningSignature(v **types.CodeSigningS return nil } - shape, ok := value.(map[string]interface{}) + shape, ok := value.([]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.CodeSigningSignature + var cv []types.CommandSummary if *v == nil { - sv = &types.CodeSigningSignature{} + cv = []types.CommandSummary{} } else { - sv = *v + cv = *v } - for key, value := range shape { - switch key { - case "inlineDocument": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Signature to be []byte, got %T instead", value) - } - dv, err := base64.StdEncoding.DecodeString(jtv) - if err != nil { - return fmt.Errorf("failed to base64 decode Signature, %w", err) - } - sv.InlineDocument = dv - } - - default: - _, _ = key, value - + for _, value := range shape { + var col types.CommandSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentCommandSummary(&destAddr, value); err != nil { + return err } + col = *destAddr + cv = append(cv, col) + } - *v = sv + *v = cv return nil } @@ -58551,6 +60755,55 @@ func awsRestjson1_deserializeDocumentStatistics(v **types.Statistics, value inte return nil } +func awsRestjson1_deserializeDocumentStatusReason(v **types.StatusReason, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.StatusReason + if *v == nil { + sv = &types.StatusReason{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "reasonCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusReasonCode to be of type string, got %T instead", value) + } + sv.ReasonCode = ptr.String(jtv) + } + + case "reasonDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StatusReasonDescription to be of type string, got %T instead", value) + } + sv.ReasonDescription = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentStepFunctionsAction(v **types.StepFunctionsAction, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/iot/generated.json b/service/iot/generated.json index c5c823ba6a8..b6427d91c0f 100644 --- a/service/iot/generated.json +++ b/service/iot/generated.json @@ -30,6 +30,7 @@ "api_op_CreateBillingGroup.go", "api_op_CreateCertificateFromCsr.go", "api_op_CreateCertificateProvider.go", + "api_op_CreateCommand.go", "api_op_CreateCustomMetric.go", "api_op_CreateDimension.go", "api_op_CreateDomainConfiguration.go", @@ -63,6 +64,8 @@ "api_op_DeleteCACertificate.go", "api_op_DeleteCertificate.go", "api_op_DeleteCertificateProvider.go", + "api_op_DeleteCommand.go", + "api_op_DeleteCommandExecution.go", "api_op_DeleteCustomMetric.go", "api_op_DeleteDimension.go", "api_op_DeleteDomainConfiguration.go", @@ -135,6 +138,8 @@ "api_op_GetBehaviorModelTrainingSummaries.go", "api_op_GetBucketsAggregation.go", "api_op_GetCardinality.go", + "api_op_GetCommand.go", + "api_op_GetCommandExecution.go", "api_op_GetEffectivePolicies.go", "api_op_GetIndexingConfiguration.go", "api_op_GetJobDocument.go", @@ -164,6 +169,8 @@ "api_op_ListCertificateProviders.go", "api_op_ListCertificates.go", "api_op_ListCertificatesByCA.go", + "api_op_ListCommandExecutions.go", + "api_op_ListCommands.go", "api_op_ListCustomMetrics.go", "api_op_ListDetectMitigationActionsExecutions.go", "api_op_ListDetectMitigationActionsTasks.go", @@ -246,6 +253,7 @@ "api_op_UpdateCACertificate.go", "api_op_UpdateCertificate.go", "api_op_UpdateCertificateProvider.go", + "api_op_UpdateCommand.go", "api_op_UpdateCustomMetric.go", "api_op_UpdateDimension.go", "api_op_UpdateDomainConfiguration.go", diff --git a/service/iot/serializers.go b/service/iot/serializers.go index 09cc8a00cbd..56e1a365473 100644 --- a/service/iot/serializers.go +++ b/service/iot/serializers.go @@ -1999,6 +1999,136 @@ func awsRestjson1_serializeOpDocumentCreateCertificateProviderInput(v *CreateCer return nil } +type awsRestjson1_serializeOpCreateCommand struct { +} + +func (*awsRestjson1_serializeOpCreateCommand) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateCommand) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateCommandInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/commands/{commandId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsCreateCommandInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateCommandInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateCommandInput(v *CreateCommandInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CommandId == nil || len(*v.CommandId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member commandId must not be empty")} + } + if v.CommandId != nil { + if err := encoder.SetURI("commandId").String(*v.CommandId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateCommandInput(v *CreateCommandInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.DisplayName != nil { + ok := object.Key("displayName") + ok.String(*v.DisplayName) + } + + if v.MandatoryParameters != nil { + ok := object.Key("mandatoryParameters") + if err := awsRestjson1_serializeDocumentCommandParameterList(v.MandatoryParameters, ok); err != nil { + return err + } + } + + if len(v.Namespace) > 0 { + ok := object.Key("namespace") + ok.String(string(v.Namespace)) + } + + if v.Payload != nil { + ok := object.Key("payload") + if err := awsRestjson1_serializeDocumentCommandPayload(v.Payload, ok); err != nil { + return err + } + } + + if v.RoleArn != nil { + ok := object.Key("roleArn") + ok.String(*v.RoleArn) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpCreateCustomMetric struct { } @@ -5546,6 +5676,152 @@ func awsRestjson1_serializeOpHttpBindingsDeleteCertificateProviderInput(v *Delet return nil } +type awsRestjson1_serializeOpDeleteCommand struct { +} + +func (*awsRestjson1_serializeOpDeleteCommand) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteCommand) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteCommandInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/commands/{commandId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteCommandInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteCommandInput(v *DeleteCommandInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CommandId == nil || len(*v.CommandId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member commandId must not be empty")} + } + if v.CommandId != nil { + if err := encoder.SetURI("commandId").String(*v.CommandId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteCommandExecution struct { +} + +func (*awsRestjson1_serializeOpDeleteCommandExecution) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteCommandExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteCommandExecutionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/command-executions/{executionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteCommandExecutionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteCommandExecutionInput(v *DeleteCommandExecutionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ExecutionId == nil || len(*v.ExecutionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member executionId must not be empty")} + } + if v.ExecutionId != nil { + if err := encoder.SetURI("executionId").String(*v.ExecutionId); err != nil { + return err + } + } + + if v.TargetArn != nil { + encoder.SetQuery("targetArn").String(*v.TargetArn) + } + + return nil +} + type awsRestjson1_serializeOpDeleteCustomMetric struct { } @@ -10877,6 +11153,156 @@ func awsRestjson1_serializeOpDocumentGetCardinalityInput(v *GetCardinalityInput, return nil } +type awsRestjson1_serializeOpGetCommand struct { +} + +func (*awsRestjson1_serializeOpGetCommand) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetCommand) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCommandInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/commands/{commandId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetCommandInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetCommandInput(v *GetCommandInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CommandId == nil || len(*v.CommandId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member commandId must not be empty")} + } + if v.CommandId != nil { + if err := encoder.SetURI("commandId").String(*v.CommandId); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetCommandExecution struct { +} + +func (*awsRestjson1_serializeOpGetCommandExecution) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetCommandExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetCommandExecutionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/command-executions/{executionId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetCommandExecutionInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetCommandExecutionInput(v *GetCommandExecutionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ExecutionId == nil || len(*v.ExecutionId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member executionId must not be empty")} + } + if v.ExecutionId != nil { + if err := encoder.SetURI("executionId").String(*v.ExecutionId); err != nil { + return err + } + } + + if v.IncludeResult != nil { + encoder.SetQuery("includeResult").Boolean(*v.IncludeResult) + } + + if v.TargetArn != nil { + encoder.SetQuery("targetArn").String(*v.TargetArn) + } + + return nil +} + type awsRestjson1_serializeOpGetEffectivePolicies struct { } @@ -13021,16 +13447,173 @@ func (m *awsRestjson1_serializeOpListCertificates) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListCertificatesInput) + input, ok := in.Parameters.(*ListCertificatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/certificates") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListCertificatesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListCertificatesInput(v *ListCertificatesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AscendingOrder { + encoder.SetQuery("isAscendingOrder").Boolean(v.AscendingOrder) + } + + if v.Marker != nil { + encoder.SetQuery("marker").String(*v.Marker) + } + + if v.PageSize != nil { + encoder.SetQuery("pageSize").Integer(*v.PageSize) + } + + return nil +} + +type awsRestjson1_serializeOpListCertificatesByCA struct { +} + +func (*awsRestjson1_serializeOpListCertificatesByCA) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListCertificatesByCA) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListCertificatesByCAInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/certificates-by-ca/{caCertificateId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListCertificatesByCAInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListCertificatesByCAInput(v *ListCertificatesByCAInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AscendingOrder { + encoder.SetQuery("isAscendingOrder").Boolean(v.AscendingOrder) + } + + if v.CaCertificateId == nil || len(*v.CaCertificateId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member caCertificateId must not be empty")} + } + if v.CaCertificateId != nil { + if err := encoder.SetURI("caCertificateId").String(*v.CaCertificateId); err != nil { + return err + } + } + + if v.Marker != nil { + encoder.SetQuery("marker").String(*v.Marker) + } + + if v.PageSize != nil { + encoder.SetQuery("pageSize").Integer(*v.PageSize) + } + + return nil +} + +type awsRestjson1_serializeOpListCommandExecutions struct { +} + +func (*awsRestjson1_serializeOpListCommandExecutions) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListCommandExecutions) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListCommandExecutionsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/certificates") + opPath, opQuery := httpbinding.SplitURI("/command-executions") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) - request.Method = "GET" + request.Method = "POST" var restEncoder *httpbinding.Encoder if request.URL.RawPath == "" { restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) @@ -13043,7 +13626,18 @@ func (m *awsRestjson1_serializeOpListCertificates) HandleSerialize(ctx context.C return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListCertificatesInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListCommandExecutionsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListCommandExecutionsInput(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} } @@ -13056,34 +13650,76 @@ func (m *awsRestjson1_serializeOpListCertificates) HandleSerialize(ctx context.C span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListCertificatesInput(v *ListCertificatesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCommandExecutionsInput(v *ListCommandExecutionsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AscendingOrder { - encoder.SetQuery("isAscendingOrder").Boolean(v.AscendingOrder) + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.Marker != nil { - encoder.SetQuery("marker").String(*v.Marker) + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } - if v.PageSize != nil { - encoder.SetQuery("pageSize").Integer(*v.PageSize) + return nil +} + +func awsRestjson1_serializeOpDocumentListCommandExecutionsInput(v *ListCommandExecutionsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.CommandArn != nil { + ok := object.Key("commandArn") + ok.String(*v.CommandArn) + } + + if v.CompletedTimeFilter != nil { + ok := object.Key("completedTimeFilter") + if err := awsRestjson1_serializeDocumentTimeFilter(v.CompletedTimeFilter, ok); err != nil { + return err + } + } + + if len(v.Namespace) > 0 { + ok := object.Key("namespace") + ok.String(string(v.Namespace)) + } + + if len(v.SortOrder) > 0 { + ok := object.Key("sortOrder") + ok.String(string(v.SortOrder)) + } + + if v.StartedTimeFilter != nil { + ok := object.Key("startedTimeFilter") + if err := awsRestjson1_serializeDocumentTimeFilter(v.StartedTimeFilter, ok); err != nil { + return err + } + } + + if len(v.Status) > 0 { + ok := object.Key("status") + ok.String(string(v.Status)) + } + + if v.TargetArn != nil { + ok := object.Key("targetArn") + ok.String(*v.TargetArn) } return nil } -type awsRestjson1_serializeOpListCertificatesByCA struct { +type awsRestjson1_serializeOpListCommands struct { } -func (*awsRestjson1_serializeOpListCertificatesByCA) ID() string { +func (*awsRestjson1_serializeOpListCommands) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpListCertificatesByCA) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpListCommands) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -13095,13 +13731,13 @@ func (m *awsRestjson1_serializeOpListCertificatesByCA) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*ListCertificatesByCAInput) + input, ok := in.Parameters.(*ListCommandsInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/certificates-by-ca/{caCertificateId}") + opPath, opQuery := httpbinding.SplitURI("/commands") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "GET" @@ -13117,7 +13753,7 @@ func (m *awsRestjson1_serializeOpListCertificatesByCA) HandleSerialize(ctx conte return out, metadata, &smithy.SerializationError{Err: err} } - if err := awsRestjson1_serializeOpHttpBindingsListCertificatesByCAInput(input, restEncoder); err != nil { + if err := awsRestjson1_serializeOpHttpBindingsListCommandsInput(input, restEncoder); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -13130,30 +13766,29 @@ func (m *awsRestjson1_serializeOpListCertificatesByCA) HandleSerialize(ctx conte span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsListCertificatesByCAInput(v *ListCertificatesByCAInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsListCommandsInput(v *ListCommandsInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } - if v.AscendingOrder { - encoder.SetQuery("isAscendingOrder").Boolean(v.AscendingOrder) + if v.CommandParameterName != nil { + encoder.SetQuery("commandParameterName").String(*v.CommandParameterName) } - if v.CaCertificateId == nil || len(*v.CaCertificateId) == 0 { - return &smithy.SerializationError{Err: fmt.Errorf("input member caCertificateId must not be empty")} + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) } - if v.CaCertificateId != nil { - if err := encoder.SetURI("caCertificateId").String(*v.CaCertificateId); err != nil { - return err - } + + if len(v.Namespace) > 0 { + encoder.SetQuery("namespace").String(string(v.Namespace)) } - if v.Marker != nil { - encoder.SetQuery("marker").String(*v.Marker) + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) } - if v.PageSize != nil { - encoder.SetQuery("pageSize").Integer(*v.PageSize) + if len(v.SortOrder) > 0 { + encoder.SetQuery("sortOrder").String(string(v.SortOrder)) } return nil @@ -20139,6 +20774,110 @@ func awsRestjson1_serializeOpDocumentUpdateCertificateProviderInput(v *UpdateCer return nil } +type awsRestjson1_serializeOpUpdateCommand struct { +} + +func (*awsRestjson1_serializeOpUpdateCommand) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateCommand) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateCommandInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/commands/{commandId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PATCH" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateCommandInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateCommandInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateCommandInput(v *UpdateCommandInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.CommandId == nil || len(*v.CommandId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member commandId must not be empty")} + } + if v.CommandId != nil { + if err := encoder.SetURI("commandId").String(*v.CommandId); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateCommandInput(v *UpdateCommandInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Deprecated != nil { + ok := object.Key("deprecated") + ok.Boolean(*v.Deprecated) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.DisplayName != nil { + ok := object.Key("displayName") + ok.String(*v.DisplayName) + } + + return nil +} + type awsRestjson1_serializeOpUpdateCustomMetric struct { } @@ -23757,6 +24496,122 @@ func awsRestjson1_serializeDocumentCodeSigningSignature(v *types.CodeSigningSign return nil } +func awsRestjson1_serializeDocumentCommandParameter(v *types.CommandParameter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DefaultValue != nil { + ok := object.Key("defaultValue") + if err := awsRestjson1_serializeDocumentCommandParameterValue(v.DefaultValue, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Value != nil { + ok := object.Key("value") + if err := awsRestjson1_serializeDocumentCommandParameterValue(v.Value, ok); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeDocumentCommandParameterList(v []types.CommandParameter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCommandParameter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCommandParameterValue(v *types.CommandParameterValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.B != nil { + ok := object.Key("B") + ok.Boolean(*v.B) + } + + if v.BIN != nil { + ok := object.Key("BIN") + ok.Base64EncodeBytes(v.BIN) + } + + if v.D != nil { + ok := object.Key("D") + switch { + case math.IsNaN(*v.D): + ok.String("NaN") + + case math.IsInf(*v.D, 1): + ok.String("Infinity") + + case math.IsInf(*v.D, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.D) + + } + } + + if v.I != nil { + ok := object.Key("I") + ok.Integer(*v.I) + } + + if v.L != nil { + ok := object.Key("L") + ok.Long(*v.L) + } + + if v.S != nil { + ok := object.Key("S") + ok.String(*v.S) + } + + if v.UL != nil { + ok := object.Key("UL") + ok.String(*v.UL) + } + + return nil +} + +func awsRestjson1_serializeDocumentCommandPayload(v *types.CommandPayload, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Content != nil { + ok := object.Key("content") + ok.Base64EncodeBytes(v.Content) + } + + if v.ContentType != nil { + ok := object.Key("contentType") + ok.String(*v.ContentType) + } + + return nil +} + func awsRestjson1_serializeDocumentConfiguration(v *types.Configuration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -26168,6 +27023,23 @@ func awsRestjson1_serializeDocumentThingTypeProperties(v *types.ThingTypePropert return nil } +func awsRestjson1_serializeDocumentTimeFilter(v *types.TimeFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.After != nil { + ok := object.Key("after") + ok.String(*v.After) + } + + if v.Before != nil { + ok := object.Key("before") + ok.String(*v.Before) + } + + return nil +} + func awsRestjson1_serializeDocumentTimeoutConfig(v *types.TimeoutConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/iot/snapshot/api_op_CreateCommand.go.snap b/service/iot/snapshot/api_op_CreateCommand.go.snap new file mode 100644 index 00000000000..e95c30fa3ec --- /dev/null +++ b/service/iot/snapshot/api_op_CreateCommand.go.snap @@ -0,0 +1,41 @@ +CreateCommand + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_DeleteCommand.go.snap b/service/iot/snapshot/api_op_DeleteCommand.go.snap new file mode 100644 index 00000000000..e51a5911318 --- /dev/null +++ b/service/iot/snapshot/api_op_DeleteCommand.go.snap @@ -0,0 +1,41 @@ +DeleteCommand + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_DeleteCommandExecution.go.snap b/service/iot/snapshot/api_op_DeleteCommandExecution.go.snap new file mode 100644 index 00000000000..731e9cc4acd --- /dev/null +++ b/service/iot/snapshot/api_op_DeleteCommandExecution.go.snap @@ -0,0 +1,41 @@ +DeleteCommandExecution + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_GetCommand.go.snap b/service/iot/snapshot/api_op_GetCommand.go.snap new file mode 100644 index 00000000000..db42e5ef2d3 --- /dev/null +++ b/service/iot/snapshot/api_op_GetCommand.go.snap @@ -0,0 +1,41 @@ +GetCommand + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_GetCommandExecution.go.snap b/service/iot/snapshot/api_op_GetCommandExecution.go.snap new file mode 100644 index 00000000000..cb148e6ed04 --- /dev/null +++ b/service/iot/snapshot/api_op_GetCommandExecution.go.snap @@ -0,0 +1,41 @@ +GetCommandExecution + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_ListCommandExecutions.go.snap b/service/iot/snapshot/api_op_ListCommandExecutions.go.snap new file mode 100644 index 00000000000..4d84ea95182 --- /dev/null +++ b/service/iot/snapshot/api_op_ListCommandExecutions.go.snap @@ -0,0 +1,40 @@ +ListCommandExecutions + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_ListCommands.go.snap b/service/iot/snapshot/api_op_ListCommands.go.snap new file mode 100644 index 00000000000..abb105e4bfd --- /dev/null +++ b/service/iot/snapshot/api_op_ListCommands.go.snap @@ -0,0 +1,40 @@ +ListCommands + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot/api_op_UpdateCommand.go.snap b/service/iot/snapshot/api_op_UpdateCommand.go.snap new file mode 100644 index 00000000000..25ed44a19b8 --- /dev/null +++ b/service/iot/snapshot/api_op_UpdateCommand.go.snap @@ -0,0 +1,41 @@ +UpdateCommand + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iot/snapshot_test.go b/service/iot/snapshot_test.go index 1838f2f1f38..a58d274958a 100644 --- a/service/iot/snapshot_test.go +++ b/service/iot/snapshot_test.go @@ -326,6 +326,18 @@ func TestCheckSnapshot_CreateCertificateProvider(t *testing.T) { } } +func TestCheckSnapshot_CreateCommand(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateCommand(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateCommand") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateCustomMetric(t *testing.T) { svc := New(Options{}) _, err := svc.CreateCustomMetric(context.Background(), nil, func(o *Options) { @@ -722,6 +734,30 @@ func TestCheckSnapshot_DeleteCertificateProvider(t *testing.T) { } } +func TestCheckSnapshot_DeleteCommand(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCommand(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteCommand") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteCommandExecution(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCommandExecution(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteCommandExecution") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteCustomMetric(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteCustomMetric(context.Background(), nil, func(o *Options) { @@ -1586,6 +1622,30 @@ func TestCheckSnapshot_GetCardinality(t *testing.T) { } } +func TestCheckSnapshot_GetCommand(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCommand(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetCommand") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetCommandExecution(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCommandExecution(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetCommandExecution") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetEffectivePolicies(t *testing.T) { svc := New(Options{}) _, err := svc.GetEffectivePolicies(context.Background(), nil, func(o *Options) { @@ -1934,6 +1994,30 @@ func TestCheckSnapshot_ListCertificatesByCA(t *testing.T) { } } +func TestCheckSnapshot_ListCommandExecutions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCommandExecutions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListCommandExecutions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListCommands(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCommands(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListCommands") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListCustomMetrics(t *testing.T) { svc := New(Options{}) _, err := svc.ListCustomMetrics(context.Background(), nil, func(o *Options) { @@ -2918,6 +3002,18 @@ func TestCheckSnapshot_UpdateCertificateProvider(t *testing.T) { } } +func TestCheckSnapshot_UpdateCommand(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCommand(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateCommand") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateCustomMetric(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateCustomMetric(context.Background(), nil, func(o *Options) { @@ -3457,6 +3553,18 @@ func TestUpdateSnapshot_CreateCertificateProvider(t *testing.T) { } } +func TestUpdateSnapshot_CreateCommand(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateCommand(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateCommand") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateCustomMetric(t *testing.T) { svc := New(Options{}) _, err := svc.CreateCustomMetric(context.Background(), nil, func(o *Options) { @@ -3853,6 +3961,30 @@ func TestUpdateSnapshot_DeleteCertificateProvider(t *testing.T) { } } +func TestUpdateSnapshot_DeleteCommand(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCommand(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteCommand") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteCommandExecution(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteCommandExecution(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteCommandExecution") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteCustomMetric(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteCustomMetric(context.Background(), nil, func(o *Options) { @@ -4717,6 +4849,30 @@ func TestUpdateSnapshot_GetCardinality(t *testing.T) { } } +func TestUpdateSnapshot_GetCommand(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCommand(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetCommand") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetCommandExecution(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetCommandExecution(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetCommandExecution") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetEffectivePolicies(t *testing.T) { svc := New(Options{}) _, err := svc.GetEffectivePolicies(context.Background(), nil, func(o *Options) { @@ -5065,6 +5221,30 @@ func TestUpdateSnapshot_ListCertificatesByCA(t *testing.T) { } } +func TestUpdateSnapshot_ListCommandExecutions(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCommandExecutions(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListCommandExecutions") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListCommands(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListCommands(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListCommands") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListCustomMetrics(t *testing.T) { svc := New(Options{}) _, err := svc.ListCustomMetrics(context.Background(), nil, func(o *Options) { @@ -6049,6 +6229,18 @@ func TestUpdateSnapshot_UpdateCertificateProvider(t *testing.T) { } } +func TestUpdateSnapshot_UpdateCommand(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateCommand(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateCommand") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateCustomMetric(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateCustomMetric(context.Background(), nil, func(o *Options) { diff --git a/service/iot/types/enums.go b/service/iot/types/enums.go index 31654bc4866..de96224adb7 100644 --- a/service/iot/types/enums.go +++ b/service/iot/types/enums.go @@ -565,6 +565,52 @@ func (CertificateStatus) Values() []CertificateStatus { } } +type CommandExecutionStatus string + +// Enum values for CommandExecutionStatus +const ( + CommandExecutionStatusCreated CommandExecutionStatus = "CREATED" + CommandExecutionStatusInProgress CommandExecutionStatus = "IN_PROGRESS" + CommandExecutionStatusSucceeded CommandExecutionStatus = "SUCCEEDED" + CommandExecutionStatusFailed CommandExecutionStatus = "FAILED" + CommandExecutionStatusRejected CommandExecutionStatus = "REJECTED" + CommandExecutionStatusTimedOut CommandExecutionStatus = "TIMED_OUT" +) + +// Values returns all known values for CommandExecutionStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (CommandExecutionStatus) Values() []CommandExecutionStatus { + return []CommandExecutionStatus{ + "CREATED", + "IN_PROGRESS", + "SUCCEEDED", + "FAILED", + "REJECTED", + "TIMED_OUT", + } +} + +type CommandNamespace string + +// Enum values for CommandNamespace +const ( + CommandNamespaceAWSIoT CommandNamespace = "AWS-IoT" + CommandNamespaceAWSIoTFleetWise CommandNamespace = "AWS-IoT-FleetWise" +) + +// Values returns all known values for CommandNamespace. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (CommandNamespace) Values() []CommandNamespace { + return []CommandNamespace{ + "AWS-IoT", + "AWS-IoT-FleetWise", + } +} + type ComparisonOperator string // Enum values for ComparisonOperator @@ -1533,6 +1579,25 @@ func (ServiceType) Values() []ServiceType { } } +type SortOrder string + +// Enum values for SortOrder +const ( + SortOrderAscending SortOrder = "ASCENDING" + SortOrderDescending SortOrder = "DESCENDING" +) + +// Values returns all known values for SortOrder. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SortOrder) Values() []SortOrder { + return []SortOrder{ + "ASCENDING", + "DESCENDING", + } +} + type Status string // Enum values for Status diff --git a/service/iot/types/errors.go b/service/iot/types/errors.go index 1645209ab20..ea3ca6398b6 100644 --- a/service/iot/types/errors.go +++ b/service/iot/types/errors.go @@ -87,7 +87,7 @@ func (e *CertificateValidationException) ErrorCode() string { } func (e *CertificateValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// A resource with the same name already exists. +// The request conflicts with the current state of the resource. type ConflictException struct { Message *string @@ -596,7 +596,7 @@ func (e *ResourceRegistrationFailureException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// A limit has been exceeded. +// Service quota has been exceeded. type ServiceQuotaExceededException struct { Message *string diff --git a/service/iot/types/types.go b/service/iot/types/types.go index 82f72bc1dd5..cb6a54c1959 100644 --- a/service/iot/types/types.go +++ b/service/iot/types/types.go @@ -1250,6 +1250,160 @@ type CodeSigningSignature struct { noSmithyDocumentSerde } +// The result value of the command execution. The device can use the result field +// to share additional details about the execution such as a return value of a +// remote function call. +// +// This field is not applicable if you use the AWS-IoT-FleetWise namespace. +type CommandExecutionResult struct { + + // An attribute of type Boolean. For example: + // + // "BOOL": true + B *bool + + // An attribute of type Binary. + BIN []byte + + // An attribute of type String. For example: + // + // "S": "Hello" + S *string + + noSmithyDocumentSerde +} + +// Summary information about a particular command execution. +type CommandExecutionSummary struct { + + // The Amazon Resource Name (ARN) of the command execution. + CommandArn *string + + // The date and time at which the command completed executing on the target device. + CompletedAt *time.Time + + // The date and time at which the command execution was created for the target + // device. + CreatedAt *time.Time + + // The unique identifier of the command execution. + ExecutionId *string + + // The date and time at which the command started executing on the target device. + StartedAt *time.Time + + // The status of the command executions. + Status CommandExecutionStatus + + // The Amazon Resource Name (ARN) of the target device for which the command is + // being executed. + TargetArn *string + + noSmithyDocumentSerde +} + +// A map of key-value pairs that describe the command. +type CommandParameter struct { + + // The name of a specific parameter used in a command and command execution. + // + // This member is required. + Name *string + + // The default value used to describe the command. This is the value assumed by + // the parameter if no other value is assigned to it. + DefaultValue *CommandParameterValue + + // The description of the command parameter. + Description *string + + // The value used to describe the command. When you assign a value to a parameter, + // it will override any default value that you had already specified. + Value *CommandParameterValue + + noSmithyDocumentSerde +} + +// The range of possible values that's used to describe a specific command +// parameter. +// +// The commandParameterValue can only have one of the below fields listed. +type CommandParameterValue struct { + + // An attribute of type Boolean. For example: + // + // "BOOL": true + B *bool + + // An attribute of type Binary. For example: + // + // "B": "dGhpcyB0ZXh0IGlzIGJhc2U2NC1lbmNvZGVk" + BIN []byte + + // An attribute of type Double (Sixty-Four Bits). + D *float64 + + // An attribute of type Integer (Thirty-Two Bits). + I *int32 + + // An attribute of type Long. + L *int64 + + // An attribute of type String. For example: + // + // "S": "Hello" + S *string + + // An attribute of type unsigned long. + UL *string + + noSmithyDocumentSerde +} + +// The command payload object that contains the instructions for the device to +// process. +type CommandPayload struct { + + // The static payload file for the command. + Content []byte + + // The content type that specifies the format type of the payload file. This field + // must use a type/subtype format, such as application/json . For information about + // various content types, see [Common MIME types]. + // + // [Common MIME types]: https://developer.mozilla.org/en-US/docs/Web/HTTP/MIME_types/Common_types + ContentType *string + + noSmithyDocumentSerde +} + +// Summary information about a particular command resource. +type CommandSummary struct { + + // The Amazon Resource Name (ARN) of the command. + CommandArn *string + + // The unique identifier of the command. + CommandId *string + + // The timestamp, when the command was created. + CreatedAt *time.Time + + // Indicates whether the command has been deprecated. + Deprecated *bool + + // The display name of the command. + DisplayName *string + + // The timestamp, when the command was last updated. + LastUpdatedAt *time.Time + + // Indicates whether the command is pending deletion. + PendingDeletion *bool + + noSmithyDocumentSerde +} + // Configuration. type Configuration struct { @@ -3725,18 +3879,20 @@ type ServerCertificateConfig struct { // response. The OCSP responder must sign responses using either this authorized // responder certificate or the issuing certificate, depending on whether the ARN // is provided or not. The certificate must be in the same Amazon Web Services - // region and account as the domain configuration. + // account and region as the domain configuration. OcspAuthorizedResponderArn *string // The Amazon Resource Name (ARN) for a Lambda function that acts as a Request for // Comments (RFC) 6960-compliant Online Certificate Status Protocol (OCSP) - // responder, supporting basic OCSP responses. The Lambda function accepts a JSON - // string that's Base64-encoded. Therefore, you must convert your OCSP response, - // which is typically in the Distinguished Encoding Rules (DER) format, into a JSON - // string that's Base64-encoded. The Lambda function's response is also a - // Base64-encoded JSON string and the response payload must not exceed 8 kilobytes - // (KiB) in size. The Lambda function must be in the same Amazon Web Services - // region and account as the domain configuration. + // responder, supporting basic OCSP responses. The Lambda function accepts a + // base64-encoding of the OCSP request in the Distinguished Encoding Rules (DER) + // format. The Lambda function's response is also a base64-encoded OCSP response in + // the DER format. The response size must not exceed 4 kilobytes (KiB). The Lambda + // function must be in the same Amazon Web Services account and region as the + // domain configuration. For more information, see [Configuring server certificate OCSP for private endpoints in Amazon Web Services IoT Core]from the Amazon Web Services + // IoT Core developer guide. + // + // [Configuring server certificate OCSP for private endpoints in Amazon Web Services IoT Core]: https://docs.aws.amazon.com/iot/latest/developerguide/iot-custom-endpoints-cert-config.html#iot-custom-endpoints-cert-config-ocsp-private-endpoint.html OcspLambdaArn *string noSmithyDocumentSerde @@ -3905,6 +4061,22 @@ type Statistics struct { noSmithyDocumentSerde } +// Provide additional context about the status of a command execution using a +// reason code and description. +type StatusReason struct { + + // A code that provides additional context for the command execution status. + // + // This member is required. + ReasonCode *string + + // A literal string for devices to optionally provide additional information about + // the reason code for a command execution status. + ReasonDescription *string + + noSmithyDocumentSerde +} + // Starts execution of a Step Functions state machine. type StepFunctionsAction struct { @@ -4389,6 +4561,21 @@ type ThingTypeProperties struct { noSmithyDocumentSerde } +// A filter that can be used to list command executions for a device that started +// or completed before or after a particular date and time. +type TimeFilter struct { + + // Filter to display command executions that started or completed only after a + // particular date and time. + After *string + + // Filter to display command executions that started or completed only before a + // particular date and time. + Before *string + + noSmithyDocumentSerde +} + // Specifies the amount of time each device has to finish its execution of the // job. A timer is started when the job execution status is set to IN_PROGRESS . If // the job execution status is not set to another terminal state before the timer diff --git a/service/iot/validators.go b/service/iot/validators.go index 8706bba8778..84c2d361735 100644 --- a/service/iot/validators.go +++ b/service/iot/validators.go @@ -390,6 +390,26 @@ func (m *validateOpCreateCertificateProvider) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpCreateCommand struct { +} + +func (*validateOpCreateCommand) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateCommand) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateCommandInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateCommandInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateCustomMetric struct { } @@ -1010,6 +1030,46 @@ func (m *validateOpDeleteCertificateProvider) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpDeleteCommandExecution struct { +} + +func (*validateOpDeleteCommandExecution) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCommandExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCommandExecutionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCommandExecutionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteCommand struct { +} + +func (*validateOpDeleteCommand) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteCommand) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteCommandInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteCommandInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteCustomMetric struct { } @@ -2330,6 +2390,46 @@ func (m *validateOpGetCardinality) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpGetCommandExecution struct { +} + +func (*validateOpGetCommandExecution) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCommandExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCommandExecutionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCommandExecutionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetCommand struct { +} + +func (*validateOpGetCommand) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetCommand) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetCommandInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetCommandInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetJobDocument struct { } @@ -3670,6 +3770,26 @@ func (m *validateOpUpdateCertificateProvider) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpUpdateCommand struct { +} + +func (*validateOpUpdateCommand) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateCommand) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateCommandInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateCommandInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateCustomMetric struct { } @@ -4146,6 +4266,10 @@ func addOpCreateCertificateProviderValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpCreateCertificateProvider{}, middleware.After) } +func addOpCreateCommandValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateCommand{}, middleware.After) +} + func addOpCreateCustomMetricValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateCustomMetric{}, middleware.After) } @@ -4270,6 +4394,14 @@ func addOpDeleteCertificateProviderValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpDeleteCertificateProvider{}, middleware.After) } +func addOpDeleteCommandExecutionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCommandExecution{}, middleware.After) +} + +func addOpDeleteCommandValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteCommand{}, middleware.After) +} + func addOpDeleteCustomMetricValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteCustomMetric{}, middleware.After) } @@ -4534,6 +4666,14 @@ func addOpGetCardinalityValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetCardinality{}, middleware.After) } +func addOpGetCommandExecutionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCommandExecution{}, middleware.After) +} + +func addOpGetCommandValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetCommand{}, middleware.After) +} + func addOpGetJobDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetJobDocument{}, middleware.After) } @@ -4802,6 +4942,10 @@ func addOpUpdateCertificateProviderValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpUpdateCertificateProvider{}, middleware.After) } +func addOpUpdateCommandValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateCommand{}, middleware.After) +} + func addOpUpdateCustomMetricValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateCustomMetric{}, middleware.After) } @@ -5473,6 +5617,38 @@ func validateCloudwatchMetricAction(v *types.CloudwatchMetricAction) error { } } +func validateCommandParameter(v *types.CommandParameter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommandParameter"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCommandParameterList(v []types.CommandParameter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CommandParameterList"} + for i := range v { + if err := validateCommandParameter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDynamoDBAction(v *types.DynamoDBAction) error { if v == nil { return nil @@ -7056,6 +7232,31 @@ func validateOpCreateCertificateProviderInput(v *CreateCertificateProviderInput) } } +func validateOpCreateCommandInput(v *CreateCommandInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateCommandInput"} + if v.CommandId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CommandId")) + } + if v.MandatoryParameters != nil { + if err := validateCommandParameterList(v.MandatoryParameters); err != nil { + invalidParams.AddNested("MandatoryParameters", err.(smithy.InvalidParamsError)) + } + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateCustomMetricInput(v *CreateCustomMetricInput) error { if v == nil { return nil @@ -7787,6 +7988,39 @@ func validateOpDeleteCertificateProviderInput(v *DeleteCertificateProviderInput) } } +func validateOpDeleteCommandExecutionInput(v *DeleteCommandExecutionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCommandExecutionInput"} + if v.ExecutionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionId")) + } + if v.TargetArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteCommandInput(v *DeleteCommandInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteCommandInput"} + if v.CommandId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CommandId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteCustomMetricInput(v *DeleteCustomMetricInput) error { if v == nil { return nil @@ -8825,6 +9059,39 @@ func validateOpGetCardinalityInput(v *GetCardinalityInput) error { } } +func validateOpGetCommandExecutionInput(v *GetCommandExecutionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCommandExecutionInput"} + if v.ExecutionId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionId")) + } + if v.TargetArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetCommandInput(v *GetCommandInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetCommandInput"} + if v.CommandId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CommandId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetJobDocumentInput(v *GetJobDocumentInput) error { if v == nil { return nil @@ -9953,6 +10220,21 @@ func validateOpUpdateCertificateProviderInput(v *UpdateCertificateProviderInput) } } +func validateOpUpdateCommandInput(v *UpdateCommandInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateCommandInput"} + if v.CommandId == nil { + invalidParams.Add(smithy.NewErrParamRequired("CommandId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateCustomMetricInput(v *UpdateCustomMetricInput) error { if v == nil { return nil diff --git a/service/iotfleetwise/api_op_CreateCampaign.go b/service/iotfleetwise/api_op_CreateCampaign.go index b1b2ae74f75..69ba827d09b 100644 --- a/service/iotfleetwise/api_op_CreateCampaign.go +++ b/service/iotfleetwise/api_op_CreateCampaign.go @@ -21,6 +21,11 @@ import ( // For more information, see [Collect and transfer data with campaigns] in the Amazon Web Services IoT FleetWise Developer // Guide. // +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html // [Collect and transfer data with campaigns]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/campaigns.html func (c *Client) CreateCampaign(ctx context.Context, params *CreateCampaignInput, optFns ...func(*Options)) (*CreateCampaignOutput, error) { if params == nil { @@ -61,15 +66,18 @@ type CreateCampaignInput struct { // This member is required. TargetArn *string - // (Optional) Whether to compress signals before transmitting data to Amazon Web + // Determines whether to compress signals before transmitting data to Amazon Web // Services IoT FleetWise. If you don't want to compress the signals, use OFF . If // it's not specified, SNAPPY is used. // // Default: SNAPPY Compression types.Compression - // The destination where the campaign sends data. You can choose to send data to - // be stored in Amazon S3 or Amazon Timestream. + // The destination where the campaign sends data. You can send data to an MQTT + // topic, or store it in Amazon S3 or Amazon Timestream. + // + // MQTT is the publish/subscribe messaging protocol used by Amazon Web Services + // IoT to communicate with your devices. // // Amazon S3 optimizes the cost of data storage and provides additional mechanisms // to use vehicle data, such as data lakes, centralized data storage, data @@ -81,7 +89,7 @@ type CreateCampaignInput struct { // Timestream to query vehicle data so that you can identify trends and patterns. DataDestinationConfigs []types.DataDestinationConfig - // (Optional) A list of vehicle attributes to associate with a campaign. + // A list of vehicle attributes to associate with a campaign. // // Enrich the data with specified vehicle attributes. For example, add make and // model to the campaign, and Amazon Web Services IoT FleetWise will associate the @@ -91,43 +99,50 @@ type CreateCampaignInput struct { // Default: An empty array DataExtraDimensions []string + // The data partitions associated with the signals collected from the vehicle. + DataPartitions []types.DataPartition + // An optional description of the campaign to help identify its purpose. Description *string - // (Optional) Option for a vehicle to send diagnostic trouble codes to Amazon Web - // Services IoT FleetWise. If you want to send diagnostic trouble codes, use + // Option for a vehicle to send diagnostic trouble codes to Amazon Web Services + // IoT FleetWise. If you want to send diagnostic trouble codes, use // SEND_ACTIVE_DTCS . If it's not specified, OFF is used. // // Default: OFF DiagnosticsMode types.DiagnosticsMode - // (Optional) The time the campaign expires, in seconds since epoch (January 1, - // 1970 at midnight UTC time). Vehicle data isn't collected after the campaign - // expires. + // The time the campaign expires, in seconds since epoch (January 1, 1970 at + // midnight UTC time). Vehicle data isn't collected after the campaign expires. // // Default: 253402214400 (December 31, 9999, 00:00:00 UTC) ExpiryTime *time.Time - // (Optional) How long (in milliseconds) to collect raw data after a triggering - // event initiates the collection. If it's not specified, 0 is used. + // How long (in milliseconds) to collect raw data after a triggering event + // initiates the collection. If it's not specified, 0 is used. // // Default: 0 PostTriggerCollectionDuration *int64 - // (Optional) A number indicating the priority of one campaign over another - // campaign for a certain vehicle or fleet. A campaign with the lowest value is - // deployed to vehicles before any other campaigns. If it's not specified, 0 is - // used. + // A number indicating the priority of one campaign over another campaign for a + // certain vehicle or fleet. A campaign with the lowest value is deployed to + // vehicles before any other campaigns. If it's not specified, 0 is used. // // Default: 0 // // Deprecated: priority is no longer used or needed as input Priority *int32 - // (Optional) A list of information about signals to collect. + // A list of information about signals to collect. + // + // If you upload a signal as a condition in a data partition for a campaign, then + // those same signals must be included in signalsToCollect . SignalsToCollect []types.SignalInformation - // (Optional) Whether to store collected data after a vehicle lost a connection + // A list of information about signals to fetch. + SignalsToFetch []types.SignalFetchInformation + + // Determines whether to store collected data after a vehicle lost a connection // with the cloud. After a connection is re-established, the data is automatically // forwarded to Amazon Web Services IoT FleetWise. If you want to store collected // data when a vehicle loses connection with the cloud, use TO_DISK . If it's not @@ -136,8 +151,8 @@ type CreateCampaignInput struct { // Default: OFF SpoolingMode types.SpoolingMode - // (Optional) The time, in milliseconds, to deliver a campaign after it was - // approved. If it's not specified, 0 is used. + // The time, in milliseconds, to deliver a campaign after it was approved. If it's + // not specified, 0 is used. // // Default: 0 StartTime *time.Time diff --git a/service/iotfleetwise/api_op_CreateDecoderManifest.go b/service/iotfleetwise/api_op_CreateDecoderManifest.go index 649130586be..00f05d28071 100644 --- a/service/iotfleetwise/api_op_CreateDecoderManifest.go +++ b/service/iotfleetwise/api_op_CreateDecoderManifest.go @@ -48,7 +48,17 @@ type CreateDecoderManifestInput struct { // This member is required. Name *string - // A brief description of the decoder manifest. + // Use default decoders for all unmapped signals in the model. You don't need to + // provide any detailed decoding information. + // + // Access to certain Amazon Web Services IoT FleetWise features is currently + // gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise + // Developer Guide. + // + // [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html + DefaultForUnmappedSignals types.DefaultForUnmappedSignalsType + + // A brief description of the decoder manifest. Description *string // A list of information about available network interfaces. diff --git a/service/iotfleetwise/api_op_CreateStateTemplate.go b/service/iotfleetwise/api_op_CreateStateTemplate.go new file mode 100644 index 00000000000..15dada6a620 --- /dev/null +++ b/service/iotfleetwise/api_op_CreateStateTemplate.go @@ -0,0 +1,208 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleetwise + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iotfleetwise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a state template. State templates contain state properties, which are +// signals that belong to a signal catalog that is synchronized between the Amazon +// Web Services IoT FleetWise Edge and the Amazon Web Services Cloud. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +func (c *Client) CreateStateTemplate(ctx context.Context, params *CreateStateTemplateInput, optFns ...func(*Options)) (*CreateStateTemplateOutput, error) { + if params == nil { + params = &CreateStateTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateStateTemplate", params, optFns, c.addOperationCreateStateTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateStateTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateStateTemplateInput struct { + + // The name of the state template. + // + // This member is required. + Name *string + + // The ARN of the signal catalog associated with the state template. + // + // This member is required. + SignalCatalogArn *string + + // A list of signals from which data is collected. The state template properties + // contain the fully qualified names of the signals. + // + // This member is required. + StateTemplateProperties []string + + // A list of vehicle attributes to associate with the payload published on the + // state template's MQTT topic. (See [Processing last known state vehicle data using MQTT messaging]). For example, if you add + // Vehicle.Attributes.Make and Vehicle.Attributes.Model attributes, Amazon Web + // Services IoT FleetWise will enrich the protobuf encoded payload with those + // attributes in the extraDimensions field. + // + // [Processing last known state vehicle data using MQTT messaging]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/process-visualize-data.html#process-last-known-state-vehicle-data + DataExtraDimensions []string + + // A brief description of the state template. + Description *string + + // A list of vehicle attributes to associate with user properties of the messages + // published on the state template's MQTT topic. (See [Processing last known state vehicle data using MQTT messaging]). For example, if you add + // Vehicle.Attributes.Make and Vehicle.Attributes.Model attributes, Amazon Web + // Services IoT FleetWise will include these attributes as User Properties with the + // MQTT message. + // + // Default: An empty array + // + // [Processing last known state vehicle data using MQTT messaging]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/process-visualize-data.html#process-last-known-state-vehicle-data + MetadataExtraDimensions []string + + // Metadata that can be used to manage the state template. + Tags []types.Tag + + noSmithyDocumentSerde +} + +type CreateStateTemplateOutput struct { + + // The Amazon Resource Name (ARN) of the state template. + Arn *string + + // The unique ID of the state template. + Id *string + + // The name of the state template. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateStateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpCreateStateTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpCreateStateTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateStateTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateStateTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateStateTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateStateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateStateTemplate", + } +} diff --git a/service/iotfleetwise/api_op_CreateVehicle.go b/service/iotfleetwise/api_op_CreateVehicle.go index 418d33fa46d..2fb9ec69706 100644 --- a/service/iotfleetwise/api_op_CreateVehicle.go +++ b/service/iotfleetwise/api_op_CreateVehicle.go @@ -64,10 +64,15 @@ type CreateVehicleInput struct { // Static information about a vehicle in a key-value pair. For example: // "engineType" : "1.3 L R2" // - // A campaign must include the keys (attribute names) in dataExtraDimensions for - // them to display in Amazon Timestream. + // To use attributes with Campaigns or State Templates, you must include them + // using the request parameters dataExtraDimensions and/or metadataExtraDimensions + // (for state templates only) when creating your campaign/state template. Attributes map[string]string + // Associate state templates with the vehicle. You can monitor the last known + // state of the vehicle in near real time. + StateTemplates []types.StateTemplateAssociation + // Metadata that can be used to manage the vehicle. Tags []types.Tag diff --git a/service/iotfleetwise/api_op_DeleteDecoderManifest.go b/service/iotfleetwise/api_op_DeleteDecoderManifest.go index 4b8e06c135b..fe168134824 100644 --- a/service/iotfleetwise/api_op_DeleteDecoderManifest.go +++ b/service/iotfleetwise/api_op_DeleteDecoderManifest.go @@ -13,9 +13,6 @@ import ( // Deletes a decoder manifest. You can't delete a decoder manifest if it has // // vehicles associated with it. -// -// If the decoder manifest is successfully deleted, Amazon Web Services IoT -// FleetWise sends back an HTTP 200 response with an empty body. func (c *Client) DeleteDecoderManifest(ctx context.Context, params *DeleteDecoderManifestInput, optFns ...func(*Options)) (*DeleteDecoderManifestOutput, error) { if params == nil { params = &DeleteDecoderManifestInput{} diff --git a/service/iotfleetwise/api_op_DeleteFleet.go b/service/iotfleetwise/api_op_DeleteFleet.go index 9c18f7e71d0..6f2bf4f82c4 100644 --- a/service/iotfleetwise/api_op_DeleteFleet.go +++ b/service/iotfleetwise/api_op_DeleteFleet.go @@ -15,9 +15,6 @@ import ( // from the fleet. For more information, see [Delete a fleet (AWS CLI)]in the Amazon Web Services IoT // FleetWise Developer Guide. // -// If the fleet is successfully deleted, Amazon Web Services IoT FleetWise sends -// back an HTTP 200 response with an empty body. -// // [Delete a fleet (AWS CLI)]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/delete-fleet-cli.html func (c *Client) DeleteFleet(ctx context.Context, params *DeleteFleetInput, optFns ...func(*Options)) (*DeleteFleetOutput, error) { if params == nil { diff --git a/service/iotfleetwise/api_op_DeleteModelManifest.go b/service/iotfleetwise/api_op_DeleteModelManifest.go index 3ef78a27737..bf875224206 100644 --- a/service/iotfleetwise/api_op_DeleteModelManifest.go +++ b/service/iotfleetwise/api_op_DeleteModelManifest.go @@ -10,10 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a vehicle model (model manifest). -// -// If the vehicle model is successfully deleted, Amazon Web Services IoT FleetWise -// sends back an HTTP 200 response with an empty body. +// Deletes a vehicle model (model manifest). func (c *Client) DeleteModelManifest(ctx context.Context, params *DeleteModelManifestInput, optFns ...func(*Options)) (*DeleteModelManifestOutput, error) { if params == nil { params = &DeleteModelManifestInput{} diff --git a/service/iotfleetwise/api_op_DeleteSignalCatalog.go b/service/iotfleetwise/api_op_DeleteSignalCatalog.go index 7b3d3f4da0d..d1a8a2c493d 100644 --- a/service/iotfleetwise/api_op_DeleteSignalCatalog.go +++ b/service/iotfleetwise/api_op_DeleteSignalCatalog.go @@ -10,10 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a signal catalog. -// -// If the signal catalog is successfully deleted, Amazon Web Services IoT -// FleetWise sends back an HTTP 200 response with an empty body. +// Deletes a signal catalog. func (c *Client) DeleteSignalCatalog(ctx context.Context, params *DeleteSignalCatalogInput, optFns ...func(*Options)) (*DeleteSignalCatalogOutput, error) { if params == nil { params = &DeleteSignalCatalogInput{} diff --git a/service/iotfleetwise/api_op_DeleteStateTemplate.go b/service/iotfleetwise/api_op_DeleteStateTemplate.go new file mode 100644 index 00000000000..e88eb1863f3 --- /dev/null +++ b/service/iotfleetwise/api_op_DeleteStateTemplate.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleetwise + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a state template. +func (c *Client) DeleteStateTemplate(ctx context.Context, params *DeleteStateTemplateInput, optFns ...func(*Options)) (*DeleteStateTemplateOutput, error) { + if params == nil { + params = &DeleteStateTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteStateTemplate", params, optFns, c.addOperationDeleteStateTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteStateTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteStateTemplateInput struct { + + // A unique, service-generated identifier. + // + // This member is required. + Identifier *string + + noSmithyDocumentSerde +} + +type DeleteStateTemplateOutput struct { + + // The Amazon Resource Name (ARN) of the state template. + Arn *string + + // The unique ID of the state template. + Id *string + + // The name of the state template. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteStateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpDeleteStateTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpDeleteStateTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteStateTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteStateTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteStateTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteStateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteStateTemplate", + } +} diff --git a/service/iotfleetwise/api_op_DeleteVehicle.go b/service/iotfleetwise/api_op_DeleteVehicle.go index a252b042078..1bf3ed5231e 100644 --- a/service/iotfleetwise/api_op_DeleteVehicle.go +++ b/service/iotfleetwise/api_op_DeleteVehicle.go @@ -10,10 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Deletes a vehicle and removes it from any campaigns. -// -// If the vehicle is successfully deleted, Amazon Web Services IoT FleetWise sends -// back an HTTP 200 response with an empty body. +// Deletes a vehicle and removes it from any campaigns. func (c *Client) DeleteVehicle(ctx context.Context, params *DeleteVehicleInput, optFns ...func(*Options)) (*DeleteVehicleOutput, error) { if params == nil { params = &DeleteVehicleInput{} diff --git a/service/iotfleetwise/api_op_DisassociateVehicleFleet.go b/service/iotfleetwise/api_op_DisassociateVehicleFleet.go index d74b065b146..5358c9a8f95 100644 --- a/service/iotfleetwise/api_op_DisassociateVehicleFleet.go +++ b/service/iotfleetwise/api_op_DisassociateVehicleFleet.go @@ -12,9 +12,6 @@ import ( // Removes, or disassociates, a vehicle from a fleet. Disassociating a vehicle // from a fleet doesn't delete the vehicle. -// -// If the vehicle is successfully dissociated from a fleet, Amazon Web Services -// IoT FleetWise sends back an HTTP 200 response with an empty body. func (c *Client) DisassociateVehicleFleet(ctx context.Context, params *DisassociateVehicleFleetInput, optFns ...func(*Options)) (*DisassociateVehicleFleetOutput, error) { if params == nil { params = &DisassociateVehicleFleetInput{} diff --git a/service/iotfleetwise/api_op_GetCampaign.go b/service/iotfleetwise/api_op_GetCampaign.go index 6a8eacb4286..a0e4930ee2e 100644 --- a/service/iotfleetwise/api_op_GetCampaign.go +++ b/service/iotfleetwise/api_op_GetCampaign.go @@ -12,7 +12,13 @@ import ( "time" ) -// Retrieves information about a campaign. +// Retrieves information about a campaign. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html func (c *Client) GetCampaign(ctx context.Context, params *GetCampaignInput, optFns ...func(*Options)) (*GetCampaignOutput, error) { if params == nil { params = &GetCampaignInput{} @@ -55,8 +61,11 @@ type GetCampaignOutput struct { // midnight UTC time). CreationTime *time.Time - // The destination where the campaign sends data. You can choose to send data to - // be stored in Amazon S3 or Amazon Timestream. + // The destination where the campaign sends data. You can send data to an MQTT + // topic, or store it in Amazon S3 or Amazon Timestream. + // + // MQTT is the publish/subscribe messaging protocol used by Amazon Web Services + // IoT to communicate with your devices. // // Amazon S3 optimizes the cost of data storage and provides additional mechanisms // to use vehicle data, such as data lakes, centralized data storage, data @@ -69,6 +78,9 @@ type GetCampaignOutput struct { // A list of vehicle attributes associated with the campaign. DataExtraDimensions []string + // The data partitions associated with the signals collected from the vehicle. + DataPartitions []types.DataPartition + // The description of the campaign. Description *string @@ -101,6 +113,9 @@ type GetCampaignOutput struct { // Information about a list of signals to collect data on. SignalsToCollect []types.SignalInformation + // Information about a list of signals to fetch data from. + SignalsToFetch []types.SignalFetchInformation + // Whether to store collected data after a vehicle lost a connection with the // cloud. After a connection is re-established, the data is automatically forwarded // to Amazon Web Services IoT FleetWise. diff --git a/service/iotfleetwise/api_op_GetStateTemplate.go b/service/iotfleetwise/api_op_GetStateTemplate.go new file mode 100644 index 00000000000..639556af555 --- /dev/null +++ b/service/iotfleetwise/api_op_GetStateTemplate.go @@ -0,0 +1,199 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleetwise + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Retrieves information about a state template. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +func (c *Client) GetStateTemplate(ctx context.Context, params *GetStateTemplateInput, optFns ...func(*Options)) (*GetStateTemplateOutput, error) { + if params == nil { + params = &GetStateTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetStateTemplate", params, optFns, c.addOperationGetStateTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetStateTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetStateTemplateInput struct { + + // A unique, service-generated identifier. + // + // This member is required. + Identifier *string + + noSmithyDocumentSerde +} + +type GetStateTemplateOutput struct { + + // The Amazon Resource Name (ARN) of the state template. + Arn *string + + // The time the state template was created in seconds since epoch (January 1, 1970 + // at midnight UTC time). + CreationTime *time.Time + + // A list of vehicle attributes associated with the payload published on the state + // template's MQTT topic. + // + // Default: An empty array + DataExtraDimensions []string + + // A brief description of the state template. + Description *string + + // The unique ID of the state template. + Id *string + + // The time the state template was last updated in seconds since epoch (January 1, + // 1970 at midnight UTC time). + LastModificationTime *time.Time + + // A list of vehicle attributes to associate with user properties of the messages + // published on the state template's MQTT topic. + // + // Default: An empty array + MetadataExtraDimensions []string + + // The name of the state template. + Name *string + + // The ARN of the signal catalog associated with the state template. + SignalCatalogArn *string + + // A list of signals from which data is collected. The state template properties + // contain the fully qualified names of the signals. + StateTemplateProperties []string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetStateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpGetStateTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpGetStateTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetStateTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetStateTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetStateTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetStateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetStateTemplate", + } +} diff --git a/service/iotfleetwise/api_op_GetVehicle.go b/service/iotfleetwise/api_op_GetVehicle.go index 74bf28803ec..1ad4ca46c34 100644 --- a/service/iotfleetwise/api_op_GetVehicle.go +++ b/service/iotfleetwise/api_op_GetVehicle.go @@ -6,6 +6,7 @@ import ( "context" "fmt" awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iotfleetwise/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" "time" @@ -61,6 +62,9 @@ type GetVehicleOutput struct { // The ARN of a vehicle model (model manifest) associated with the vehicle. ModelManifestArn *string + // State templates associated with the vehicle. + StateTemplates []types.StateTemplateAssociation + // The ID of the vehicle. VehicleName *string diff --git a/service/iotfleetwise/api_op_GetVehicleStatus.go b/service/iotfleetwise/api_op_GetVehicleStatus.go index 9165c7e1bd4..31605d2d3bc 100644 --- a/service/iotfleetwise/api_op_GetVehicleStatus.go +++ b/service/iotfleetwise/api_op_GetVehicleStatus.go @@ -11,9 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Retrieves information about the status of a vehicle with any associated +// Retrieves information about the status of campaigns, decoder manifests, or // -// campaigns. +// state templates associated with a vehicle. func (c *Client) GetVehicleStatus(ctx context.Context, params *GetVehicleStatusInput, optFns ...func(*Options)) (*GetVehicleStatusOutput, error) { if params == nil { params = &GetVehicleStatusInput{} @@ -36,7 +36,8 @@ type GetVehicleStatusInput struct { // This member is required. VehicleName *string - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. This + // parameter is only supported for resources of type CAMPAIGN . MaxResults *int32 // A pagination token for the next set of results. @@ -45,7 +46,8 @@ type GetVehicleStatusInput struct { // returned, and a nextToken pagination token is returned in the response. To // retrieve the next set of results, reissue the search request and include the // returned token. When all results have been returned, the response does not - // contain a pagination token value. + // contain a pagination token value. This parameter is only supported for resources + // of type CAMPAIGN . NextToken *string noSmithyDocumentSerde @@ -168,7 +170,8 @@ func (c *Client) addOperationGetVehicleStatusMiddlewares(stack *middleware.Stack // GetVehicleStatusPaginatorOptions is the paginator options for GetVehicleStatus type GetVehicleStatusPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. This + // parameter is only supported for resources of type CAMPAIGN . Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ImportDecoderManifest.go b/service/iotfleetwise/api_op_ImportDecoderManifest.go index 2423fd539a1..d146fc09227 100644 --- a/service/iotfleetwise/api_op_ImportDecoderManifest.go +++ b/service/iotfleetwise/api_op_ImportDecoderManifest.go @@ -14,6 +14,9 @@ import ( // Creates a decoder manifest using your existing CAN DBC file from your local // // device. +// +// The CAN signal name must be unique and not repeated across CAN message +// definitions in a .dbc file. func (c *Client) ImportDecoderManifest(ctx context.Context, params *ImportDecoderManifestInput, optFns ...func(*Options)) (*ImportDecoderManifestOutput, error) { if params == nil { params = &ImportDecoderManifestInput{} diff --git a/service/iotfleetwise/api_op_ListCampaigns.go b/service/iotfleetwise/api_op_ListCampaigns.go index f8ef57dcc05..e4276d886da 100644 --- a/service/iotfleetwise/api_op_ListCampaigns.go +++ b/service/iotfleetwise/api_op_ListCampaigns.go @@ -32,7 +32,7 @@ func (c *Client) ListCampaigns(ctx context.Context, params *ListCampaignsInput, type ListCampaignsInput struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -44,9 +44,9 @@ type ListCampaignsInput struct { // contain a pagination token value. NextToken *string - // Optional parameter to filter the results by the status of each created campaign - // in your account. The status can be one of: CREATING , WAITING_FOR_APPROVAL , - // RUNNING , or SUSPENDED . + // An optional parameter to filter the results by the status of each created + // campaign in your account. The status can be one of: CREATING , + // WAITING_FOR_APPROVAL , RUNNING , or SUSPENDED . Status *string noSmithyDocumentSerde @@ -166,7 +166,7 @@ func (c *Client) addOperationListCampaignsMiddlewares(stack *middleware.Stack, o // ListCampaignsPaginatorOptions is the paginator options for ListCampaigns type ListCampaignsPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListDecoderManifestNetworkInterfaces.go b/service/iotfleetwise/api_op_ListDecoderManifestNetworkInterfaces.go index 84546dc0cfe..ea972a39c61 100644 --- a/service/iotfleetwise/api_op_ListDecoderManifestNetworkInterfaces.go +++ b/service/iotfleetwise/api_op_ListDecoderManifestNetworkInterfaces.go @@ -37,7 +37,7 @@ type ListDecoderManifestNetworkInterfacesInput struct { // This member is required. Name *string - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -170,7 +170,7 @@ func (c *Client) addOperationListDecoderManifestNetworkInterfacesMiddlewares(sta // ListDecoderManifestNetworkInterfacesPaginatorOptions is the paginator options // for ListDecoderManifestNetworkInterfaces type ListDecoderManifestNetworkInterfacesPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListDecoderManifestSignals.go b/service/iotfleetwise/api_op_ListDecoderManifestSignals.go index 962f9fc10b0..e1ec532808b 100644 --- a/service/iotfleetwise/api_op_ListDecoderManifestSignals.go +++ b/service/iotfleetwise/api_op_ListDecoderManifestSignals.go @@ -37,7 +37,7 @@ type ListDecoderManifestSignalsInput struct { // This member is required. Name *string - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -170,7 +170,7 @@ func (c *Client) addOperationListDecoderManifestSignalsMiddlewares(stack *middle // ListDecoderManifestSignalsPaginatorOptions is the paginator options for // ListDecoderManifestSignals type ListDecoderManifestSignalsPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListDecoderManifests.go b/service/iotfleetwise/api_op_ListDecoderManifests.go index 8aa5c440f2e..8f558961015 100644 --- a/service/iotfleetwise/api_op_ListDecoderManifests.go +++ b/service/iotfleetwise/api_op_ListDecoderManifests.go @@ -32,7 +32,7 @@ func (c *Client) ListDecoderManifests(ctx context.Context, params *ListDecoderMa type ListDecoderManifestsInput struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // The Amazon Resource Name (ARN) of a vehicle model (model manifest) associated @@ -166,7 +166,7 @@ func (c *Client) addOperationListDecoderManifestsMiddlewares(stack *middleware.S // ListDecoderManifestsPaginatorOptions is the paginator options for // ListDecoderManifests type ListDecoderManifestsPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListFleets.go b/service/iotfleetwise/api_op_ListFleets.go index e8daf4c70ae..74ee54cfcaf 100644 --- a/service/iotfleetwise/api_op_ListFleets.go +++ b/service/iotfleetwise/api_op_ListFleets.go @@ -34,7 +34,7 @@ func (c *Client) ListFleets(ctx context.Context, params *ListFleetsInput, optFns type ListFleetsInput struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -163,7 +163,7 @@ func (c *Client) addOperationListFleetsMiddlewares(stack *middleware.Stack, opti // ListFleetsPaginatorOptions is the paginator options for ListFleets type ListFleetsPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListFleetsForVehicle.go b/service/iotfleetwise/api_op_ListFleetsForVehicle.go index a73038fddbb..b9e9334bf2e 100644 --- a/service/iotfleetwise/api_op_ListFleetsForVehicle.go +++ b/service/iotfleetwise/api_op_ListFleetsForVehicle.go @@ -36,7 +36,7 @@ type ListFleetsForVehicleInput struct { // This member is required. VehicleName *string - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -169,7 +169,7 @@ func (c *Client) addOperationListFleetsForVehicleMiddlewares(stack *middleware.S // ListFleetsForVehiclePaginatorOptions is the paginator options for // ListFleetsForVehicle type ListFleetsForVehiclePaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListModelManifestNodes.go b/service/iotfleetwise/api_op_ListModelManifestNodes.go index 3b482c96c26..2cdfeda23cd 100644 --- a/service/iotfleetwise/api_op_ListModelManifestNodes.go +++ b/service/iotfleetwise/api_op_ListModelManifestNodes.go @@ -37,7 +37,7 @@ type ListModelManifestNodesInput struct { // This member is required. Name *string - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -170,7 +170,7 @@ func (c *Client) addOperationListModelManifestNodesMiddlewares(stack *middleware // ListModelManifestNodesPaginatorOptions is the paginator options for // ListModelManifestNodes type ListModelManifestNodesPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListModelManifests.go b/service/iotfleetwise/api_op_ListModelManifests.go index b549e720544..4bc4a8e5f3a 100644 --- a/service/iotfleetwise/api_op_ListModelManifests.go +++ b/service/iotfleetwise/api_op_ListModelManifests.go @@ -32,7 +32,7 @@ func (c *Client) ListModelManifests(ctx context.Context, params *ListModelManife type ListModelManifestsInput struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -166,7 +166,7 @@ func (c *Client) addOperationListModelManifestsMiddlewares(stack *middleware.Sta // ListModelManifestsPaginatorOptions is the paginator options for // ListModelManifests type ListModelManifestsPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListSignalCatalogNodes.go b/service/iotfleetwise/api_op_ListSignalCatalogNodes.go index 9eb17f6395b..8f333667c08 100644 --- a/service/iotfleetwise/api_op_ListSignalCatalogNodes.go +++ b/service/iotfleetwise/api_op_ListSignalCatalogNodes.go @@ -37,7 +37,7 @@ type ListSignalCatalogNodesInput struct { // This member is required. Name *string - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -173,7 +173,7 @@ func (c *Client) addOperationListSignalCatalogNodesMiddlewares(stack *middleware // ListSignalCatalogNodesPaginatorOptions is the paginator options for // ListSignalCatalogNodes type ListSignalCatalogNodesPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListSignalCatalogs.go b/service/iotfleetwise/api_op_ListSignalCatalogs.go index 62caf598f9e..1a980ad3c9d 100644 --- a/service/iotfleetwise/api_op_ListSignalCatalogs.go +++ b/service/iotfleetwise/api_op_ListSignalCatalogs.go @@ -35,7 +35,7 @@ func (c *Client) ListSignalCatalogs(ctx context.Context, params *ListSignalCatal type ListSignalCatalogsInput struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -165,7 +165,7 @@ func (c *Client) addOperationListSignalCatalogsMiddlewares(stack *middleware.Sta // ListSignalCatalogsPaginatorOptions is the paginator options for // ListSignalCatalogs type ListSignalCatalogsPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListStateTemplates.go b/service/iotfleetwise/api_op_ListStateTemplates.go new file mode 100644 index 00000000000..bdb8e8bbb03 --- /dev/null +++ b/service/iotfleetwise/api_op_ListStateTemplates.go @@ -0,0 +1,260 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleetwise + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iotfleetwise/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists information about created state templates. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +func (c *Client) ListStateTemplates(ctx context.Context, params *ListStateTemplatesInput, optFns ...func(*Options)) (*ListStateTemplatesOutput, error) { + if params == nil { + params = &ListStateTemplatesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListStateTemplates", params, optFns, c.addOperationListStateTemplatesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListStateTemplatesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListStateTemplatesInput struct { + + // The maximum number of items to return, between 1 and 100, inclusive. + MaxResults *int32 + + // The token to retrieve the next set of results, or null if there are no more + // results. + NextToken *string + + noSmithyDocumentSerde +} + +type ListStateTemplatesOutput struct { + + // The token to retrieve the next set of results, or null if there are no more + // results. + NextToken *string + + // A list of information about each state template. + Summaries []types.StateTemplateSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListStateTemplatesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpListStateTemplates{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpListStateTemplates{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListStateTemplates"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListStateTemplates(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListStateTemplatesPaginatorOptions is the paginator options for +// ListStateTemplates +type ListStateTemplatesPaginatorOptions struct { + // The maximum number of items to return, between 1 and 100, inclusive. + 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 +} + +// ListStateTemplatesPaginator is a paginator for ListStateTemplates +type ListStateTemplatesPaginator struct { + options ListStateTemplatesPaginatorOptions + client ListStateTemplatesAPIClient + params *ListStateTemplatesInput + nextToken *string + firstPage bool +} + +// NewListStateTemplatesPaginator returns a new ListStateTemplatesPaginator +func NewListStateTemplatesPaginator(client ListStateTemplatesAPIClient, params *ListStateTemplatesInput, optFns ...func(*ListStateTemplatesPaginatorOptions)) *ListStateTemplatesPaginator { + if params == nil { + params = &ListStateTemplatesInput{} + } + + options := ListStateTemplatesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListStateTemplatesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListStateTemplatesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListStateTemplates page. +func (p *ListStateTemplatesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListStateTemplatesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListStateTemplates(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 +} + +// ListStateTemplatesAPIClient is a client that implements the ListStateTemplates +// operation. +type ListStateTemplatesAPIClient interface { + ListStateTemplates(context.Context, *ListStateTemplatesInput, ...func(*Options)) (*ListStateTemplatesOutput, error) +} + +var _ ListStateTemplatesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListStateTemplates(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListStateTemplates", + } +} diff --git a/service/iotfleetwise/api_op_ListVehicles.go b/service/iotfleetwise/api_op_ListVehicles.go index cf862706570..cd0ff6c3938 100644 --- a/service/iotfleetwise/api_op_ListVehicles.go +++ b/service/iotfleetwise/api_op_ListVehicles.go @@ -32,17 +32,31 @@ func (c *Client) ListVehicles(ctx context.Context, params *ListVehiclesInput, op type ListVehiclesInput struct { - // The fully qualified names of the attributes. For example, the fully qualified - // name of an attribute might be Vehicle.Body.Engine.Type . + // The fully qualified names of the attributes. You can use this optional + // parameter to list the vehicles containing all the attributes in the request. For + // example, attributeNames could be " Vehicle.Body.Engine.Type, Vehicle.Color " and + // the corresponding attributeValues could be " 1.3 L R2, Blue " . In this case, + // the API will filter vehicles with an attribute name Vehicle.Body.Engine.Type + // that contains a value of 1.3 L R2 AND an attribute name Vehicle.Color that + // contains a value of " Blue ". A request must contain unique values for the + // attributeNames filter and the matching number of attributeValues filters to + // return the subset of vehicles that match the attributes filter condition. AttributeNames []string - // Static information about a vehicle attribute value in string format. For - // example: - // - // "1.3 L R2" + // Static information about a vehicle attribute value in string format. You can + // use this optional parameter in conjunction with attributeNames to list the + // vehicles containing all the attributeValues corresponding to the attributeNames + // filter. For example, attributeValues could be " 1.3 L R2, Blue " and the + // corresponding attributeNames filter could be " Vehicle.Body.Engine.Type, + // Vehicle.Color ". In this case, the API will filter vehicles with attribute name + // Vehicle.Body.Engine.Type that contains a value of 1.3 L R2 AND an attribute + // name Vehicle.Color that contains a value of " Blue ". A request must contain + // unique values for the attributeNames filter and the matching number of + // attributeValues filter to return the subset of vehicles that match the + // attributes filter condition. AttributeValues []string - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // The Amazon Resource Name (ARN) of a vehicle model (model manifest). You can @@ -176,7 +190,7 @@ func (c *Client) addOperationListVehiclesMiddlewares(stack *middleware.Stack, op // ListVehiclesPaginatorOptions is the paginator options for ListVehicles type ListVehiclesPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_ListVehiclesInFleet.go b/service/iotfleetwise/api_op_ListVehiclesInFleet.go index 346dc75166d..c1f3d250ce8 100644 --- a/service/iotfleetwise/api_op_ListVehiclesInFleet.go +++ b/service/iotfleetwise/api_op_ListVehiclesInFleet.go @@ -36,7 +36,7 @@ type ListVehiclesInFleetInput struct { // This member is required. FleetId *string - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. MaxResults *int32 // A pagination token for the next set of results. @@ -169,7 +169,7 @@ func (c *Client) addOperationListVehiclesInFleetMiddlewares(stack *middleware.St // ListVehiclesInFleetPaginatorOptions is the paginator options for // ListVehiclesInFleet type ListVehiclesInFleetPaginatorOptions struct { - // The maximum number of items to return, between 1 and 100, inclusive. + // The maximum number of items to return, between 1 and 100, inclusive. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/iotfleetwise/api_op_UpdateDecoderManifest.go b/service/iotfleetwise/api_op_UpdateDecoderManifest.go index 9f43cfec680..aa8dd955c7a 100644 --- a/service/iotfleetwise/api_op_UpdateDecoderManifest.go +++ b/service/iotfleetwise/api_op_UpdateDecoderManifest.go @@ -37,6 +37,16 @@ type UpdateDecoderManifestInput struct { // This member is required. Name *string + // Use default decoders for all unmapped signals in the model. You don't need to + // provide any detailed decoding information. + // + // Access to certain Amazon Web Services IoT FleetWise features is currently + // gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise + // Developer Guide. + // + // [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html + DefaultForUnmappedSignals types.DefaultForUnmappedSignalsType + // A brief description of the decoder manifest to update. Description *string diff --git a/service/iotfleetwise/api_op_UpdateFleet.go b/service/iotfleetwise/api_op_UpdateFleet.go index 30a5783b716..ceb2936880a 100644 --- a/service/iotfleetwise/api_op_UpdateFleet.go +++ b/service/iotfleetwise/api_op_UpdateFleet.go @@ -10,10 +10,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Updates the description of an existing fleet. -// -// If the fleet is successfully updated, Amazon Web Services IoT FleetWise sends -// back an HTTP 200 response with an empty HTTP body. +// Updates the description of an existing fleet. func (c *Client) UpdateFleet(ctx context.Context, params *UpdateFleetInput, optFns ...func(*Options)) (*UpdateFleetOutput, error) { if params == nil { params = &UpdateFleetInput{} diff --git a/service/iotfleetwise/api_op_UpdateStateTemplate.go b/service/iotfleetwise/api_op_UpdateStateTemplate.go new file mode 100644 index 00000000000..22b2b565c19 --- /dev/null +++ b/service/iotfleetwise/api_op_UpdateStateTemplate.go @@ -0,0 +1,197 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotfleetwise + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a state template. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +func (c *Client) UpdateStateTemplate(ctx context.Context, params *UpdateStateTemplateInput, optFns ...func(*Options)) (*UpdateStateTemplateOutput, error) { + if params == nil { + params = &UpdateStateTemplateInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateStateTemplate", params, optFns, c.addOperationUpdateStateTemplateMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateStateTemplateOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateStateTemplateInput struct { + + // A unique, service-generated identifier. + // + // This member is required. + Identifier *string + + // A list of vehicle attributes to associate with the payload published on the + // state template's MQTT topic. (See [Processing last known state vehicle data using MQTT messaging]). For example, if you add + // Vehicle.Attributes.Make and Vehicle.Attributes.Model attributes, Amazon Web + // Services IoT FleetWise will enrich the protobuf encoded payload with those + // attributes in the extraDimensions field. + // + // Default: An empty array + // + // [Processing last known state vehicle data using MQTT messaging]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/process-visualize-data.html#process-last-known-state-vehicle-data + DataExtraDimensions []string + + // A brief description of the state template. + Description *string + + // A list of vehicle attributes to associate with user properties of the messages + // published on the state template's MQTT topic. (See [Processing last known state vehicle data using MQTT messaging]). For example, if you add + // Vehicle.Attributes.Make and Vehicle.Attributes.Model attributes, Amazon Web + // Services IoT FleetWise will include these attributes as User Properties with the + // MQTT message. + // + // [Processing last known state vehicle data using MQTT messaging]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/process-visualize-data.html#process-last-known-state-vehicle-data + MetadataExtraDimensions []string + + // Add signals from which data is collected as part of the state template. + StateTemplatePropertiesToAdd []string + + // Remove signals from which data is collected as part of the state template. + StateTemplatePropertiesToRemove []string + + noSmithyDocumentSerde +} + +type UpdateStateTemplateOutput struct { + + // The Amazon Resource Name (ARN) of the state template. + Arn *string + + // The unique ID of the state template. + Id *string + + // The name of the state template. + Name *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateStateTemplateMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson10_serializeOpUpdateStateTemplate{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson10_deserializeOpUpdateStateTemplate{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateStateTemplate"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateStateTemplateValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateStateTemplate(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateStateTemplate(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateStateTemplate", + } +} diff --git a/service/iotfleetwise/api_op_UpdateVehicle.go b/service/iotfleetwise/api_op_UpdateVehicle.go index 65e9218ec6e..e7bb6affaf4 100644 --- a/service/iotfleetwise/api_op_UpdateVehicle.go +++ b/service/iotfleetwise/api_op_UpdateVehicle.go @@ -52,6 +52,12 @@ type UpdateVehicleInput struct { // The ARN of a vehicle model (model manifest) associated with the vehicle. ModelManifestArn *string + // Associate state templates with the vehicle. + StateTemplatesToAdd []types.StateTemplateAssociation + + // Remove state templates from the vehicle. + StateTemplatesToRemove []string + noSmithyDocumentSerde } diff --git a/service/iotfleetwise/deserializers.go b/service/iotfleetwise/deserializers.go index 7684b811479..ed0ce8146e9 100644 --- a/service/iotfleetwise/deserializers.go +++ b/service/iotfleetwise/deserializers.go @@ -1056,6 +1056,138 @@ func awsAwsjson10_deserializeOpErrorCreateSignalCatalog(response *smithyhttp.Res } } +type awsAwsjson10_deserializeOpCreateStateTemplate struct { +} + +func (*awsAwsjson10_deserializeOpCreateStateTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpCreateStateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorCreateStateTemplate(response, &metadata) + } + output := &CreateStateTemplateOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentCreateStateTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorCreateStateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("InvalidSignalsException", errorCode): + return awsAwsjson10_deserializeErrorInvalidSignalsException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpCreateVehicle struct { } @@ -1797,6 +1929,126 @@ func awsAwsjson10_deserializeOpErrorDeleteSignalCatalog(response *smithyhttp.Res } } +type awsAwsjson10_deserializeOpDeleteStateTemplate struct { +} + +func (*awsAwsjson10_deserializeOpDeleteStateTemplate) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpDeleteStateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorDeleteStateTemplate(response, &metadata) + } + output := &DeleteStateTemplateOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentDeleteStateTemplateOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorDeleteStateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpDeleteVehicle struct { } @@ -3018,14 +3270,14 @@ func awsAwsjson10_deserializeOpErrorGetSignalCatalog(response *smithyhttp.Respon } } -type awsAwsjson10_deserializeOpGetVehicle struct { +type awsAwsjson10_deserializeOpGetStateTemplate struct { } -func (*awsAwsjson10_deserializeOpGetVehicle) ID() string { +func (*awsAwsjson10_deserializeOpGetStateTemplate) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpGetVehicle) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetStateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3043,9 +3295,9 @@ func (m *awsAwsjson10_deserializeOpGetVehicle) HandleDeserialize(ctx context.Con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorGetVehicle(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetStateTemplate(response, &metadata) } - output := &GetVehicleOutput{} + output := &GetStateTemplateOutput{} out.Result = output var buff [1024]byte @@ -3065,7 +3317,7 @@ func (m *awsAwsjson10_deserializeOpGetVehicle) HandleDeserialize(ctx context.Con return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentGetVehicleOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetStateTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3079,7 +3331,7 @@ func (m *awsAwsjson10_deserializeOpGetVehicle) HandleDeserialize(ctx context.Con return out, metadata, err } -func awsAwsjson10_deserializeOpErrorGetVehicle(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorGetStateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3141,14 +3393,14 @@ func awsAwsjson10_deserializeOpErrorGetVehicle(response *smithyhttp.Response, me } } -type awsAwsjson10_deserializeOpGetVehicleStatus struct { +type awsAwsjson10_deserializeOpGetVehicle struct { } -func (*awsAwsjson10_deserializeOpGetVehicleStatus) ID() string { +func (*awsAwsjson10_deserializeOpGetVehicle) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpGetVehicleStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpGetVehicle) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3166,9 +3418,9 @@ func (m *awsAwsjson10_deserializeOpGetVehicleStatus) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorGetVehicleStatus(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorGetVehicle(response, &metadata) } - output := &GetVehicleStatusOutput{} + output := &GetVehicleOutput{} out.Result = output var buff [1024]byte @@ -3188,7 +3440,130 @@ func (m *awsAwsjson10_deserializeOpGetVehicleStatus) HandleDeserialize(ctx conte return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentGetVehicleStatusOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentGetVehicleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorGetVehicle(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson10_deserializeOpGetVehicleStatus struct { +} + +func (*awsAwsjson10_deserializeOpGetVehicleStatus) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpGetVehicleStatus) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorGetVehicleStatus(response, &metadata) + } + output := &GetVehicleStatusOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentGetVehicleStatusOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4752,6 +5127,126 @@ func awsAwsjson10_deserializeOpErrorListSignalCatalogs(response *smithyhttp.Resp } } +type awsAwsjson10_deserializeOpListStateTemplates struct { +} + +func (*awsAwsjson10_deserializeOpListStateTemplates) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpListStateTemplates) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorListStateTemplates(response, &metadata) + } + output := &ListStateTemplatesOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentListStateTemplatesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorListStateTemplates(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson10_deserializeOpListTagsForResource struct { } @@ -6390,14 +6885,14 @@ func awsAwsjson10_deserializeOpErrorUpdateSignalCatalog(response *smithyhttp.Res } } -type awsAwsjson10_deserializeOpUpdateVehicle struct { +type awsAwsjson10_deserializeOpUpdateStateTemplate struct { } -func (*awsAwsjson10_deserializeOpUpdateVehicle) ID() string { +func (*awsAwsjson10_deserializeOpUpdateStateTemplate) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson10_deserializeOpUpdateVehicle) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson10_deserializeOpUpdateStateTemplate) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6415,9 +6910,9 @@ func (m *awsAwsjson10_deserializeOpUpdateVehicle) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson10_deserializeOpErrorUpdateVehicle(response, &metadata) + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateStateTemplate(response, &metadata) } - output := &UpdateVehicleOutput{} + output := &UpdateStateTemplateOutput{} out.Result = output var buff [1024]byte @@ -6437,7 +6932,7 @@ func (m *awsAwsjson10_deserializeOpUpdateVehicle) HandleDeserialize(ctx context. return out, metadata, err } - err = awsAwsjson10_deserializeOpDocumentUpdateVehicleOutput(&output, shape) + err = awsAwsjson10_deserializeOpDocumentUpdateStateTemplateOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6451,7 +6946,7 @@ func (m *awsAwsjson10_deserializeOpUpdateVehicle) HandleDeserialize(ctx context. return out, metadata, err } -func awsAwsjson10_deserializeOpErrorUpdateVehicle(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson10_deserializeOpErrorUpdateStateTemplate(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6491,12 +6986,12 @@ func awsAwsjson10_deserializeOpErrorUpdateVehicle(response *smithyhttp.Response, case strings.EqualFold("AccessDeniedException", errorCode): return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) - case strings.EqualFold("ConflictException", errorCode): - return awsAwsjson10_deserializeErrorConflictException(response, errorBody) - case strings.EqualFold("InternalServerException", errorCode): return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + case strings.EqualFold("InvalidSignalsException", errorCode): + return awsAwsjson10_deserializeErrorInvalidSignalsException(response, errorBody) + case strings.EqualFold("LimitExceededException", errorCode): return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) @@ -6519,11 +7014,140 @@ func awsAwsjson10_deserializeOpErrorUpdateVehicle(response *smithyhttp.Response, } } -func awsAwsjson10_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { - var buff [1024]byte - ringBuffer := smithyio.NewRingBuffer(buff[:]) +type awsAwsjson10_deserializeOpUpdateVehicle struct { +} - body := io.TeeReader(errorBody, ringBuffer) +func (*awsAwsjson10_deserializeOpUpdateVehicle) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson10_deserializeOpUpdateVehicle) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson10_deserializeOpErrorUpdateVehicle(response, &metadata) + } + output := &UpdateVehicleOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson10_deserializeOpDocumentUpdateVehicleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson10_deserializeOpErrorUpdateVehicle(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsAwsjson10_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsAwsjson10_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsAwsjson10_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("LimitExceededException", errorCode): + return awsAwsjson10_deserializeErrorLimitExceededException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson10_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsAwsjson10_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson10_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsAwsjson10_deserializeErrorAccessDeniedException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) decoder := json.NewDecoder(body) decoder.UseNumber() var shape interface{} @@ -7912,6 +8536,55 @@ func awsAwsjson10_deserializeDocumentConditionBasedCollectionScheme(v **types.Co return nil } +func awsAwsjson10_deserializeDocumentConditionBasedSignalFetchConfig(v **types.ConditionBasedSignalFetchConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ConditionBasedSignalFetchConfig + if *v == nil { + sv = &types.ConditionBasedSignalFetchConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "conditionExpression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected fetchConfigEventExpression to be of type string, got %T instead", value) + } + sv.ConditionExpression = ptr.String(jtv) + } + + case "triggerMode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TriggerMode to be of type string, got %T instead", value) + } + sv.TriggerMode = types.TriggerMode(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8154,6 +8827,86 @@ func awsAwsjson10_deserializeDocumentCreateVehicleResponses(v *[]types.CreateVeh return nil } +func awsAwsjson10_deserializeDocumentCustomDecodingInterface(v **types.CustomDecodingInterface, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CustomDecodingInterface + if *v == nil { + sv = &types.CustomDecodingInterface{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomDecodingSignalInterfaceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentCustomDecodingSignal(v **types.CustomDecodingSignal, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.CustomDecodingSignal + if *v == nil { + sv = &types.CustomDecodingSignal{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CustomDecodingId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentCustomProperty(v **types.CustomProperty, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -8335,6 +9088,16 @@ loop: continue } switch key { + case "mqttTopicConfig": + var mv types.MqttTopicConfig + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentMqttTopicConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.DataDestinationConfigMemberMqttTopicConfig{Value: mv} + break loop + case "s3Config": var mv types.S3Config destAddr := &mv @@ -8433,7 +9196,7 @@ func awsAwsjson10_deserializeDocumentDataExtraDimensionNodePathList(v *[]string, return nil } -func awsAwsjson10_deserializeDocumentDecoderManifestSummaries(v *[]types.DecoderManifestSummary, value interface{}) error { +func awsAwsjson10_deserializeDocumentDataPartition(v **types.DataPartition, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8441,12 +9204,199 @@ func awsAwsjson10_deserializeDocumentDecoderManifestSummaries(v *[]types.Decoder return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.DecoderManifestSummary + var sv *types.DataPartition + if *v == nil { + sv = &types.DataPartition{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataPartitionId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "storageOptions": + if err := awsAwsjson10_deserializeDocumentDataPartitionStorageOptions(&sv.StorageOptions, value); err != nil { + return err + } + + case "uploadOptions": + if err := awsAwsjson10_deserializeDocumentDataPartitionUploadOptions(&sv.UploadOptions, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentDataPartitions(v *[]types.DataPartition, 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.DataPartition + if *v == nil { + cv = []types.DataPartition{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.DataPartition + destAddr := &col + if err := awsAwsjson10_deserializeDocumentDataPartition(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentDataPartitionStorageOptions(v **types.DataPartitionStorageOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DataPartitionStorageOptions + if *v == nil { + sv = &types.DataPartitionStorageOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "maximumSize": + if err := awsAwsjson10_deserializeDocumentStorageMaximumSize(&sv.MaximumSize, value); err != nil { + return err + } + + case "minimumTimeToLive": + if err := awsAwsjson10_deserializeDocumentStorageMinimumTimeToLive(&sv.MinimumTimeToLive, value); err != nil { + return err + } + + case "storageLocation": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StorageLocation to be of type string, got %T instead", value) + } + sv.StorageLocation = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentDataPartitionUploadOptions(v **types.DataPartitionUploadOptions, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.DataPartitionUploadOptions + if *v == nil { + sv = &types.DataPartitionUploadOptions{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "conditionLanguageVersion": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected languageVersion to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ConditionLanguageVersion = ptr.Int32(int32(i64)) + } + + case "expression": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected eventExpression to be of type string, got %T instead", value) + } + sv.Expression = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentDecoderManifestSummaries(v *[]types.DecoderManifestSummary, 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.DecoderManifestSummary if *v == nil { cv = []types.DecoderManifestSummary{} } else { @@ -8634,6 +9584,42 @@ func awsAwsjson10_deserializeDocumentDecoderManifestValidationException(v **type return nil } +func awsAwsjson10_deserializeDocumentEventExpressionList(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 actionEventExpression to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson10_deserializeDocumentFleets(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9592,6 +10578,55 @@ func awsAwsjson10_deserializeDocumentModelManifestSummary(v **types.ModelManifes return nil } +func awsAwsjson10_deserializeDocumentMqttTopicConfig(v **types.MqttTopicConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.MqttTopicConfig + if *v == nil { + sv = &types.MqttTopicConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "executionRoleArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IAMRoleArn to be of type string, got %T instead", value) + } + sv.ExecutionRoleArn = ptr.String(jtv) + } + + case "mqttTopicArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MqttTopicArn to be of type string, got %T instead", value) + } + sv.MqttTopicArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentNetworkInterface(v **types.NetworkInterface, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9619,6 +10654,11 @@ func awsAwsjson10_deserializeDocumentNetworkInterface(v **types.NetworkInterface return err } + case "customDecodingInterface": + if err := awsAwsjson10_deserializeDocumentCustomDecodingInterface(&sv.CustomDecodingInterface, value); err != nil { + return err + } + case "interfaceId": if value != nil { jtv, ok := value.(string) @@ -10230,7 +11270,7 @@ func awsAwsjson10_deserializeDocumentObdSignal(v **types.ObdSignal, value interf return nil } -func awsAwsjson10_deserializeDocumentPrimitiveMessageDefinition(v *types.PrimitiveMessageDefinition, value interface{}) error { +func awsAwsjson10_deserializeDocumentOnChangeStateTemplateUpdateStrategy(v **types.OnChangeStateTemplateUpdateStrategy, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10243,15 +11283,82 @@ func awsAwsjson10_deserializeDocumentPrimitiveMessageDefinition(v *types.Primiti return fmt.Errorf("unexpected JSON type %v", value) } - var uv types.PrimitiveMessageDefinition -loop: + var sv *types.OnChangeStateTemplateUpdateStrategy + if *v == nil { + sv = &types.OnChangeStateTemplateUpdateStrategy{} + } else { + sv = *v + } + for key, value := range shape { - if value == nil { - continue - } switch key { - case "ros2PrimitiveMessageDefinition": - var mv types.ROS2PrimitiveMessageDefinition + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentPeriodicStateTemplateUpdateStrategy(v **types.PeriodicStateTemplateUpdateStrategy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PeriodicStateTemplateUpdateStrategy + if *v == nil { + sv = &types.PeriodicStateTemplateUpdateStrategy{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "stateTemplateUpdateRate": + if err := awsAwsjson10_deserializeDocumentTimePeriod(&sv.StateTemplateUpdateRate, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentPrimitiveMessageDefinition(v *types.PrimitiveMessageDefinition, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.PrimitiveMessageDefinition +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "ros2PrimitiveMessageDefinition": + var mv types.ROS2PrimitiveMessageDefinition destAddr := &mv if err := awsAwsjson10_deserializeDocumentROS2PrimitiveMessageDefinition(&destAddr, value); err != nil { return err @@ -10825,6 +11932,11 @@ func awsAwsjson10_deserializeDocumentSignalDecoder(v **types.SignalDecoder, valu return err } + case "customDecodingSignal": + if err := awsAwsjson10_deserializeDocumentCustomDecodingSignal(&sv.CustomDecodingSignal, value); err != nil { + return err + } + case "fullyQualifiedName": if value != nil { jtv, ok := value.(string) @@ -10901,11 +12013,646 @@ func awsAwsjson10_deserializeDocumentSignalDecoders(v *[]types.SignalDecoder, va cv = append(cv, col) } - *v = cv + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSignalFetchConfig(v *types.SignalFetchConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.SignalFetchConfig +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "conditionBased": + var mv types.ConditionBasedSignalFetchConfig + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentConditionBasedSignalFetchConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.SignalFetchConfigMemberConditionBased{Value: mv} + break loop + + case "timeBased": + var mv types.TimeBasedSignalFetchConfig + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentTimeBasedSignalFetchConfig(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.SignalFetchConfigMemberTimeBased{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + +func awsAwsjson10_deserializeDocumentSignalFetchInformation(v **types.SignalFetchInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SignalFetchInformation + if *v == nil { + sv = &types.SignalFetchInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "actions": + if err := awsAwsjson10_deserializeDocumentEventExpressionList(&sv.Actions, value); err != nil { + return err + } + + case "conditionLanguageVersion": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected languageVersion to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ConditionLanguageVersion = ptr.Int32(int32(i64)) + } + + case "fullyQualifiedName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodePath to be of type string, got %T instead", value) + } + sv.FullyQualifiedName = ptr.String(jtv) + } + + case "signalFetchConfig": + if err := awsAwsjson10_deserializeDocumentSignalFetchConfig(&sv.SignalFetchConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSignalFetchInformationList(v *[]types.SignalFetchInformation, 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.SignalFetchInformation + if *v == nil { + cv = []types.SignalFetchInformation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SignalFetchInformation + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSignalFetchInformation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentSignalInformation(v **types.SignalInformation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SignalInformation + if *v == nil { + sv = &types.SignalInformation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "dataPartitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DataPartitionId to be of type string, got %T instead", value) + } + sv.DataPartitionId = ptr.String(jtv) + } + + case "maxSampleCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected maxSampleCount to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MaxSampleCount = ptr.Int64(i64) + } + + case "minimumSamplingIntervalMs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected uint32 to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.MinimumSamplingIntervalMs = ptr.Int64(i64) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected wildcardSignalName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentSignalInformationList(v *[]types.SignalInformation, 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.SignalInformation + if *v == nil { + cv = []types.SignalInformation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.SignalInformation + destAddr := &col + if err := awsAwsjson10_deserializeDocumentSignalInformation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentStateTemplateAssociation(v **types.StateTemplateAssociation, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.StateTemplateAssociation + if *v == nil { + sv = &types.StateTemplateAssociation{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "identifier": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceIdentifier to be of type string, got %T instead", value) + } + sv.Identifier = ptr.String(jtv) + } + + case "stateTemplateUpdateStrategy": + if err := awsAwsjson10_deserializeDocumentStateTemplateUpdateStrategy(&sv.StateTemplateUpdateStrategy, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentStateTemplateAssociations(v *[]types.StateTemplateAssociation, 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.StateTemplateAssociation + if *v == nil { + cv = []types.StateTemplateAssociation{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.StateTemplateAssociation + destAddr := &col + if err := awsAwsjson10_deserializeDocumentStateTemplateAssociation(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentStateTemplateDataExtraDimensionNodePathList(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 NodePath to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentStateTemplateMetadataExtraDimensionNodePathList(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 NodePath to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentStateTemplateProperties(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 NodePath to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentStateTemplateSummaries(v *[]types.StateTemplateSummary, 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.StateTemplateSummary + if *v == nil { + cv = []types.StateTemplateSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.StateTemplateSummary + destAddr := &col + if err := awsAwsjson10_deserializeDocumentStateTemplateSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson10_deserializeDocumentStateTemplateSummary(v **types.StateTemplateSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.StateTemplateSummary + if *v == nil { + sv = &types.StateTemplateSummary{} + } 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 "creationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected description 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 ResourceUniqueId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastModificationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModificationTime = 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 "signalCatalogArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected arn to be of type string, got %T instead", value) + } + sv.SignalCatalogArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentStateTemplateUpdateStrategy(v *types.StateTemplateUpdateStrategy, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.StateTemplateUpdateStrategy +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "onChange": + var mv types.OnChangeStateTemplateUpdateStrategy + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentOnChangeStateTemplateUpdateStrategy(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.StateTemplateUpdateStrategyMemberOnChange{Value: mv} + break loop + + case "periodic": + var mv types.PeriodicStateTemplateUpdateStrategy + destAddr := &mv + if err := awsAwsjson10_deserializeDocumentPeriodicStateTemplateUpdateStrategy(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.StateTemplateUpdateStrategyMemberPeriodic{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv return nil } -func awsAwsjson10_deserializeDocumentSignalInformation(v **types.SignalInformation, value interface{}) error { +func awsAwsjson10_deserializeDocumentStorageMaximumSize(v **types.StorageMaximumSize, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10918,48 +12665,35 @@ func awsAwsjson10_deserializeDocumentSignalInformation(v **types.SignalInformati return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.SignalInformation + var sv *types.StorageMaximumSize if *v == nil { - sv = &types.SignalInformation{} + sv = &types.StorageMaximumSize{} } else { sv = *v } for key, value := range shape { switch key { - case "maxSampleCount": + case "unit": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected maxSampleCount to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected StorageMaximumSizeUnit to be of type string, got %T instead", value) } - sv.MaxSampleCount = ptr.Int64(i64) + sv.Unit = types.StorageMaximumSizeUnit(jtv) } - case "minimumSamplingIntervalMs": + case "value": if value != nil { jtv, ok := value.(json.Number) if !ok { - return fmt.Errorf("expected uint32 to be json.Number, got %T instead", value) + return fmt.Errorf("expected StorageMaximumSizeValue to be json.Number, got %T instead", value) } i64, err := jtv.Int64() if err != nil { return err } - sv.MinimumSamplingIntervalMs = ptr.Int64(i64) - } - - case "name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected wildcardSignalName to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) + sv.Value = ptr.Int32(int32(i64)) } default: @@ -10971,7 +12705,7 @@ func awsAwsjson10_deserializeDocumentSignalInformation(v **types.SignalInformati return nil } -func awsAwsjson10_deserializeDocumentSignalInformationList(v *[]types.SignalInformation, value interface{}) error { +func awsAwsjson10_deserializeDocumentStorageMinimumTimeToLive(v **types.StorageMinimumTimeToLive, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -10979,29 +12713,48 @@ func awsAwsjson10_deserializeDocumentSignalInformationList(v *[]types.SignalInfo return nil } - shape, ok := value.([]interface{}) + shape, ok := value.(map[string]interface{}) if !ok { return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.SignalInformation + var sv *types.StorageMinimumTimeToLive if *v == nil { - cv = []types.SignalInformation{} + sv = &types.StorageMinimumTimeToLive{} } else { - cv = *v + sv = *v } - for _, value := range shape { - var col types.SignalInformation - destAddr := &col - if err := awsAwsjson10_deserializeDocumentSignalInformation(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for key, value := range shape { + switch key { + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected StorageMinimumTimeToLiveUnit to be of type string, got %T instead", value) + } + sv.Unit = types.StorageMinimumTimeToLiveUnit(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected StorageMinimumTimeToLiveValue to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Value = ptr.Int32(int32(i64)) + } + default: + _, _ = key, value + + } } - *v = cv + *v = sv return nil } @@ -11405,6 +13158,103 @@ func awsAwsjson10_deserializeDocumentTimeBasedCollectionScheme(v **types.TimeBas return nil } +func awsAwsjson10_deserializeDocumentTimeBasedSignalFetchConfig(v **types.TimeBasedSignalFetchConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TimeBasedSignalFetchConfig + if *v == nil { + sv = &types.TimeBasedSignalFetchConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "executionFrequencyMs": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected positiveLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.ExecutionFrequencyMs = ptr.Int64(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeDocumentTimePeriod(v **types.TimePeriod, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TimePeriod + if *v == nil { + sv = &types.TimePeriod{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "unit": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TimeUnit to be of type string, got %T instead", value) + } + sv.Unit = types.TimeUnit(jtv) + } + + case "value": + 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.Value = ptr.Int32(int32(i64)) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeDocumentTimestreamConfig(v **types.TimestreamConfig, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12577,6 +14427,64 @@ func awsAwsjson10_deserializeOpDocumentCreateSignalCatalogOutput(v **CreateSigna return nil } +func awsAwsjson10_deserializeOpDocumentCreateStateTemplateOutput(v **CreateStateTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateStateTemplateOutput + if *v == nil { + sv = &CreateStateTemplateOutput{} + } 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 "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceUniqueId 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 resourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentCreateVehicleOutput(v **CreateVehicleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -12699,7 +14607,56 @@ func awsAwsjson10_deserializeOpDocumentDeleteDecoderManifestOutput(v **DeleteDec var sv *DeleteDecoderManifestOutput if *v == nil { - sv = &DeleteDecoderManifestOutput{} + sv = &DeleteDecoderManifestOutput{} + } 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 "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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson10_deserializeOpDocumentDeleteFleetOutput(v **DeleteFleetOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeleteFleetOutput + if *v == nil { + sv = &DeleteFleetOutput{} } else { sv = *v } @@ -12715,13 +14672,13 @@ func awsAwsjson10_deserializeOpDocumentDeleteDecoderManifestOutput(v **DeleteDec sv.Arn = ptr.String(jtv) } - case "name": + case "id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected resourceName to be of type string, got %T instead", value) + return fmt.Errorf("expected fleetId to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Id = ptr.String(jtv) } default: @@ -12733,7 +14690,7 @@ func awsAwsjson10_deserializeOpDocumentDeleteDecoderManifestOutput(v **DeleteDec return nil } -func awsAwsjson10_deserializeOpDocumentDeleteFleetOutput(v **DeleteFleetOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentDeleteModelManifestOutput(v **DeleteModelManifestOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12746,9 +14703,9 @@ func awsAwsjson10_deserializeOpDocumentDeleteFleetOutput(v **DeleteFleetOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteFleetOutput + var sv *DeleteModelManifestOutput if *v == nil { - sv = &DeleteFleetOutput{} + sv = &DeleteModelManifestOutput{} } else { sv = *v } @@ -12764,13 +14721,13 @@ func awsAwsjson10_deserializeOpDocumentDeleteFleetOutput(v **DeleteFleetOutput, sv.Arn = ptr.String(jtv) } - case "id": + case "name": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected fleetId to be of type string, got %T instead", value) + return fmt.Errorf("expected resourceName to be of type string, got %T instead", value) } - sv.Id = ptr.String(jtv) + sv.Name = ptr.String(jtv) } default: @@ -12782,7 +14739,7 @@ func awsAwsjson10_deserializeOpDocumentDeleteFleetOutput(v **DeleteFleetOutput, return nil } -func awsAwsjson10_deserializeOpDocumentDeleteModelManifestOutput(v **DeleteModelManifestOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentDeleteSignalCatalogOutput(v **DeleteSignalCatalogOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12795,9 +14752,9 @@ func awsAwsjson10_deserializeOpDocumentDeleteModelManifestOutput(v **DeleteModel return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteModelManifestOutput + var sv *DeleteSignalCatalogOutput if *v == nil { - sv = &DeleteModelManifestOutput{} + sv = &DeleteSignalCatalogOutput{} } else { sv = *v } @@ -12831,7 +14788,7 @@ func awsAwsjson10_deserializeOpDocumentDeleteModelManifestOutput(v **DeleteModel return nil } -func awsAwsjson10_deserializeOpDocumentDeleteSignalCatalogOutput(v **DeleteSignalCatalogOutput, value interface{}) error { +func awsAwsjson10_deserializeOpDocumentDeleteStateTemplateOutput(v **DeleteStateTemplateOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -12844,9 +14801,9 @@ func awsAwsjson10_deserializeOpDocumentDeleteSignalCatalogOutput(v **DeleteSigna return fmt.Errorf("unexpected JSON type %v", value) } - var sv *DeleteSignalCatalogOutput + var sv *DeleteStateTemplateOutput if *v == nil { - sv = &DeleteSignalCatalogOutput{} + sv = &DeleteStateTemplateOutput{} } else { sv = *v } @@ -12862,6 +14819,15 @@ func awsAwsjson10_deserializeOpDocumentDeleteSignalCatalogOutput(v **DeleteSigna sv.Arn = ptr.String(jtv) } + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceUniqueId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + case "name": if value != nil { jtv, ok := value.(string) @@ -13031,6 +14997,11 @@ func awsAwsjson10_deserializeOpDocumentGetCampaignOutput(v **GetCampaignOutput, return err } + case "dataPartitions": + if err := awsAwsjson10_deserializeDocumentDataPartitions(&sv.DataPartitions, value); err != nil { + return err + } + case "description": if value != nil { jtv, ok := value.(string) @@ -13130,6 +15101,11 @@ func awsAwsjson10_deserializeOpDocumentGetCampaignOutput(v **GetCampaignOutput, return err } + case "signalsToFetch": + if err := awsAwsjson10_deserializeDocumentSignalFetchInformationList(&sv.SignalsToFetch, value); err != nil { + return err + } + case "spoolingMode": if value != nil { jtv, ok := value.(string) @@ -13827,6 +15803,129 @@ func awsAwsjson10_deserializeOpDocumentGetSignalCatalogOutput(v **GetSignalCatal return nil } +func awsAwsjson10_deserializeOpDocumentGetStateTemplateOutput(v **GetStateTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetStateTemplateOutput + if *v == nil { + sv = &GetStateTemplateOutput{} + } 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 "creationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CreationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "dataExtraDimensions": + if err := awsAwsjson10_deserializeDocumentStateTemplateDataExtraDimensionNodePathList(&sv.DataExtraDimensions, value); err != nil { + return err + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected description 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 ResourceUniqueId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "lastModificationTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.LastModificationTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected timestamp to be a JSON Number, got %T instead", value) + + } + } + + case "metadataExtraDimensions": + if err := awsAwsjson10_deserializeDocumentStateTemplateMetadataExtraDimensionNodePathList(&sv.MetadataExtraDimensions, value); err != nil { + return err + } + + 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 "signalCatalogArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected arn to be of type string, got %T instead", value) + } + sv.SignalCatalogArn = ptr.String(jtv) + } + + case "stateTemplateProperties": + if err := awsAwsjson10_deserializeDocumentStateTemplateProperties(&sv.StateTemplateProperties, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentGetVehicleOutput(v **GetVehicleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -13913,6 +16012,11 @@ func awsAwsjson10_deserializeOpDocumentGetVehicleOutput(v **GetVehicleOutput, va sv.ModelManifestArn = ptr.String(jtv) } + case "stateTemplates": + if err := awsAwsjson10_deserializeDocumentStateTemplateAssociations(&sv.StateTemplates, value); err != nil { + return err + } + case "vehicleName": if value != nil { jtv, ok := value.(string) @@ -14524,6 +16628,51 @@ func awsAwsjson10_deserializeOpDocumentListSignalCatalogsOutput(v **ListSignalCa return nil } +func awsAwsjson10_deserializeOpDocumentListStateTemplatesOutput(v **ListStateTemplatesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListStateTemplatesOutput + if *v == nil { + sv = &ListStateTemplatesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected nextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "summaries": + if err := awsAwsjson10_deserializeDocumentStateTemplateSummaries(&sv.Summaries, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15137,6 +17286,64 @@ func awsAwsjson10_deserializeOpDocumentUpdateSignalCatalogOutput(v **UpdateSigna return nil } +func awsAwsjson10_deserializeOpDocumentUpdateStateTemplateOutput(v **UpdateStateTemplateOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateStateTemplateOutput + if *v == nil { + sv = &UpdateStateTemplateOutput{} + } 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 "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceUniqueId 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 resourceName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson10_deserializeOpDocumentUpdateVehicleOutput(v **UpdateVehicleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/iotfleetwise/doc.go b/service/iotfleetwise/doc.go index b5b29bfcd3a..3680cf2aa6c 100644 --- a/service/iotfleetwise/doc.go +++ b/service/iotfleetwise/doc.go @@ -12,5 +12,10 @@ // For more information, see [What is Amazon Web Services IoT FleetWise?] in the Amazon Web Services IoT FleetWise Developer // Guide. // +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// // [What is Amazon Web Services IoT FleetWise?]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/ +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html package iotfleetwise diff --git a/service/iotfleetwise/generated.json b/service/iotfleetwise/generated.json index 7620c8f900a..6f16a6cdb44 100644 --- a/service/iotfleetwise/generated.json +++ b/service/iotfleetwise/generated.json @@ -16,12 +16,14 @@ "api_op_CreateFleet.go", "api_op_CreateModelManifest.go", "api_op_CreateSignalCatalog.go", + "api_op_CreateStateTemplate.go", "api_op_CreateVehicle.go", "api_op_DeleteCampaign.go", "api_op_DeleteDecoderManifest.go", "api_op_DeleteFleet.go", "api_op_DeleteModelManifest.go", "api_op_DeleteSignalCatalog.go", + "api_op_DeleteStateTemplate.go", "api_op_DeleteVehicle.go", "api_op_DisassociateVehicleFleet.go", "api_op_GetCampaign.go", @@ -32,6 +34,7 @@ "api_op_GetModelManifest.go", "api_op_GetRegisterAccountStatus.go", "api_op_GetSignalCatalog.go", + "api_op_GetStateTemplate.go", "api_op_GetVehicle.go", "api_op_GetVehicleStatus.go", "api_op_ImportDecoderManifest.go", @@ -46,6 +49,7 @@ "api_op_ListModelManifests.go", "api_op_ListSignalCatalogNodes.go", "api_op_ListSignalCatalogs.go", + "api_op_ListStateTemplates.go", "api_op_ListTagsForResource.go", "api_op_ListVehicles.go", "api_op_ListVehiclesInFleet.go", @@ -59,6 +63,7 @@ "api_op_UpdateFleet.go", "api_op_UpdateModelManifest.go", "api_op_UpdateSignalCatalog.go", + "api_op_UpdateStateTemplate.go", "api_op_UpdateVehicle.go", "auth.go", "deserializers.go", diff --git a/service/iotfleetwise/serializers.go b/service/iotfleetwise/serializers.go index 3bfc563a4fb..8e8aec6fb44 100644 --- a/service/iotfleetwise/serializers.go +++ b/service/iotfleetwise/serializers.go @@ -506,6 +506,67 @@ func (m *awsAwsjson10_serializeOpCreateSignalCatalog) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpCreateStateTemplate struct { +} + +func (*awsAwsjson10_serializeOpCreateStateTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpCreateStateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateStateTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("IoTAutobahnControlPlane.CreateStateTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentCreateStateTemplateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpCreateVehicle struct { } @@ -872,6 +933,67 @@ func (m *awsAwsjson10_serializeOpDeleteSignalCatalog) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpDeleteStateTemplate struct { +} + +func (*awsAwsjson10_serializeOpDeleteStateTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpDeleteStateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteStateTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("IoTAutobahnControlPlane.DeleteStateTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentDeleteStateTemplateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpDeleteVehicle struct { } @@ -1482,6 +1604,67 @@ func (m *awsAwsjson10_serializeOpGetSignalCatalog) HandleSerialize(ctx context.C return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpGetStateTemplate struct { +} + +func (*awsAwsjson10_serializeOpGetStateTemplate) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpGetStateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetStateTemplateInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("IoTAutobahnControlPlane.GetStateTemplate") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentGetStateTemplateInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpGetVehicle struct { } @@ -2336,6 +2519,67 @@ func (m *awsAwsjson10_serializeOpListSignalCatalogs) HandleSerialize(ctx context return next.HandleSerialize(ctx, in) } +type awsAwsjson10_serializeOpListStateTemplates struct { +} + +func (*awsAwsjson10_serializeOpListStateTemplates) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpListStateTemplates) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListStateTemplatesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("IoTAutobahnControlPlane.ListStateTemplates") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentListStateTemplatesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson10_serializeOpListTagsForResource struct { } @@ -3129,14 +3373,14 @@ func (m *awsAwsjson10_serializeOpUpdateSignalCatalog) HandleSerialize(ctx contex return next.HandleSerialize(ctx, in) } -type awsAwsjson10_serializeOpUpdateVehicle struct { +type awsAwsjson10_serializeOpUpdateStateTemplate struct { } -func (*awsAwsjson10_serializeOpUpdateVehicle) ID() string { +func (*awsAwsjson10_serializeOpUpdateStateTemplate) ID() string { return "OperationSerializer" } -func (m *awsAwsjson10_serializeOpUpdateVehicle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsAwsjson10_serializeOpUpdateStateTemplate) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -3148,7 +3392,7 @@ func (m *awsAwsjson10_serializeOpUpdateVehicle) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*UpdateVehicleInput) + input, ok := in.Parameters.(*UpdateStateTemplateInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} @@ -3169,10 +3413,10 @@ func (m *awsAwsjson10_serializeOpUpdateVehicle) HandleSerialize(ctx context.Cont return out, metadata, &smithy.SerializationError{Err: err} } httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") - httpBindingEncoder.SetHeader("X-Amz-Target").String("IoTAutobahnControlPlane.UpdateVehicle") + httpBindingEncoder.SetHeader("X-Amz-Target").String("IoTAutobahnControlPlane.UpdateStateTemplate") jsonEncoder := smithyjson.NewEncoder() - if err := awsAwsjson10_serializeOpDocumentUpdateVehicleInput(input, jsonEncoder.Value); err != nil { + if err := awsAwsjson10_serializeOpDocumentUpdateStateTemplateInput(input, jsonEncoder.Value); err != nil { return out, metadata, &smithy.SerializationError{Err: err} } @@ -3189,24 +3433,85 @@ func (m *awsAwsjson10_serializeOpUpdateVehicle) HandleSerialize(ctx context.Cont span.End() return next.HandleSerialize(ctx, in) } -func awsAwsjson10_serializeDocumentActuator(v *types.Actuator, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - if v.AllowedValues != nil { - ok := object.Key("allowedValues") - if err := awsAwsjson10_serializeDocumentListOfStrings(v.AllowedValues, ok); err != nil { - return err - } - } +type awsAwsjson10_serializeOpUpdateVehicle struct { +} - if v.AssignedValue != nil { - ok := object.Key("assignedValue") - ok.String(*v.AssignedValue) +func (*awsAwsjson10_serializeOpUpdateVehicle) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson10_serializeOpUpdateVehicle) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - if v.Comment != nil { - ok := object.Key("comment") + input, ok := in.Parameters.(*UpdateVehicleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.0") + httpBindingEncoder.SetHeader("X-Amz-Target").String("IoTAutobahnControlPlane.UpdateVehicle") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson10_serializeOpDocumentUpdateVehicleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsAwsjson10_serializeDocumentActuator(v *types.Actuator, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.AllowedValues != nil { + ok := object.Key("allowedValues") + if err := awsAwsjson10_serializeDocumentListOfStrings(v.AllowedValues, ok); err != nil { + return err + } + } + + if v.AssignedValue != nil { + ok := object.Key("assignedValue") + ok.String(*v.AssignedValue) + } + + if v.Comment != nil { + ok := object.Key("comment") ok.String(*v.Comment) } @@ -3618,6 +3923,23 @@ func awsAwsjson10_serializeDocumentConditionBasedCollectionScheme(v *types.Condi return nil } +func awsAwsjson10_serializeDocumentConditionBasedSignalFetchConfig(v *types.ConditionBasedSignalFetchConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConditionExpression != nil { + ok := object.Key("conditionExpression") + ok.String(*v.ConditionExpression) + } + + if len(v.TriggerMode) > 0 { + ok := object.Key("triggerMode") + ok.String(string(v.TriggerMode)) + } + + return nil +} + func awsAwsjson10_serializeDocumentCreateVehicleRequestItem(v *types.CreateVehicleRequestItem, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3644,6 +3966,13 @@ func awsAwsjson10_serializeDocumentCreateVehicleRequestItem(v *types.CreateVehic ok.String(*v.ModelManifestArn) } + if v.StateTemplates != nil { + ok := object.Key("stateTemplates") + if err := awsAwsjson10_serializeDocumentStateTemplateAssociations(v.StateTemplates, ok); err != nil { + return err + } + } + if v.Tags != nil { ok := object.Key("tags") if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil { @@ -3672,6 +4001,30 @@ func awsAwsjson10_serializeDocumentCreateVehicleRequestItems(v []types.CreateVeh return nil } +func awsAwsjson10_serializeDocumentCustomDecodingInterface(v *types.CustomDecodingInterface, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsAwsjson10_serializeDocumentCustomDecodingSignal(v *types.CustomDecodingSignal, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + return nil +} + func awsAwsjson10_serializeDocumentCustomProperty(v *types.CustomProperty, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3746,6 +4099,12 @@ func awsAwsjson10_serializeDocumentDataDestinationConfig(v types.DataDestination defer object.Close() switch uv := v.(type) { + case *types.DataDestinationConfigMemberMqttTopicConfig: + av := object.Key("mqttTopicConfig") + if err := awsAwsjson10_serializeDocumentMqttTopicConfig(&uv.Value, av); err != nil { + return err + } + case *types.DataDestinationConfigMemberS3Config: av := object.Key("s3Config") if err := awsAwsjson10_serializeDocumentS3Config(&uv.Value, av); err != nil { @@ -3792,6 +4151,99 @@ func awsAwsjson10_serializeDocumentDataExtraDimensionNodePathList(v []string, va return nil } +func awsAwsjson10_serializeDocumentDataPartition(v *types.DataPartition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Id != nil { + ok := object.Key("id") + ok.String(*v.Id) + } + + if v.StorageOptions != nil { + ok := object.Key("storageOptions") + if err := awsAwsjson10_serializeDocumentDataPartitionStorageOptions(v.StorageOptions, ok); err != nil { + return err + } + } + + if v.UploadOptions != nil { + ok := object.Key("uploadOptions") + if err := awsAwsjson10_serializeDocumentDataPartitionUploadOptions(v.UploadOptions, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentDataPartitions(v []types.DataPartition, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentDataPartition(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentDataPartitionStorageOptions(v *types.DataPartitionStorageOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaximumSize != nil { + ok := object.Key("maximumSize") + if err := awsAwsjson10_serializeDocumentStorageMaximumSize(v.MaximumSize, ok); err != nil { + return err + } + } + + if v.MinimumTimeToLive != nil { + ok := object.Key("minimumTimeToLive") + if err := awsAwsjson10_serializeDocumentStorageMinimumTimeToLive(v.MinimumTimeToLive, ok); err != nil { + return err + } + } + + if v.StorageLocation != nil { + ok := object.Key("storageLocation") + ok.String(*v.StorageLocation) + } + + return nil +} + +func awsAwsjson10_serializeDocumentDataPartitionUploadOptions(v *types.DataPartitionUploadOptions, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConditionLanguageVersion != nil { + ok := object.Key("conditionLanguageVersion") + ok.Integer(*v.ConditionLanguageVersion) + } + + if v.Expression != nil { + ok := object.Key("expression") + ok.String(*v.Expression) + } + + return nil +} + +func awsAwsjson10_serializeDocumentEventExpressionList(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 awsAwsjson10_serializeDocumentFormattedVss(v types.FormattedVss, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3883,6 +4335,23 @@ func awsAwsjson10_serializeDocumentModelSignalsMap(v map[string]string, value sm return nil } +func awsAwsjson10_serializeDocumentMqttTopicConfig(v *types.MqttTopicConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExecutionRoleArn != nil { + ok := object.Key("executionRoleArn") + ok.String(*v.ExecutionRoleArn) + } + + if v.MqttTopicArn != nil { + ok := object.Key("mqttTopicArn") + ok.String(*v.MqttTopicArn) + } + + return nil +} + func awsAwsjson10_serializeDocumentNetworkFileDefinition(v types.NetworkFileDefinition, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3942,6 +4411,13 @@ func awsAwsjson10_serializeDocumentNetworkInterface(v *types.NetworkInterface, v } } + if v.CustomDecodingInterface != nil { + ok := object.Key("customDecodingInterface") + if err := awsAwsjson10_serializeDocumentCustomDecodingInterface(v.CustomDecodingInterface, ok); err != nil { + return err + } + } + if v.InterfaceId != nil { ok := object.Key("interfaceId") ok.String(*v.InterfaceId) @@ -4177,6 +4653,27 @@ func awsAwsjson10_serializeDocumentObdSignal(v *types.ObdSignal, value smithyjso return nil } +func awsAwsjson10_serializeDocumentOnChangeStateTemplateUpdateStrategy(v *types.OnChangeStateTemplateUpdateStrategy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + return nil +} + +func awsAwsjson10_serializeDocumentPeriodicStateTemplateUpdateStrategy(v *types.PeriodicStateTemplateUpdateStrategy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.StateTemplateUpdateRate != nil { + ok := object.Key("stateTemplateUpdateRate") + if err := awsAwsjson10_serializeDocumentTimePeriod(v.StateTemplateUpdateRate, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeDocumentPrimitiveMessageDefinition(v types.PrimitiveMessageDefinition, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4371,6 +4868,13 @@ func awsAwsjson10_serializeDocumentSignalDecoder(v *types.SignalDecoder, value s } } + if v.CustomDecodingSignal != nil { + ok := object.Key("customDecodingSignal") + if err := awsAwsjson10_serializeDocumentCustomDecodingSignal(v.CustomDecodingSignal, ok); err != nil { + return err + } + } + if v.FullyQualifiedName != nil { ok := object.Key("fullyQualifiedName") ok.String(*v.FullyQualifiedName) @@ -4381,73 +4885,280 @@ func awsAwsjson10_serializeDocumentSignalDecoder(v *types.SignalDecoder, value s ok.String(*v.InterfaceId) } - if v.MessageSignal != nil { - ok := object.Key("messageSignal") - if err := awsAwsjson10_serializeDocumentMessageSignal(v.MessageSignal, ok); err != nil { + if v.MessageSignal != nil { + ok := object.Key("messageSignal") + if err := awsAwsjson10_serializeDocumentMessageSignal(v.MessageSignal, ok); err != nil { + return err + } + } + + if v.ObdSignal != nil { + ok := object.Key("obdSignal") + if err := awsAwsjson10_serializeDocumentObdSignal(v.ObdSignal, ok); err != nil { + return err + } + } + + if len(v.Type) > 0 { + ok := object.Key("type") + ok.String(string(v.Type)) + } + + return nil +} + +func awsAwsjson10_serializeDocumentSignalDecoders(v []types.SignalDecoder, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentSignalDecoder(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentSignalFetchConfig(v types.SignalFetchConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.SignalFetchConfigMemberConditionBased: + av := object.Key("conditionBased") + if err := awsAwsjson10_serializeDocumentConditionBasedSignalFetchConfig(&uv.Value, av); err != nil { + return err + } + + case *types.SignalFetchConfigMemberTimeBased: + av := object.Key("timeBased") + if err := awsAwsjson10_serializeDocumentTimeBasedSignalFetchConfig(&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 awsAwsjson10_serializeDocumentSignalFetchInformation(v *types.SignalFetchInformation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Actions != nil { + ok := object.Key("actions") + if err := awsAwsjson10_serializeDocumentEventExpressionList(v.Actions, ok); err != nil { + return err + } + } + + if v.ConditionLanguageVersion != nil { + ok := object.Key("conditionLanguageVersion") + ok.Integer(*v.ConditionLanguageVersion) + } + + if v.FullyQualifiedName != nil { + ok := object.Key("fullyQualifiedName") + ok.String(*v.FullyQualifiedName) + } + + if v.SignalFetchConfig != nil { + ok := object.Key("signalFetchConfig") + if err := awsAwsjson10_serializeDocumentSignalFetchConfig(v.SignalFetchConfig, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson10_serializeDocumentSignalFetchInformationList(v []types.SignalFetchInformation, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentSignalFetchInformation(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson10_serializeDocumentSignalInformation(v *types.SignalInformation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataPartitionId != nil { + ok := object.Key("dataPartitionId") + ok.String(*v.DataPartitionId) + } + + if v.MaxSampleCount != nil { + ok := object.Key("maxSampleCount") + ok.Long(*v.MaxSampleCount) + } + + if v.MinimumSamplingIntervalMs != nil { + ok := object.Key("minimumSamplingIntervalMs") + ok.Long(*v.MinimumSamplingIntervalMs) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsAwsjson10_serializeDocumentSignalInformationList(v []types.SignalInformation, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson10_serializeDocumentSignalInformation(&v[i], av); err != nil { return err } } + return nil +} + +func awsAwsjson10_serializeDocumentStateTemplateAssociation(v *types.StateTemplateAssociation, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("identifier") + ok.String(*v.Identifier) + } - if v.ObdSignal != nil { - ok := object.Key("obdSignal") - if err := awsAwsjson10_serializeDocumentObdSignal(v.ObdSignal, ok); err != nil { + if v.StateTemplateUpdateStrategy != nil { + ok := object.Key("stateTemplateUpdateStrategy") + if err := awsAwsjson10_serializeDocumentStateTemplateUpdateStrategy(v.StateTemplateUpdateStrategy, ok); err != nil { return err } } - if len(v.Type) > 0 { - ok := object.Key("type") - ok.String(string(v.Type)) - } + return nil +} + +func awsAwsjson10_serializeDocumentStateTemplateAssociationIdentifiers(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 awsAwsjson10_serializeDocumentSignalDecoders(v []types.SignalDecoder, value smithyjson.Value) error { +func awsAwsjson10_serializeDocumentStateTemplateAssociations(v []types.StateTemplateAssociation, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() - if err := awsAwsjson10_serializeDocumentSignalDecoder(&v[i], av); err != nil { + if err := awsAwsjson10_serializeDocumentStateTemplateAssociation(&v[i], av); err != nil { return err } } return nil } -func awsAwsjson10_serializeDocumentSignalInformation(v *types.SignalInformation, value smithyjson.Value) error { - object := value.Object() - defer object.Close() +func awsAwsjson10_serializeDocumentStateTemplateDataExtraDimensionNodePathList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() - if v.MaxSampleCount != nil { - ok := object.Key("maxSampleCount") - ok.Long(*v.MaxSampleCount) + for i := range v { + av := array.Value() + av.String(v[i]) } + return nil +} - if v.MinimumSamplingIntervalMs != nil { - ok := object.Key("minimumSamplingIntervalMs") - ok.Long(*v.MinimumSamplingIntervalMs) - } +func awsAwsjson10_serializeDocumentStateTemplateMetadataExtraDimensionNodePathList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() - if v.Name != nil { - ok := object.Key("name") - ok.String(*v.Name) + for i := range v { + av := array.Value() + av.String(v[i]) } - return nil } -func awsAwsjson10_serializeDocumentSignalInformationList(v []types.SignalInformation, value smithyjson.Value) error { +func awsAwsjson10_serializeDocumentStateTemplateProperties(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() for i := range v { av := array.Value() - if err := awsAwsjson10_serializeDocumentSignalInformation(&v[i], av); err != nil { + av.String(v[i]) + } + return nil +} + +func awsAwsjson10_serializeDocumentStateTemplateUpdateStrategy(v types.StateTemplateUpdateStrategy, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.StateTemplateUpdateStrategyMemberOnChange: + av := object.Key("onChange") + if err := awsAwsjson10_serializeDocumentOnChangeStateTemplateUpdateStrategy(&uv.Value, av); err != nil { return err } + + case *types.StateTemplateUpdateStrategyMemberPeriodic: + av := object.Key("periodic") + if err := awsAwsjson10_serializeDocumentPeriodicStateTemplateUpdateStrategy(&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 awsAwsjson10_serializeDocumentStorageMaximumSize(v *types.StorageMaximumSize, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Unit) > 0 { + ok := object.Key("unit") + ok.String(string(v.Unit)) + } + + if v.Value != nil { + ok := object.Key("value") + ok.Integer(*v.Value) + } + + return nil +} + +func awsAwsjson10_serializeDocumentStorageMinimumTimeToLive(v *types.StorageMinimumTimeToLive, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Unit) > 0 { + ok := object.Key("unit") + ok.String(string(v.Unit)) + } + + if v.Value != nil { + ok := object.Key("value") + ok.Integer(*v.Value) } + return nil } @@ -4595,6 +5306,35 @@ func awsAwsjson10_serializeDocumentTimeBasedCollectionScheme(v *types.TimeBasedC return nil } +func awsAwsjson10_serializeDocumentTimeBasedSignalFetchConfig(v *types.TimeBasedSignalFetchConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExecutionFrequencyMs != nil { + ok := object.Key("executionFrequencyMs") + ok.Long(*v.ExecutionFrequencyMs) + } + + return nil +} + +func awsAwsjson10_serializeDocumentTimePeriod(v *types.TimePeriod, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Unit) > 0 { + ok := object.Key("unit") + ok.String(string(v.Unit)) + } + + if v.Value != nil { + ok := object.Key("value") + ok.Integer(*v.Value) + } + + return nil +} + func awsAwsjson10_serializeDocumentTimestreamConfig(v *types.TimestreamConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -4655,6 +5395,20 @@ func awsAwsjson10_serializeDocumentUpdateVehicleRequestItem(v *types.UpdateVehic ok.String(*v.ModelManifestArn) } + if v.StateTemplatesToAdd != nil { + ok := object.Key("stateTemplatesToAdd") + if err := awsAwsjson10_serializeDocumentStateTemplateAssociations(v.StateTemplatesToAdd, ok); err != nil { + return err + } + } + + if v.StateTemplatesToRemove != nil { + ok := object.Key("stateTemplatesToRemove") + if err := awsAwsjson10_serializeDocumentStateTemplateAssociationIdentifiers(v.StateTemplatesToRemove, ok); err != nil { + return err + } + } + if v.VehicleName != nil { ok := object.Key("vehicleName") ok.String(*v.VehicleName) @@ -4768,6 +5522,13 @@ func awsAwsjson10_serializeOpDocumentCreateCampaignInput(v *CreateCampaignInput, } } + if v.DataPartitions != nil { + ok := object.Key("dataPartitions") + if err := awsAwsjson10_serializeDocumentDataPartitions(v.DataPartitions, ok); err != nil { + return err + } + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -4810,6 +5571,13 @@ func awsAwsjson10_serializeOpDocumentCreateCampaignInput(v *CreateCampaignInput, } } + if v.SignalsToFetch != nil { + ok := object.Key("signalsToFetch") + if err := awsAwsjson10_serializeDocumentSignalFetchInformationList(v.SignalsToFetch, ok); err != nil { + return err + } + } + if len(v.SpoolingMode) > 0 { ok := object.Key("spoolingMode") ok.String(string(v.SpoolingMode)) @@ -4839,6 +5607,11 @@ func awsAwsjson10_serializeOpDocumentCreateDecoderManifestInput(v *CreateDecoder object := value.Object() defer object.Close() + if len(v.DefaultForUnmappedSignals) > 0 { + ok := object.Key("defaultForUnmappedSignals") + ok.String(string(v.DefaultForUnmappedSignals)) + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -4974,6 +5747,56 @@ func awsAwsjson10_serializeOpDocumentCreateSignalCatalogInput(v *CreateSignalCat return nil } +func awsAwsjson10_serializeOpDocumentCreateStateTemplateInput(v *CreateStateTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataExtraDimensions != nil { + ok := object.Key("dataExtraDimensions") + if err := awsAwsjson10_serializeDocumentStateTemplateDataExtraDimensionNodePathList(v.DataExtraDimensions, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.MetadataExtraDimensions != nil { + ok := object.Key("metadataExtraDimensions") + if err := awsAwsjson10_serializeDocumentStateTemplateMetadataExtraDimensionNodePathList(v.MetadataExtraDimensions, ok); err != nil { + return err + } + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.SignalCatalogArn != nil { + ok := object.Key("signalCatalogArn") + ok.String(*v.SignalCatalogArn) + } + + if v.StateTemplateProperties != nil { + ok := object.Key("stateTemplateProperties") + if err := awsAwsjson10_serializeDocumentStateTemplateProperties(v.StateTemplateProperties, ok); err != nil { + return err + } + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentCreateVehicleInput(v *CreateVehicleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5000,6 +5823,13 @@ func awsAwsjson10_serializeOpDocumentCreateVehicleInput(v *CreateVehicleInput, v ok.String(*v.ModelManifestArn) } + if v.StateTemplates != nil { + ok := object.Key("stateTemplates") + if err := awsAwsjson10_serializeDocumentStateTemplateAssociations(v.StateTemplates, ok); err != nil { + return err + } + } + if v.Tags != nil { ok := object.Key("tags") if err := awsAwsjson10_serializeDocumentTagList(v.Tags, ok); err != nil { @@ -5075,6 +5905,18 @@ func awsAwsjson10_serializeOpDocumentDeleteSignalCatalogInput(v *DeleteSignalCat return nil } +func awsAwsjson10_serializeOpDocumentDeleteStateTemplateInput(v *DeleteStateTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("identifier") + ok.String(*v.Identifier) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentDeleteVehicleInput(v *DeleteVehicleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5185,6 +6027,18 @@ func awsAwsjson10_serializeOpDocumentGetSignalCatalogInput(v *GetSignalCatalogIn return nil } +func awsAwsjson10_serializeOpDocumentGetStateTemplateInput(v *GetStateTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Identifier != nil { + ok := object.Key("identifier") + ok.String(*v.Identifier) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentGetVehicleInput(v *GetVehicleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5484,6 +6338,23 @@ func awsAwsjson10_serializeOpDocumentListSignalCatalogsInput(v *ListSignalCatalo return nil } +func awsAwsjson10_serializeOpDocumentListStateTemplatesInput(v *ListStateTemplatesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MaxResults != nil { + ok := object.Key("maxResults") + ok.Integer(*v.MaxResults) + } + + if v.NextToken != nil { + ok := object.Key("nextToken") + ok.String(*v.NextToken) + } + + return nil +} + func awsAwsjson10_serializeOpDocumentListTagsForResourceInput(v *ListTagsForResourceInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5677,6 +6548,11 @@ func awsAwsjson10_serializeOpDocumentUpdateDecoderManifestInput(v *UpdateDecoder object := value.Object() defer object.Close() + if len(v.DefaultForUnmappedSignals) > 0 { + ok := object.Key("defaultForUnmappedSignals") + ok.String(string(v.DefaultForUnmappedSignals)) + } + if v.Description != nil { ok := object.Key("description") ok.String(*v.Description) @@ -5828,6 +6704,51 @@ func awsAwsjson10_serializeOpDocumentUpdateSignalCatalogInput(v *UpdateSignalCat return nil } +func awsAwsjson10_serializeOpDocumentUpdateStateTemplateInput(v *UpdateStateTemplateInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DataExtraDimensions != nil { + ok := object.Key("dataExtraDimensions") + if err := awsAwsjson10_serializeDocumentStateTemplateDataExtraDimensionNodePathList(v.DataExtraDimensions, ok); err != nil { + return err + } + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Identifier != nil { + ok := object.Key("identifier") + ok.String(*v.Identifier) + } + + if v.MetadataExtraDimensions != nil { + ok := object.Key("metadataExtraDimensions") + if err := awsAwsjson10_serializeDocumentStateTemplateMetadataExtraDimensionNodePathList(v.MetadataExtraDimensions, ok); err != nil { + return err + } + } + + if v.StateTemplatePropertiesToAdd != nil { + ok := object.Key("stateTemplatePropertiesToAdd") + if err := awsAwsjson10_serializeDocumentStateTemplateProperties(v.StateTemplatePropertiesToAdd, ok); err != nil { + return err + } + } + + if v.StateTemplatePropertiesToRemove != nil { + ok := object.Key("stateTemplatePropertiesToRemove") + if err := awsAwsjson10_serializeDocumentStateTemplateProperties(v.StateTemplatePropertiesToRemove, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson10_serializeOpDocumentUpdateVehicleInput(v *UpdateVehicleInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5854,6 +6775,20 @@ func awsAwsjson10_serializeOpDocumentUpdateVehicleInput(v *UpdateVehicleInput, v ok.String(*v.ModelManifestArn) } + if v.StateTemplatesToAdd != nil { + ok := object.Key("stateTemplatesToAdd") + if err := awsAwsjson10_serializeDocumentStateTemplateAssociations(v.StateTemplatesToAdd, ok); err != nil { + return err + } + } + + if v.StateTemplatesToRemove != nil { + ok := object.Key("stateTemplatesToRemove") + if err := awsAwsjson10_serializeDocumentStateTemplateAssociationIdentifiers(v.StateTemplatesToRemove, ok); err != nil { + return err + } + } + if v.VehicleName != nil { ok := object.Key("vehicleName") ok.String(*v.VehicleName) diff --git a/service/iotfleetwise/snapshot/api_op_CreateStateTemplate.go.snap b/service/iotfleetwise/snapshot/api_op_CreateStateTemplate.go.snap new file mode 100644 index 00000000000..7b987eb70e8 --- /dev/null +++ b/service/iotfleetwise/snapshot/api_op_CreateStateTemplate.go.snap @@ -0,0 +1,41 @@ +CreateStateTemplate + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iotfleetwise/snapshot/api_op_DeleteStateTemplate.go.snap b/service/iotfleetwise/snapshot/api_op_DeleteStateTemplate.go.snap new file mode 100644 index 00000000000..da63bb180c6 --- /dev/null +++ b/service/iotfleetwise/snapshot/api_op_DeleteStateTemplate.go.snap @@ -0,0 +1,41 @@ +DeleteStateTemplate + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iotfleetwise/snapshot/api_op_GetStateTemplate.go.snap b/service/iotfleetwise/snapshot/api_op_GetStateTemplate.go.snap new file mode 100644 index 00000000000..6caa777509e --- /dev/null +++ b/service/iotfleetwise/snapshot/api_op_GetStateTemplate.go.snap @@ -0,0 +1,41 @@ +GetStateTemplate + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iotfleetwise/snapshot/api_op_ListStateTemplates.go.snap b/service/iotfleetwise/snapshot/api_op_ListStateTemplates.go.snap new file mode 100644 index 00000000000..c6f855355cd --- /dev/null +++ b/service/iotfleetwise/snapshot/api_op_ListStateTemplates.go.snap @@ -0,0 +1,40 @@ +ListStateTemplates + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iotfleetwise/snapshot/api_op_UpdateStateTemplate.go.snap b/service/iotfleetwise/snapshot/api_op_UpdateStateTemplate.go.snap new file mode 100644 index 00000000000..ff45e0d688e --- /dev/null +++ b/service/iotfleetwise/snapshot/api_op_UpdateStateTemplate.go.snap @@ -0,0 +1,41 @@ +UpdateStateTemplate + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iotfleetwise/snapshot_test.go b/service/iotfleetwise/snapshot_test.go index 384debcee0d..ce16604cbe8 100644 --- a/service/iotfleetwise/snapshot_test.go +++ b/service/iotfleetwise/snapshot_test.go @@ -158,6 +158,18 @@ func TestCheckSnapshot_CreateSignalCatalog(t *testing.T) { } } +func TestCheckSnapshot_CreateStateTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateStateTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateStateTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateVehicle(t *testing.T) { svc := New(Options{}) _, err := svc.CreateVehicle(context.Background(), nil, func(o *Options) { @@ -230,6 +242,18 @@ func TestCheckSnapshot_DeleteSignalCatalog(t *testing.T) { } } +func TestCheckSnapshot_DeleteStateTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteStateTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteStateTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DeleteVehicle(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteVehicle(context.Background(), nil, func(o *Options) { @@ -350,6 +374,18 @@ func TestCheckSnapshot_GetSignalCatalog(t *testing.T) { } } +func TestCheckSnapshot_GetStateTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetStateTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetStateTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetVehicle(t *testing.T) { svc := New(Options{}) _, err := svc.GetVehicle(context.Background(), nil, func(o *Options) { @@ -518,6 +554,18 @@ func TestCheckSnapshot_ListSignalCatalogs(t *testing.T) { } } +func TestCheckSnapshot_ListStateTemplates(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListStateTemplates(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListStateTemplates") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -674,6 +722,18 @@ func TestCheckSnapshot_UpdateSignalCatalog(t *testing.T) { } } +func TestCheckSnapshot_UpdateStateTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateStateTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateStateTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateVehicle(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateVehicle(context.Background(), nil, func(o *Options) { @@ -781,6 +841,18 @@ func TestUpdateSnapshot_CreateSignalCatalog(t *testing.T) { } } +func TestUpdateSnapshot_CreateStateTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateStateTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateStateTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateVehicle(t *testing.T) { svc := New(Options{}) _, err := svc.CreateVehicle(context.Background(), nil, func(o *Options) { @@ -853,6 +925,18 @@ func TestUpdateSnapshot_DeleteSignalCatalog(t *testing.T) { } } +func TestUpdateSnapshot_DeleteStateTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteStateTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteStateTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DeleteVehicle(t *testing.T) { svc := New(Options{}) _, err := svc.DeleteVehicle(context.Background(), nil, func(o *Options) { @@ -973,6 +1057,18 @@ func TestUpdateSnapshot_GetSignalCatalog(t *testing.T) { } } +func TestUpdateSnapshot_GetStateTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetStateTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetStateTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetVehicle(t *testing.T) { svc := New(Options{}) _, err := svc.GetVehicle(context.Background(), nil, func(o *Options) { @@ -1141,6 +1237,18 @@ func TestUpdateSnapshot_ListSignalCatalogs(t *testing.T) { } } +func TestUpdateSnapshot_ListStateTemplates(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListStateTemplates(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListStateTemplates") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -1297,6 +1405,18 @@ func TestUpdateSnapshot_UpdateSignalCatalog(t *testing.T) { } } +func TestUpdateSnapshot_UpdateStateTemplate(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateStateTemplate(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateStateTemplate") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateVehicle(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateVehicle(context.Background(), nil, func(o *Options) { diff --git a/service/iotfleetwise/types/enums.go b/service/iotfleetwise/types/enums.go index 4caf135201b..39c1695f52d 100644 --- a/service/iotfleetwise/types/enums.go +++ b/service/iotfleetwise/types/enums.go @@ -63,6 +63,24 @@ func (DataFormat) Values() []DataFormat { } } +type DefaultForUnmappedSignalsType string + +// Enum values for DefaultForUnmappedSignalsType +const ( + DefaultForUnmappedSignalsTypeCustomDecoding DefaultForUnmappedSignalsType = "CUSTOM_DECODING" +) + +// Values returns all known values for DefaultForUnmappedSignalsType. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (DefaultForUnmappedSignalsType) Values() []DefaultForUnmappedSignalsType { + return []DefaultForUnmappedSignalsType{ + "CUSTOM_DECODING", + } +} + type DiagnosticsMode string // Enum values for DiagnosticsMode @@ -168,13 +186,14 @@ type NetworkInterfaceFailureReason string // Enum values for NetworkInterfaceFailureReason const ( - NetworkInterfaceFailureReasonDuplicateInterface NetworkInterfaceFailureReason = "DUPLICATE_NETWORK_INTERFACE" - NetworkInterfaceFailureReasonConflictingNetworkInterface NetworkInterfaceFailureReason = "CONFLICTING_NETWORK_INTERFACE" - NetworkInterfaceFailureReasonNetworkInterfaceToAddAlreadyExists NetworkInterfaceFailureReason = "NETWORK_INTERFACE_TO_ADD_ALREADY_EXISTS" - NetworkInterfaceFailureReasonCanNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "CAN_NETWORK_INTERFACE_INFO_IS_NULL" - NetworkInterfaceFailureReasonObdNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "OBD_NETWORK_INTERFACE_INFO_IS_NULL" - NetworkInterfaceFailureReasonNetworkInterfaceToRemoveAssociatedWithSignals NetworkInterfaceFailureReason = "NETWORK_INTERFACE_TO_REMOVE_ASSOCIATED_WITH_SIGNALS" - NetworkInterfaceFailureReasonVehicleMiddlewareNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "VEHICLE_MIDDLEWARE_NETWORK_INTERFACE_INFO_IS_NULL" + NetworkInterfaceFailureReasonDuplicateInterface NetworkInterfaceFailureReason = "DUPLICATE_NETWORK_INTERFACE" + NetworkInterfaceFailureReasonConflictingNetworkInterface NetworkInterfaceFailureReason = "CONFLICTING_NETWORK_INTERFACE" + NetworkInterfaceFailureReasonNetworkInterfaceToAddAlreadyExists NetworkInterfaceFailureReason = "NETWORK_INTERFACE_TO_ADD_ALREADY_EXISTS" + NetworkInterfaceFailureReasonCanNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "CAN_NETWORK_INTERFACE_INFO_IS_NULL" + NetworkInterfaceFailureReasonObdNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "OBD_NETWORK_INTERFACE_INFO_IS_NULL" + NetworkInterfaceFailureReasonNetworkInterfaceToRemoveAssociatedWithSignals NetworkInterfaceFailureReason = "NETWORK_INTERFACE_TO_REMOVE_ASSOCIATED_WITH_SIGNALS" + NetworkInterfaceFailureReasonVehicleMiddlewareNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "VEHICLE_MIDDLEWARE_NETWORK_INTERFACE_INFO_IS_NULL" + NetworkInterfaceFailureReasonCustomDecodingSignalNetworkInterfaceInfoIsNull NetworkInterfaceFailureReason = "CUSTOM_DECODING_SIGNAL_NETWORK_INTERFACE_INFO_IS_NULL" ) // Values returns all known values for NetworkInterfaceFailureReason. Note that @@ -191,6 +210,7 @@ func (NetworkInterfaceFailureReason) Values() []NetworkInterfaceFailureReason { "OBD_NETWORK_INTERFACE_INFO_IS_NULL", "NETWORK_INTERFACE_TO_REMOVE_ASSOCIATED_WITH_SIGNALS", "VEHICLE_MIDDLEWARE_NETWORK_INTERFACE_INFO_IS_NULL", + "CUSTOM_DECODING_SIGNAL_NETWORK_INTERFACE_INFO_IS_NULL", } } @@ -198,9 +218,10 @@ type NetworkInterfaceType string // Enum values for NetworkInterfaceType const ( - NetworkInterfaceTypeCanInterface NetworkInterfaceType = "CAN_INTERFACE" - NetworkInterfaceTypeObdInterface NetworkInterfaceType = "OBD_INTERFACE" - NetworkInterfaceTypeVehicleMiddleware NetworkInterfaceType = "VEHICLE_MIDDLEWARE" + NetworkInterfaceTypeCanInterface NetworkInterfaceType = "CAN_INTERFACE" + NetworkInterfaceTypeObdInterface NetworkInterfaceType = "OBD_INTERFACE" + NetworkInterfaceTypeVehicleMiddleware NetworkInterfaceType = "VEHICLE_MIDDLEWARE" + NetworkInterfaceTypeCustomDecodingInterface NetworkInterfaceType = "CUSTOM_DECODING_INTERFACE" ) // Values returns all known values for NetworkInterfaceType. Note that this can be @@ -212,6 +233,7 @@ func (NetworkInterfaceType) Values() []NetworkInterfaceType { "CAN_INTERFACE", "OBD_INTERFACE", "VEHICLE_MIDDLEWARE", + "CUSTOM_DECODING_INTERFACE", } } @@ -392,6 +414,7 @@ const ( SignalDecoderFailureReasonNoSignalInCatalogForDecoderSignal SignalDecoderFailureReason = "NO_SIGNAL_IN_CATALOG_FOR_DECODER_SIGNAL" SignalDecoderFailureReasonSignalDecoderIncompatibleWithSignalCatalog SignalDecoderFailureReason = "SIGNAL_DECODER_INCOMPATIBLE_WITH_SIGNAL_CATALOG" SignalDecoderFailureReasonEmptyMessageSignal SignalDecoderFailureReason = "EMPTY_MESSAGE_SIGNAL" + SignalDecoderFailureReasonCustomDecodingSignalInfoIsNull SignalDecoderFailureReason = "CUSTOM_DECODING_SIGNAL_INFO_IS_NULL" ) // Values returns all known values for SignalDecoderFailureReason. Note that this @@ -415,6 +438,7 @@ func (SignalDecoderFailureReason) Values() []SignalDecoderFailureReason { "NO_SIGNAL_IN_CATALOG_FOR_DECODER_SIGNAL", "SIGNAL_DECODER_INCOMPATIBLE_WITH_SIGNAL_CATALOG", "EMPTY_MESSAGE_SIGNAL", + "CUSTOM_DECODING_SIGNAL_INFO_IS_NULL", } } @@ -422,9 +446,10 @@ type SignalDecoderType string // Enum values for SignalDecoderType const ( - SignalDecoderTypeCanSignal SignalDecoderType = "CAN_SIGNAL" - SignalDecoderTypeObdSignal SignalDecoderType = "OBD_SIGNAL" - SignalDecoderTypeMessageSignal SignalDecoderType = "MESSAGE_SIGNAL" + SignalDecoderTypeCanSignal SignalDecoderType = "CAN_SIGNAL" + SignalDecoderTypeObdSignal SignalDecoderType = "OBD_SIGNAL" + SignalDecoderTypeMessageSignal SignalDecoderType = "MESSAGE_SIGNAL" + SignalDecoderTypeCustomDecodingSignal SignalDecoderType = "CUSTOM_DECODING_SIGNAL" ) // Values returns all known values for SignalDecoderType. Note that this can be @@ -436,6 +461,7 @@ func (SignalDecoderType) Values() []SignalDecoderType { "CAN_SIGNAL", "OBD_SIGNAL", "MESSAGE_SIGNAL", + "CUSTOM_DECODING_SIGNAL", } } @@ -504,6 +530,49 @@ func (StorageCompressionFormat) Values() []StorageCompressionFormat { } } +type StorageMaximumSizeUnit string + +// Enum values for StorageMaximumSizeUnit +const ( + StorageMaximumSizeUnitMb StorageMaximumSizeUnit = "MB" + StorageMaximumSizeUnitGb StorageMaximumSizeUnit = "GB" + StorageMaximumSizeUnitTb StorageMaximumSizeUnit = "TB" +) + +// Values returns all known values for StorageMaximumSizeUnit. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (StorageMaximumSizeUnit) Values() []StorageMaximumSizeUnit { + return []StorageMaximumSizeUnit{ + "MB", + "GB", + "TB", + } +} + +type StorageMinimumTimeToLiveUnit string + +// Enum values for StorageMinimumTimeToLiveUnit +const ( + StorageMinimumTimeToLiveUnitHours StorageMinimumTimeToLiveUnit = "HOURS" + StorageMinimumTimeToLiveUnitDays StorageMinimumTimeToLiveUnit = "DAYS" + StorageMinimumTimeToLiveUnitWeeks StorageMinimumTimeToLiveUnit = "WEEKS" +) + +// Values returns all known values for StorageMinimumTimeToLiveUnit. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (StorageMinimumTimeToLiveUnit) Values() []StorageMinimumTimeToLiveUnit { + return []StorageMinimumTimeToLiveUnit{ + "HOURS", + "DAYS", + "WEEKS", + } +} + type StructuredMessageListType string // Enum values for StructuredMessageListType @@ -525,6 +594,29 @@ func (StructuredMessageListType) Values() []StructuredMessageListType { } } +type TimeUnit string + +// Enum values for TimeUnit +const ( + TimeUnitMillisecond TimeUnit = "MILLISECOND" + TimeUnitSecond TimeUnit = "SECOND" + TimeUnitMinute TimeUnit = "MINUTE" + TimeUnitHour TimeUnit = "HOUR" +) + +// Values returns all known values for TimeUnit. Note that this can be expanded in +// the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TimeUnit) Values() []TimeUnit { + return []TimeUnit{ + "MILLISECOND", + "SECOND", + "MINUTE", + "HOUR", + } +} + type TriggerMode string // Enum values for TriggerMode diff --git a/service/iotfleetwise/types/types.go b/service/iotfleetwise/types/types.go index 65f00a32d3a..a816ca2ca27 100644 --- a/service/iotfleetwise/types/types.go +++ b/service/iotfleetwise/types/types.go @@ -340,6 +340,22 @@ type ConditionBasedCollectionScheme struct { noSmithyDocumentSerde } +// Specifies the condition under which a signal fetch occurs. +type ConditionBasedSignalFetchConfig struct { + + // The condition that must be satisfied to trigger a signal fetch. + // + // This member is required. + ConditionExpression *string + + // Indicates the mode in which the signal fetch is triggered. + // + // This member is required. + TriggerMode TriggerMode + + noSmithyDocumentSerde +} + // An HTTP error resulting from creating a vehicle. type CreateVehicleError struct { @@ -382,6 +398,10 @@ type CreateVehicleRequestItem struct { // Type" : "v6" Attributes map[string]string + // Associate state templates to track the state of the vehicle. State templates + // determine which signal updates the vehicle sends to the cloud. + StateTemplates []StateTemplateAssociation + // Metadata which can be used to manage the vehicle. Tags []Tag @@ -403,6 +423,41 @@ type CreateVehicleResponseItem struct { noSmithyDocumentSerde } +// Represents a custom network interface as defined by the customer. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type CustomDecodingInterface struct { + + // The name of the interface. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +// Information about signals using a custom decoding protocol as defined by the +// customer. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type CustomDecodingSignal struct { + + // The ID of the signal. + // + // This member is required. + Id *string + + noSmithyDocumentSerde +} + // Represents a member of the complex data structure. The data type of the // property can be either primitive or another struct . type CustomProperty struct { @@ -460,17 +515,34 @@ type CustomStruct struct { noSmithyDocumentSerde } -// The destination where the Amazon Web Services IoT FleetWise campaign sends -// data. You can send data to be stored in Amazon S3 or Amazon Timestream. +// The destination where the campaign sends data. You can send data to an MQTT +// topic, or store it in Amazon S3 or Amazon Timestream. // // The following types satisfy this interface: // +// DataDestinationConfigMemberMqttTopicConfig // DataDestinationConfigMemberS3Config // DataDestinationConfigMemberTimestreamConfig type DataDestinationConfig interface { isDataDestinationConfig() } +// The MQTT topic to which the Amazon Web Services IoT FleetWise campaign routes +// data. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type DataDestinationConfigMemberMqttTopicConfig struct { + Value MqttTopicConfig + + noSmithyDocumentSerde +} + +func (*DataDestinationConfigMemberMqttTopicConfig) isDataDestinationConfig() {} + // The Amazon S3 bucket where the Amazon Web Services IoT FleetWise campaign sends // data. type DataDestinationConfigMemberS3Config struct { @@ -490,6 +562,90 @@ type DataDestinationConfigMemberTimestreamConfig struct { func (*DataDestinationConfigMemberTimestreamConfig) isDataDestinationConfig() {} +// The configuration for signal data storage and upload options. You can only +// specify these options when the campaign's spooling mode is TO_DISK . +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type DataPartition struct { + + // The ID of the data partition. The data partition ID must be unique within a + // campaign. You can establish a data partition as the default partition for a + // campaign by using default as the ID. + // + // This member is required. + Id *string + + // The storage options for a data partition. + // + // This member is required. + StorageOptions *DataPartitionStorageOptions + + // The upload options for the data partition. + UploadOptions *DataPartitionUploadOptions + + noSmithyDocumentSerde +} + +// Size, time, and location options for the data partition. +type DataPartitionStorageOptions struct { + + // The maximum storage size of the data stored in the data partition. + // + // Newer data overwrites older data when the partition reaches the maximum size. + // + // This member is required. + MaximumSize *StorageMaximumSize + + // The amount of time that data in this partition will be kept on disk. + // + // - After the designated amount of time passes, the data can be removed, but + // it's not guaranteed to be removed. + // + // - Before the time expires, data in this partition can still be deleted if the + // partition reaches its configured maximum size. + // + // - Newer data will overwrite older data when the partition reaches the maximum + // size. + // + // This member is required. + MinimumTimeToLive *StorageMinimumTimeToLive + + // The folder name for the data partition under the campaign storage folder. + // + // This member is required. + StorageLocation *string + + noSmithyDocumentSerde +} + +// The upload options for the data partition. If upload options are specified, you +// must also specify storage options. See [DataPartitionStorageOptions]. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [DataPartitionStorageOptions]: https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_DataPartitionStorageOptions.html +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type DataPartitionUploadOptions struct { + + // The logical expression used to recognize what data to collect. For example, + // $variable.`Vehicle.OutsideAirTemperature` >= 105.0 . + // + // This member is required. + Expression *string + + // The version of the condition language. Defaults to the most recent condition + // language version. + ConditionLanguageVersion *int32 + + noSmithyDocumentSerde +} + // Information about a created decoder manifest. You can use the API operation to // return this information about multiple decoder manifests. type DecoderManifestSummary struct { @@ -722,6 +878,32 @@ type ModelManifestSummary struct { noSmithyDocumentSerde } +// The MQTT topic to which the Amazon Web Services IoT FleetWise campaign routes +// data. For more information, see [Device communication protocols]in the Amazon Web Services IoT Core Developer +// Guide. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Device communication protocols]: https://docs.aws.amazon.com/iot/latest/developerguide/protocols.html +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type MqttTopicConfig struct { + + // The ARN of the role that grants Amazon Web Services IoT FleetWise permission to + // access and act on messages sent to the MQTT topic. + // + // This member is required. + ExecutionRoleArn *string + + // The ARN of the MQTT topic. + // + // This member is required. + MqttTopicArn *string + + noSmithyDocumentSerde +} + // Specifications for defining a vehicle network. // // The following types satisfy this interface: @@ -765,7 +947,12 @@ type NetworkInterface struct { // (CAN) protocol. CanInterface *CanInterface - // Information about a network interface specified by the On-board diagnostic + // Information about a [custom network interface]. + // + // [custom network interface]: https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_CustomDecodingInterface.html + CustomDecodingInterface *CustomDecodingInterface + + // Information about a network interface specified by the on-board diagnostic // (OBD) II protocol. ObdInterface *ObdInterface @@ -882,7 +1069,7 @@ type NodeCounts struct { noSmithyDocumentSerde } -// A network interface that specifies the On-board diagnostic (OBD) II network +// A network interface that specifies the on-board diagnostic (OBD) II network // protocol. type ObdInterface struct { @@ -963,6 +1150,24 @@ type ObdSignal struct { noSmithyDocumentSerde } +// Vehicles associated with the state template will stream telemetry data when +// there is a change. +type OnChangeStateTemplateUpdateStrategy struct { + noSmithyDocumentSerde +} + +// Vehicles associated with the state template will stream telemetry data during a +// specified time period. +type PeriodicStateTemplateUpdateStrategy struct { + + // The length of time between state template updates. + // + // This member is required. + StateTemplateUpdateRate *TimePeriod + + noSmithyDocumentSerde +} + // Represents a primitive type node of the complex data structure. // // The following types satisfy this interface: @@ -1029,10 +1234,10 @@ type S3Config struct { // - JSON - Store data in a standard text-based JSON file format. DataFormat DataFormat - // (Optional) Enter an S3 bucket prefix. The prefix is the string of characters - // after the bucket name and before the object name. You can use the prefix to - // organize data stored in Amazon S3 buckets. For more information, see [Organizing objects using prefixes]in the - // Amazon Simple Storage Service User Guide. + // Enter an S3 bucket prefix. The prefix is the string of characters after the + // bucket name and before the object name. You can use the prefix to organize data + // stored in Amazon S3 buckets. For more information, see [Organizing objects using prefixes]in the Amazon Simple + // Storage Service User Guide. // // By default, Amazon Web Services IoT FleetWise sets the prefix // processed-data/year=YY/month=MM/date=DD/hour=HH/ (in UTC) to data it delivers to @@ -1143,17 +1348,91 @@ type SignalDecoder struct { // protocol. CanSignal *CanSignal + // Information about a [custom signal decoder]. + // + // Access to certain Amazon Web Services IoT FleetWise features is currently + // gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise + // Developer Guide. + // + // [custom signal decoder]: https://docs.aws.amazon.com/iot-fleetwise/latest/APIReference/API_CustomDecodingSignal.html + // [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html + CustomDecodingSignal *CustomDecodingSignal + // The decoding information for a specific message which supports higher order // data types. MessageSignal *MessageSignal - // Information about signal decoder using the On-board diagnostic (OBD) II + // Information about signal decoder using the on-board diagnostic (OBD) II // protocol. ObdSignal *ObdSignal noSmithyDocumentSerde } +// The configuration of the signal fetch operation. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// The following types satisfy this interface: +// +// SignalFetchConfigMemberConditionBased +// SignalFetchConfigMemberTimeBased +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type SignalFetchConfig interface { + isSignalFetchConfig() +} + +// The configuration of a condition-based signal fetch operation. +type SignalFetchConfigMemberConditionBased struct { + Value ConditionBasedSignalFetchConfig + + noSmithyDocumentSerde +} + +func (*SignalFetchConfigMemberConditionBased) isSignalFetchConfig() {} + +// The configuration of a time-based signal fetch operation. +type SignalFetchConfigMemberTimeBased struct { + Value TimeBasedSignalFetchConfig + + noSmithyDocumentSerde +} + +func (*SignalFetchConfigMemberTimeBased) isSignalFetchConfig() {} + +// Information about the signal to be fetched. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type SignalFetchInformation struct { + + // The actions to be performed by the signal fetch. + // + // This member is required. + Actions []string + + // The fully qualified name of the signal to be fetched. + // + // This member is required. + FullyQualifiedName *string + + // The configuration of the signal fetch operation. + // + // This member is required. + SignalFetchConfig SignalFetchConfig + + // The version of the condition language used. + ConditionLanguageVersion *int32 + + noSmithyDocumentSerde +} + // Information about a signal. type SignalInformation struct { @@ -1162,6 +1441,23 @@ type SignalInformation struct { // This member is required. Name *string + // The ID of the data partition this signal is associated with. + // + // The ID must match one of the IDs provided in dataPartitions . This is + // accomplished either by specifying a particular data partition ID or by using + // default for an established default partition. You can establish a default + // partition in the DataPartition data type. + // + // If you upload a signal as a condition for a campaign's data partition, the same + // signal must be included in signalsToCollect . + // + // Access to certain Amazon Web Services IoT FleetWise features is currently + // gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise + // Developer Guide. + // + // [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html + DataPartitionId *string + // The maximum number of samples to collect. MaxSampleCount *int64 @@ -1174,6 +1470,157 @@ type SignalInformation struct { noSmithyDocumentSerde } +// The state template associated with a vehicle. State templates contain state +// properties, which are signals that belong to a signal catalog that is +// synchronized between the Amazon Web Services IoT FleetWise Edge and the Amazon +// Web Services Cloud. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type StateTemplateAssociation struct { + + // A unique, service-generated identifier. + // + // This member is required. + Identifier *string + + // The update strategy for the state template. Vehicles associated with the state + // template can stream telemetry data with either an onChange or periodic update + // strategy. + // + // Access to certain Amazon Web Services IoT FleetWise features is currently + // gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise + // Developer Guide. + // + // [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html + // + // This member is required. + StateTemplateUpdateStrategy StateTemplateUpdateStrategy + + noSmithyDocumentSerde +} + +// Information about a state template. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type StateTemplateSummary struct { + + // The Amazon Resource Name (ARN) of the state template. + Arn *string + + // The time the state template was created, in seconds since epoch (January 1, + // 1970 at midnight UTC time). + CreationTime *time.Time + + // A brief description of the state template. + Description *string + + // The unique ID of the state template. + Id *string + + // The time the state template was last updated, in seconds since epoch (January + // 1, 1970 at midnight UTC time). + LastModificationTime *time.Time + + // The name of the state template. + Name *string + + // The Amazon Resource Name (ARN) of the signal catalog associated with the state + // template. + SignalCatalogArn *string + + noSmithyDocumentSerde +} + +// The update strategy for the state template. Vehicles associated with the state +// template can stream telemetry data with either an onChange or periodic update +// strategy. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// The following types satisfy this interface: +// +// StateTemplateUpdateStrategyMemberOnChange +// StateTemplateUpdateStrategyMemberPeriodic +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type StateTemplateUpdateStrategy interface { + isStateTemplateUpdateStrategy() +} + +// Vehicles associated with the state template will stream telemetry data when +// there is a change. +type StateTemplateUpdateStrategyMemberOnChange struct { + Value OnChangeStateTemplateUpdateStrategy + + noSmithyDocumentSerde +} + +func (*StateTemplateUpdateStrategyMemberOnChange) isStateTemplateUpdateStrategy() {} + +// Vehicles associated with the state template will stream telemetry data during a +// specified time period. +type StateTemplateUpdateStrategyMemberPeriodic struct { + Value PeriodicStateTemplateUpdateStrategy + + noSmithyDocumentSerde +} + +func (*StateTemplateUpdateStrategyMemberPeriodic) isStateTemplateUpdateStrategy() {} + +// The maximum storage size for the data partition. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type StorageMaximumSize struct { + + // The data type of the data to store. + // + // This member is required. + Unit StorageMaximumSizeUnit + + // The maximum amount of time to store data. + // + // This member is required. + Value *int32 + + noSmithyDocumentSerde +} + +// Information about the minimum amount of time that data will be kept. +// +// Access to certain Amazon Web Services IoT FleetWise features is currently +// gated. For more information, see [Amazon Web Services Region and feature availability]in the Amazon Web Services IoT FleetWise +// Developer Guide. +// +// [Amazon Web Services Region and feature availability]: https://docs.aws.amazon.com/iot-fleetwise/latest/developerguide/fleetwise-regions.html +type StorageMinimumTimeToLive struct { + + // The time increment type. + // + // This member is required. + Unit StorageMinimumTimeToLiveUnit + + // The minimum amount of time to store the data. + // + // This member is required. + Value *int32 + + noSmithyDocumentSerde +} + // The structured message for the message signal. It can be defined with either a // primitiveMessageDefinition , structuredMessageListDefinition , or // structuredMessageDefinition recursively. @@ -1286,6 +1733,33 @@ type TimeBasedCollectionScheme struct { noSmithyDocumentSerde } +// Used to configure a frequency-based vehicle signal fetch. +type TimeBasedSignalFetchConfig struct { + + // The frequency with which the signal fetch will be executed. + // + // This member is required. + ExecutionFrequencyMs *int64 + + noSmithyDocumentSerde +} + +// The length of time between state template updates. +type TimePeriod struct { + + // A unit of time. + // + // This member is required. + Unit TimeUnit + + // A number of time units. + // + // This member is required. + Value *int32 + + noSmithyDocumentSerde +} + // The Amazon Timestream table where the Amazon Web Services IoT FleetWise // campaign sends data. Timestream stores and organizes data to optimize query // processing time and to reduce storage costs. For more information, see [Data modeling]in the @@ -1399,6 +1873,13 @@ type UpdateVehicleRequestItem struct { // update. ModelManifestArn *string + // Associate additional state templates to track the state of the vehicle. State + // templates determine which signal updates the vehicle sends to the cloud. + StateTemplatesToAdd []StateTemplateAssociation + + // Remove existing state template associations from the vehicle. + StateTemplatesToRemove []string + noSmithyDocumentSerde } @@ -1448,26 +1929,25 @@ type VehicleMiddleware struct { noSmithyDocumentSerde } -// Information about the state of a vehicle and how it relates to the status of a -// campaign. +// Information about a campaign associated with a vehicle. type VehicleStatus struct { // The name of a campaign. CampaignName *string - // The state of a vehicle, which can be one of the following: + // The status of a campaign, which can be one of the following: // - // - CREATED - Amazon Web Services IoT FleetWise sucessfully created the vehicle. + // - CREATED - The campaign has been created successfully but has not been + // approved. // - // - READY - The vehicle is ready to receive a campaign deployment. + // - READY - The campaign has been approved but has not been deployed to the + // vehicle. // - // - HEALTHY - A campaign deployment was delivered to the vehicle. + // - HEALTHY - The campaign has been deployed to the vehicle. // - // - SUSPENDED - A campaign associated with the vehicle was suspended and data - // collection was paused. + // - SUSPENDED - The campaign has been suspended and data collection is paused. // - // - DELETING - Amazon Web Services IoT FleetWise is removing a campaign from the - // vehicle. + // - DELETING - The campaign is being removed from the vehicle. Status VehicleState // The unique ID of the vehicle. @@ -1533,10 +2013,12 @@ type UnknownUnionMember struct { noSmithyDocumentSerde } -func (*UnknownUnionMember) isCollectionScheme() {} -func (*UnknownUnionMember) isDataDestinationConfig() {} -func (*UnknownUnionMember) isFormattedVss() {} -func (*UnknownUnionMember) isNetworkFileDefinition() {} -func (*UnknownUnionMember) isNode() {} -func (*UnknownUnionMember) isPrimitiveMessageDefinition() {} -func (*UnknownUnionMember) isStructuredMessage() {} +func (*UnknownUnionMember) isCollectionScheme() {} +func (*UnknownUnionMember) isDataDestinationConfig() {} +func (*UnknownUnionMember) isFormattedVss() {} +func (*UnknownUnionMember) isNetworkFileDefinition() {} +func (*UnknownUnionMember) isNode() {} +func (*UnknownUnionMember) isPrimitiveMessageDefinition() {} +func (*UnknownUnionMember) isSignalFetchConfig() {} +func (*UnknownUnionMember) isStateTemplateUpdateStrategy() {} +func (*UnknownUnionMember) isStructuredMessage() {} diff --git a/service/iotfleetwise/types/types_exported_test.go b/service/iotfleetwise/types/types_exported_test.go index ae787b78f53..34092cd5b92 100644 --- a/service/iotfleetwise/types/types_exported_test.go +++ b/service/iotfleetwise/types/types_exported_test.go @@ -33,6 +33,9 @@ func ExampleDataDestinationConfig_outputUsage() { var union types.DataDestinationConfig // type switches can be used to check the union value switch v := union.(type) { + case *types.DataDestinationConfigMemberMqttTopicConfig: + _ = v.Value // Value is types.MqttTopicConfig + case *types.DataDestinationConfigMemberS3Config: _ = v.Value // Value is types.S3Config @@ -48,6 +51,7 @@ func ExampleDataDestinationConfig_outputUsage() { } } +var _ *types.MqttTopicConfig var _ *types.S3Config var _ *types.TimestreamConfig @@ -143,6 +147,50 @@ func ExamplePrimitiveMessageDefinition_outputUsage() { var _ *types.ROS2PrimitiveMessageDefinition +func ExampleSignalFetchConfig_outputUsage() { + var union types.SignalFetchConfig + // type switches can be used to check the union value + switch v := union.(type) { + case *types.SignalFetchConfigMemberConditionBased: + _ = v.Value // Value is types.ConditionBasedSignalFetchConfig + + case *types.SignalFetchConfigMemberTimeBased: + _ = v.Value // Value is types.TimeBasedSignalFetchConfig + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.TimeBasedSignalFetchConfig +var _ *types.ConditionBasedSignalFetchConfig + +func ExampleStateTemplateUpdateStrategy_outputUsage() { + var union types.StateTemplateUpdateStrategy + // type switches can be used to check the union value + switch v := union.(type) { + case *types.StateTemplateUpdateStrategyMemberOnChange: + _ = v.Value // Value is types.OnChangeStateTemplateUpdateStrategy + + case *types.StateTemplateUpdateStrategyMemberPeriodic: + _ = v.Value // Value is types.PeriodicStateTemplateUpdateStrategy + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.PeriodicStateTemplateUpdateStrategy +var _ *types.OnChangeStateTemplateUpdateStrategy + func ExampleStructuredMessage_outputUsage() { var union types.StructuredMessage // type switches can be used to check the union value diff --git a/service/iotfleetwise/validators.go b/service/iotfleetwise/validators.go index 71ad6a8db10..56511879aed 100644 --- a/service/iotfleetwise/validators.go +++ b/service/iotfleetwise/validators.go @@ -170,6 +170,26 @@ func (m *validateOpCreateSignalCatalog) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpCreateStateTemplate struct { +} + +func (*validateOpCreateStateTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateStateTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateStateTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateStateTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateVehicle struct { } @@ -290,6 +310,26 @@ func (m *validateOpDeleteSignalCatalog) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpDeleteStateTemplate struct { +} + +func (*validateOpDeleteStateTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteStateTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteStateTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteStateTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDeleteVehicle struct { } @@ -430,6 +470,26 @@ func (m *validateOpGetSignalCatalog) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpGetStateTemplate struct { +} + +func (*validateOpGetStateTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetStateTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetStateTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetStateTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetVehicle struct { } @@ -850,6 +910,26 @@ func (m *validateOpUpdateSignalCatalog) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpUpdateStateTemplate struct { +} + +func (*validateOpUpdateStateTemplate) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateStateTemplate) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateStateTemplateInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateStateTemplateInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateVehicle struct { } @@ -902,6 +982,10 @@ func addOpCreateSignalCatalogValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpCreateSignalCatalog{}, middleware.After) } +func addOpCreateStateTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateStateTemplate{}, middleware.After) +} + func addOpCreateVehicleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateVehicle{}, middleware.After) } @@ -926,6 +1010,10 @@ func addOpDeleteSignalCatalogValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpDeleteSignalCatalog{}, middleware.After) } +func addOpDeleteStateTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteStateTemplate{}, middleware.After) +} + func addOpDeleteVehicleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDeleteVehicle{}, middleware.After) } @@ -954,6 +1042,10 @@ func addOpGetSignalCatalogValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSignalCatalog{}, middleware.After) } +func addOpGetStateTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetStateTemplate{}, middleware.After) +} + func addOpGetVehicleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetVehicle{}, middleware.After) } @@ -1038,6 +1130,10 @@ func addOpUpdateSignalCatalogValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpUpdateSignalCatalog{}, middleware.After) } +func addOpUpdateStateTemplateValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateStateTemplate{}, middleware.After) +} + func addOpUpdateVehicleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateVehicle{}, middleware.After) } @@ -1198,6 +1294,24 @@ func validateConditionBasedCollectionScheme(v *types.ConditionBasedCollectionSch } } +func validateConditionBasedSignalFetchConfig(v *types.ConditionBasedSignalFetchConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConditionBasedSignalFetchConfig"} + if v.ConditionExpression == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConditionExpression")) + } + if len(v.TriggerMode) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("TriggerMode")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCreateVehicleRequestItem(v *types.CreateVehicleRequestItem) error { if v == nil { return nil @@ -1217,6 +1331,11 @@ func validateCreateVehicleRequestItem(v *types.CreateVehicleRequestItem) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.StateTemplates != nil { + if err := validateStateTemplateAssociations(v.StateTemplates); err != nil { + invalidParams.AddNested("StateTemplates", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1241,6 +1360,36 @@ func validateCreateVehicleRequestItems(v []types.CreateVehicleRequestItem) error } } +func validateCustomDecodingInterface(v *types.CustomDecodingInterface) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CustomDecodingInterface"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateCustomDecodingSignal(v *types.CustomDecodingSignal) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CustomDecodingSignal"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateCustomProperty(v *types.CustomProperty) error { if v == nil { return nil @@ -1280,6 +1429,11 @@ func validateDataDestinationConfig(v types.DataDestinationConfig) error { } invalidParams := smithy.InvalidParamsError{Context: "DataDestinationConfig"} switch uv := v.(type) { + case *types.DataDestinationConfigMemberMqttTopicConfig: + if err := validateMqttTopicConfig(&uv.Value); err != nil { + invalidParams.AddNested("[mqttTopicConfig]", err.(smithy.InvalidParamsError)) + } + case *types.DataDestinationConfigMemberS3Config: if err := validateS3Config(&uv.Value); err != nil { invalidParams.AddNested("[s3Config]", err.(smithy.InvalidParamsError)) @@ -1315,6 +1469,94 @@ func validateDataDestinationConfigs(v []types.DataDestinationConfig) error { } } +func validateDataPartition(v *types.DataPartition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataPartition"} + if v.Id == nil { + invalidParams.Add(smithy.NewErrParamRequired("Id")) + } + if v.StorageOptions == nil { + invalidParams.Add(smithy.NewErrParamRequired("StorageOptions")) + } else if v.StorageOptions != nil { + if err := validateDataPartitionStorageOptions(v.StorageOptions); err != nil { + invalidParams.AddNested("StorageOptions", err.(smithy.InvalidParamsError)) + } + } + if v.UploadOptions != nil { + if err := validateDataPartitionUploadOptions(v.UploadOptions); err != nil { + invalidParams.AddNested("UploadOptions", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDataPartitions(v []types.DataPartition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataPartitions"} + for i := range v { + if err := validateDataPartition(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDataPartitionStorageOptions(v *types.DataPartitionStorageOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataPartitionStorageOptions"} + if v.MaximumSize == nil { + invalidParams.Add(smithy.NewErrParamRequired("MaximumSize")) + } else if v.MaximumSize != nil { + if err := validateStorageMaximumSize(v.MaximumSize); err != nil { + invalidParams.AddNested("MaximumSize", err.(smithy.InvalidParamsError)) + } + } + if v.StorageLocation == nil { + invalidParams.Add(smithy.NewErrParamRequired("StorageLocation")) + } + if v.MinimumTimeToLive == nil { + invalidParams.Add(smithy.NewErrParamRequired("MinimumTimeToLive")) + } else if v.MinimumTimeToLive != nil { + if err := validateStorageMinimumTimeToLive(v.MinimumTimeToLive); err != nil { + invalidParams.AddNested("MinimumTimeToLive", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateDataPartitionUploadOptions(v *types.DataPartitionUploadOptions) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DataPartitionUploadOptions"} + if v.Expression == nil { + invalidParams.Add(smithy.NewErrParamRequired("Expression")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateIamResources(v *types.IamResources) error { if v == nil { return nil @@ -1352,6 +1594,24 @@ func validateMessageSignal(v *types.MessageSignal) error { } } +func validateMqttTopicConfig(v *types.MqttTopicConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "MqttTopicConfig"} + if v.MqttTopicArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("MqttTopicArn")) + } + if v.ExecutionRoleArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionRoleArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateNetworkFileDefinition(v types.NetworkFileDefinition) error { if v == nil { return nil @@ -1414,6 +1674,11 @@ func validateNetworkInterface(v *types.NetworkInterface) error { invalidParams.AddNested("VehicleMiddleware", err.(smithy.InvalidParamsError)) } } + if v.CustomDecodingInterface != nil { + if err := validateCustomDecodingInterface(v.CustomDecodingInterface); err != nil { + invalidParams.AddNested("CustomDecodingInterface", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1538,6 +1803,25 @@ func validateObdSignal(v *types.ObdSignal) error { } } +func validatePeriodicStateTemplateUpdateStrategy(v *types.PeriodicStateTemplateUpdateStrategy) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "PeriodicStateTemplateUpdateStrategy"} + if v.StateTemplateUpdateRate == nil { + invalidParams.Add(smithy.NewErrParamRequired("StateTemplateUpdateRate")) + } else if v.StateTemplateUpdateRate != nil { + if err := validateTimePeriod(v.StateTemplateUpdateRate); err != nil { + invalidParams.AddNested("StateTemplateUpdateRate", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validatePrimitiveMessageDefinition(v types.PrimitiveMessageDefinition) error { if v == nil { return nil @@ -1634,6 +1918,11 @@ func validateSignalDecoder(v *types.SignalDecoder) error { invalidParams.AddNested("MessageSignal", err.(smithy.InvalidParamsError)) } } + if v.CustomDecodingSignal != nil { + if err := validateCustomDecodingSignal(v.CustomDecodingSignal); err != nil { + invalidParams.AddNested("CustomDecodingSignal", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -1658,6 +1947,72 @@ func validateSignalDecoders(v []types.SignalDecoder) error { } } +func validateSignalFetchConfig(v types.SignalFetchConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SignalFetchConfig"} + switch uv := v.(type) { + case *types.SignalFetchConfigMemberConditionBased: + if err := validateConditionBasedSignalFetchConfig(&uv.Value); err != nil { + invalidParams.AddNested("[conditionBased]", err.(smithy.InvalidParamsError)) + } + + case *types.SignalFetchConfigMemberTimeBased: + if err := validateTimeBasedSignalFetchConfig(&uv.Value); err != nil { + invalidParams.AddNested("[timeBased]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSignalFetchInformation(v *types.SignalFetchInformation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SignalFetchInformation"} + if v.FullyQualifiedName == nil { + invalidParams.Add(smithy.NewErrParamRequired("FullyQualifiedName")) + } + if v.SignalFetchConfig == nil { + invalidParams.Add(smithy.NewErrParamRequired("SignalFetchConfig")) + } else if v.SignalFetchConfig != nil { + if err := validateSignalFetchConfig(v.SignalFetchConfig); err != nil { + invalidParams.AddNested("SignalFetchConfig", err.(smithy.InvalidParamsError)) + } + } + if v.Actions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Actions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSignalFetchInformationList(v []types.SignalFetchInformation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SignalFetchInformationList"} + for i := range v { + if err := validateSignalFetchInformation(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSignalInformation(v *types.SignalInformation) error { if v == nil { return nil @@ -1690,6 +2045,100 @@ func validateSignalInformationList(v []types.SignalInformation) error { } } +func validateStateTemplateAssociation(v *types.StateTemplateAssociation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StateTemplateAssociation"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if v.StateTemplateUpdateStrategy == nil { + invalidParams.Add(smithy.NewErrParamRequired("StateTemplateUpdateStrategy")) + } else if v.StateTemplateUpdateStrategy != nil { + if err := validateStateTemplateUpdateStrategy(v.StateTemplateUpdateStrategy); err != nil { + invalidParams.AddNested("StateTemplateUpdateStrategy", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStateTemplateAssociations(v []types.StateTemplateAssociation) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StateTemplateAssociations"} + for i := range v { + if err := validateStateTemplateAssociation(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStateTemplateUpdateStrategy(v types.StateTemplateUpdateStrategy) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StateTemplateUpdateStrategy"} + switch uv := v.(type) { + case *types.StateTemplateUpdateStrategyMemberPeriodic: + if err := validatePeriodicStateTemplateUpdateStrategy(&uv.Value); err != nil { + invalidParams.AddNested("[periodic]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStorageMaximumSize(v *types.StorageMaximumSize) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StorageMaximumSize"} + if len(v.Unit) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Unit")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateStorageMinimumTimeToLive(v *types.StorageMinimumTimeToLive) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StorageMinimumTimeToLive"} + if len(v.Unit) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Unit")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateStructuredMessage(v types.StructuredMessage) error { if v == nil { return nil @@ -1833,6 +2282,39 @@ func validateTimeBasedCollectionScheme(v *types.TimeBasedCollectionScheme) error } } +func validateTimeBasedSignalFetchConfig(v *types.TimeBasedSignalFetchConfig) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TimeBasedSignalFetchConfig"} + if v.ExecutionFrequencyMs == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionFrequencyMs")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateTimePeriod(v *types.TimePeriod) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TimePeriod"} + if len(v.Unit) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Unit")) + } + if v.Value == nil { + invalidParams.Add(smithy.NewErrParamRequired("Value")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTimestreamConfig(v *types.TimestreamConfig) error { if v == nil { return nil @@ -1877,6 +2359,11 @@ func validateUpdateVehicleRequestItem(v *types.UpdateVehicleRequestItem) error { if v.VehicleName == nil { invalidParams.Add(smithy.NewErrParamRequired("VehicleName")) } + if v.StateTemplatesToAdd != nil { + if err := validateStateTemplateAssociations(v.StateTemplatesToAdd); err != nil { + invalidParams.AddNested("StateTemplatesToAdd", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2011,6 +2498,16 @@ func validateOpCreateCampaignInput(v *CreateCampaignInput) error { invalidParams.AddNested("DataDestinationConfigs", err.(smithy.InvalidParamsError)) } } + if v.DataPartitions != nil { + if err := validateDataPartitions(v.DataPartitions); err != nil { + invalidParams.AddNested("DataPartitions", err.(smithy.InvalidParamsError)) + } + } + if v.SignalsToFetch != nil { + if err := validateSignalFetchInformationList(v.SignalsToFetch); err != nil { + invalidParams.AddNested("SignalsToFetch", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2125,6 +2622,32 @@ func validateOpCreateSignalCatalogInput(v *CreateSignalCatalogInput) error { } } +func validateOpCreateStateTemplateInput(v *CreateStateTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateStateTemplateInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.SignalCatalogArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("SignalCatalogArn")) + } + if v.StateTemplateProperties == nil { + invalidParams.Add(smithy.NewErrParamRequired("StateTemplateProperties")) + } + if v.Tags != nil { + if err := validateTagList(v.Tags); err != nil { + invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateVehicleInput(v *CreateVehicleInput) error { if v == nil { return nil @@ -2144,6 +2667,11 @@ func validateOpCreateVehicleInput(v *CreateVehicleInput) error { invalidParams.AddNested("Tags", err.(smithy.InvalidParamsError)) } } + if v.StateTemplates != nil { + if err := validateStateTemplateAssociations(v.StateTemplates); err != nil { + invalidParams.AddNested("StateTemplates", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { @@ -2226,6 +2754,21 @@ func validateOpDeleteSignalCatalogInput(v *DeleteSignalCatalogInput) error { } } +func validateOpDeleteStateTemplateInput(v *DeleteStateTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteStateTemplateInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDeleteVehicleInput(v *DeleteVehicleInput) error { if v == nil { return nil @@ -2334,6 +2877,21 @@ func validateOpGetSignalCatalogInput(v *GetSignalCatalogInput) error { } } +func validateOpGetStateTemplateInput(v *GetStateTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetStateTemplateInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetVehicleInput(v *GetVehicleInput) error { if v == nil { return nil @@ -2715,6 +3273,21 @@ func validateOpUpdateSignalCatalogInput(v *UpdateSignalCatalogInput) error { } } +func validateOpUpdateStateTemplateInput(v *UpdateStateTemplateInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateStateTemplateInput"} + if v.Identifier == nil { + invalidParams.Add(smithy.NewErrParamRequired("Identifier")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateVehicleInput(v *UpdateVehicleInput) error { if v == nil { return nil @@ -2723,6 +3296,11 @@ func validateOpUpdateVehicleInput(v *UpdateVehicleInput) error { if v.VehicleName == nil { invalidParams.Add(smithy.NewErrParamRequired("VehicleName")) } + if v.StateTemplatesToAdd != nil { + if err := validateStateTemplateAssociations(v.StateTemplatesToAdd); err != nil { + invalidParams.AddNested("StateTemplatesToAdd", err.(smithy.InvalidParamsError)) + } + } if invalidParams.Len() > 0 { return invalidParams } else { diff --git a/service/iotjobsdataplane/api_client.go b/service/iotjobsdataplane/api_client.go index ac7b21ca38f..c300181df92 100644 --- a/service/iotjobsdataplane/api_client.go +++ b/service/iotjobsdataplane/api_client.go @@ -4,6 +4,7 @@ package iotjobsdataplane import ( "context" + cryptorand "crypto/rand" "errors" "fmt" "github.com/aws/aws-sdk-go-v2/aws" @@ -22,6 +23,7 @@ import ( "github.com/aws/smithy-go/logging" "github.com/aws/smithy-go/metrics" "github.com/aws/smithy-go/middleware" + smithyrand "github.com/aws/smithy-go/rand" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" "net" @@ -185,6 +187,8 @@ func New(options Options, optFns ...func(*Options)) *Client { resolveHTTPSignerV4(&options) + resolveIdempotencyTokenProvider(&options) + resolveEndpointResolverV2(&options) resolveTracerProvider(&options) @@ -680,6 +684,13 @@ func addIsPaginatorUserAgent(o *Options) { }) } +func resolveIdempotencyTokenProvider(o *Options) { + if o.IdempotencyTokenProvider != nil { + return + } + o.IdempotencyTokenProvider = smithyrand.NewUUIDIdempotencyToken(cryptorand.Reader) +} + func addRetry(stack *middleware.Stack, o Options) error { attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { m.LogAttempts = o.ClientLogMode.IsRetries() @@ -774,6 +785,11 @@ func resolveMeterProvider(options *Options) { } } +// IdempotencyTokenProvider interface for providing idempotency token +type IdempotencyTokenProvider interface { + GetIdempotencyToken() (string, error) +} + func addRecursionDetection(stack *middleware.Stack) error { return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) } diff --git a/service/iotjobsdataplane/api_op_DescribeJobExecution.go b/service/iotjobsdataplane/api_op_DescribeJobExecution.go index ee97cc1be67..55f0237f1e8 100644 --- a/service/iotjobsdataplane/api_op_DescribeJobExecution.go +++ b/service/iotjobsdataplane/api_op_DescribeJobExecution.go @@ -12,6 +12,10 @@ import ( ) // Gets details of a job execution. +// +// Requires permission to access the [DescribeJobExecution] action. +// +// [DescribeJobExecution]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions func (c *Client) DescribeJobExecution(ctx context.Context, params *DescribeJobExecutionInput, optFns ...func(*Options)) (*DescribeJobExecutionOutput, error) { if params == nil { params = &DescribeJobExecutionInput{} @@ -43,8 +47,8 @@ type DescribeJobExecutionInput struct { // device. If not specified, the latest job execution is returned. ExecutionNumber *int64 - // Optional. When set to true, the response contains the job document. The default - // is false. + // Optional. Unless set to false, the response contains the job document. The + // default is true. IncludeJobDocument *bool noSmithyDocumentSerde diff --git a/service/iotjobsdataplane/api_op_GetPendingJobExecutions.go b/service/iotjobsdataplane/api_op_GetPendingJobExecutions.go index 7418e2fc0e1..389e828a070 100644 --- a/service/iotjobsdataplane/api_op_GetPendingJobExecutions.go +++ b/service/iotjobsdataplane/api_op_GetPendingJobExecutions.go @@ -12,6 +12,10 @@ import ( ) // Gets the list of all jobs for a thing that are not in a terminal status. +// +// Requires permission to access the [GetPendingJobExecutions] action. +// +// [GetPendingJobExecutions]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions func (c *Client) GetPendingJobExecutions(ctx context.Context, params *GetPendingJobExecutionsInput, optFns ...func(*Options)) (*GetPendingJobExecutionsOutput, error) { if params == nil { params = &GetPendingJobExecutionsInput{} diff --git a/service/iotjobsdataplane/api_op_StartCommandExecution.go b/service/iotjobsdataplane/api_op_StartCommandExecution.go new file mode 100644 index 00000000000..2ca4d60bd3a --- /dev/null +++ b/service/iotjobsdataplane/api_op_StartCommandExecution.go @@ -0,0 +1,219 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package iotjobsdataplane + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/iotjobsdataplane/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Using the command created with the CreateCommand API, start a command execution +// on a specific device. +func (c *Client) StartCommandExecution(ctx context.Context, params *StartCommandExecutionInput, optFns ...func(*Options)) (*StartCommandExecutionOutput, error) { + if params == nil { + params = &StartCommandExecutionInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartCommandExecution", params, optFns, c.addOperationStartCommandExecutionMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartCommandExecutionOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartCommandExecutionInput struct { + + // The Amazon Resource Number (ARN) of the command. For example, + // arn:aws:iot:::command/ + // + // This member is required. + CommandArn *string + + // The Amazon Resource Number (ARN) of the device where the command execution is + // occurring. + // + // This member is required. + TargetArn *string + + // The client token is used to implement idempotency. It ensures that the request + // completes no more than one time. If you retry a request with the same token and + // the same parameters, the request will complete successfully. However, if you + // retry the request using the same token but different parameters, an HTTP 409 + // conflict occurs. If you omit this value, Amazon Web Services SDKs will + // automatically generate a unique client request. + ClientToken *string + + // Specifies the amount of time in second the device has to finish the command + // execution. A timer is started as soon as the command execution is created. If + // the command execution status is not set to another terminal state before the + // timer expires, it will automatically update to TIMED_OUT . + ExecutionTimeoutSeconds *int64 + + // A list of parameters that are required by the StartCommandExecution API when + // performing the command on a device. + Parameters map[string]types.CommandParameterValue + + noSmithyDocumentSerde +} + +type StartCommandExecutionOutput struct { + + // A unique identifier for the command execution. + ExecutionId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartCommandExecutionMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartCommandExecution{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartCommandExecution{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartCommandExecution"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opStartCommandExecutionMiddleware(stack, options); err != nil { + return err + } + if err = addOpStartCommandExecutionValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartCommandExecution(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpStartCommandExecution struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpStartCommandExecution) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpStartCommandExecution) 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.(*StartCommandExecutionInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *StartCommandExecutionInput ") + } + + 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_opStartCommandExecutionMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpStartCommandExecution{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opStartCommandExecution(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartCommandExecution", + } +} diff --git a/service/iotjobsdataplane/api_op_StartNextPendingJobExecution.go b/service/iotjobsdataplane/api_op_StartNextPendingJobExecution.go index dfde30bbb09..022558c2f98 100644 --- a/service/iotjobsdataplane/api_op_StartNextPendingJobExecution.go +++ b/service/iotjobsdataplane/api_op_StartNextPendingJobExecution.go @@ -13,6 +13,10 @@ import ( // Gets and starts the next pending (status IN_PROGRESS or QUEUED) job execution // for a thing. +// +// Requires permission to access the [StartNextPendingJobExecution] action. +// +// [StartNextPendingJobExecution]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiot.html#awsiot-actions-as-permissions func (c *Client) StartNextPendingJobExecution(ctx context.Context, params *StartNextPendingJobExecutionInput, optFns ...func(*Options)) (*StartNextPendingJobExecutionOutput, error) { if params == nil { params = &StartNextPendingJobExecutionInput{} @@ -37,16 +41,20 @@ type StartNextPendingJobExecutionInput struct { // A collection of name/value pairs that describe the status of the job execution. // If not specified, the statusDetails are unchanged. + // + // The maximum length of the value in the name/value pair is 1,024 characters. StatusDetails map[string]string // Specifies the amount of time this device has to finish execution of this job. // If the job execution status is not set to a terminal state before this timer // expires, or before the timer is reset (by calling UpdateJobExecution , setting - // the status to IN_PROGRESS and specifying a new timeout value in field + // the status to IN_PROGRESS , and specifying a new timeout value in field // stepTimeoutInMinutes ) the job execution status will be automatically set to - // TIMED_OUT . Note that setting this timeout has no effect on that job execution - // timeout which may have been specified when the job was created ( CreateJob - // using field timeoutConfig ). + // TIMED_OUT . Note that setting the step timeout has no effect on the in progress + // timeout that may have been specified when the job was created ( CreateJob using + // field timeoutConfig ). + // + // Valid values for this parameter range from 1 to 10080 (1 minute to 7 days). StepTimeoutInMinutes *int64 noSmithyDocumentSerde diff --git a/service/iotjobsdataplane/api_op_UpdateJobExecution.go b/service/iotjobsdataplane/api_op_UpdateJobExecution.go index 3a8be8aa584..9cbe8630244 100644 --- a/service/iotjobsdataplane/api_op_UpdateJobExecution.go +++ b/service/iotjobsdataplane/api_op_UpdateJobExecution.go @@ -12,6 +12,10 @@ import ( ) // Updates the status of a job execution. +// +// Requires permission to access the [UpdateJobExecution] action. +// +// [UpdateJobExecution]: https://docs.aws.amazon.com/service-authorization/latest/reference/list_awsiotjobsdataplane.html func (c *Client) UpdateJobExecution(ctx context.Context, params *UpdateJobExecutionInput, optFns ...func(*Options)) (*UpdateJobExecutionOutput, error) { if params == nil { params = &UpdateJobExecutionInput{} @@ -68,16 +72,22 @@ type UpdateJobExecutionInput struct { // Optional. A collection of name/value pairs that describe the status of the job // execution. If not specified, the statusDetails are unchanged. + // + // The maximum length of the value in the name/value pair is 1,024 characters. StatusDetails map[string]string // Specifies the amount of time this device has to finish execution of this job. // If the job execution status is not set to a terminal state before this timer // expires, or before the timer is reset (by again calling UpdateJobExecution , - // setting the status to IN_PROGRESS and specifying a new timeout value in this + // setting the status to IN_PROGRESS , and specifying a new timeout value in this // field) the job execution status will be automatically set to TIMED_OUT . Note - // that setting or resetting this timeout has no effect on that job execution - // timeout which may have been specified when the job was created ( CreateJob - // using field timeoutConfig ). + // that setting or resetting the step timeout has no effect on the in progress + // timeout that may have been specified when the job was created ( CreateJob using + // field timeoutConfig ). + // + // Valid values for this parameter range from 1 to 10080 (1 minute to 7 days). A + // value of -1 is also valid and will cancel the current step timer (created by an + // earlier use of UpdateJobExecutionRequest ). StepTimeoutInMinutes *int64 noSmithyDocumentSerde diff --git a/service/iotjobsdataplane/deserializers.go b/service/iotjobsdataplane/deserializers.go index 2c9045de8a2..9a5835e5220 100644 --- a/service/iotjobsdataplane/deserializers.go +++ b/service/iotjobsdataplane/deserializers.go @@ -366,6 +366,177 @@ func awsRestjson1_deserializeOpDocumentGetPendingJobExecutionsOutput(v **GetPend return nil } +type awsRestjson1_deserializeOpStartCommandExecution struct { +} + +func (*awsRestjson1_deserializeOpStartCommandExecution) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartCommandExecution) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorStartCommandExecution(response, &metadata) + } + output := &StartCommandExecutionOutput{} + 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_deserializeOpDocumentStartCommandExecutionOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartCommandExecution(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("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_deserializeOpDocumentStartCommandExecutionOutput(v **StartCommandExecutionOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartCommandExecutionOutput + if *v == nil { + sv = &StartCommandExecutionOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "executionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CommandExecutionId to be of type string, got %T instead", value) + } + sv.ExecutionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpStartNextPendingJobExecution struct { } @@ -742,6 +913,78 @@ func awsRestjson1_deserializeErrorCertificateValidationException(response *smith 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_deserializeErrorInvalidRequestException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidRequestException{} var buff [1024]byte @@ -850,6 +1093,42 @@ func awsRestjson1_deserializeErrorResourceNotFoundException(response *smithyhttp 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_deserializeErrorServiceUnavailableException(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.ServiceUnavailableException{} var buff [1024]byte @@ -958,6 +1237,42 @@ func awsRestjson1_deserializeErrorThrottlingException(response *smithyhttp.Respo 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_deserializeDocumentCertificateValidationException(v **types.CertificateValidationException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -998,6 +1313,55 @@ func awsRestjson1_deserializeDocumentCertificateValidationException(v **types.Ce 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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected resourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentDetailsMap(v *map[string]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1034,6 +1398,46 @@ func awsRestjson1_deserializeDocumentDetailsMap(v *map[string]string, value inte 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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRequestException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1501,6 +1905,46 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc 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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentServiceUnavailableException(v **types.ServiceUnavailableException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -1633,3 +2077,43 @@ func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingExc *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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected errorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} diff --git a/service/iotjobsdataplane/doc.go b/service/iotjobsdataplane/doc.go index 72580c2cb34..293afdd8394 100644 --- a/service/iotjobsdataplane/doc.go +++ b/service/iotjobsdataplane/doc.go @@ -3,20 +3,29 @@ // Package iotjobsdataplane provides the API client, operations, and parameter // types for AWS IoT Jobs Data Plane. // -// AWS IoT Jobs is a service that allows you to define a set of jobs — remote -// operations that are sent to and executed on one or more devices connected to AWS -// IoT. For example, you can define a job that instructs a set of devices to -// download and install application or firmware updates, reboot, rotate -// certificates, or perform remote troubleshooting operations. +// IoT Jobs is a service that allows you to define a set of jobs — remote +// operations that are sent to and executed on one or more devices connected to +// Amazon Web Services IoT Core. For example, you can define a job that instructs a +// set of devices to download and install application or firmware updates, reboot, +// rotate certificates, or perform remote troubleshooting operations. +// +// Find the endpoint address for actions in the IoT jobs data plane by running +// this CLI command: +// +// aws iot describe-endpoint --endpoint-type iot:Jobs +// +// The service name used by [Amazon Web Services Signature Version 4] to sign requests is: iot-jobs-data. // // To create a job, you make a job document which is a description of the remote // operations to be performed, and you specify a list of targets that should // perform the operations. The targets can be individual things, thing groups or // both. // -// AWS IoT Jobs sends a message to inform the targets that a job is available. The +// IoT Jobs sends a message to inform the targets that a job is available. The // target starts the execution of the job by downloading the job document, -// performing the operations it specifies, and reporting its progress to AWS IoT. -// The Jobs service provides commands to track the progress of a job on a specific -// target and for all the targets of the job +// performing the operations it specifies, and reporting its progress to Amazon Web +// Services IoT Core. The Jobs service provides commands to track the progress of a +// job on a specific target and for all the targets of the job +// +// [Amazon Web Services Signature Version 4]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html package iotjobsdataplane diff --git a/service/iotjobsdataplane/endpoints.go b/service/iotjobsdataplane/endpoints.go index 416bbd5fcbb..b9c674a4a22 100644 --- a/service/iotjobsdataplane/endpoints.go +++ b/service/iotjobsdataplane/endpoints.go @@ -385,7 +385,7 @@ func (r *resolver) ResolveEndpoint( } } if _UseFIPS == true { - if true == _PartitionResult.SupportsFIPS { + if _PartitionResult.SupportsFIPS == true { uriString := func() string { var out strings.Builder out.WriteString("https://data.jobs.iot-fips.") diff --git a/service/iotjobsdataplane/generated.json b/service/iotjobsdataplane/generated.json index aebab8cf682..9b75e09b6f1 100644 --- a/service/iotjobsdataplane/generated.json +++ b/service/iotjobsdataplane/generated.json @@ -10,6 +10,7 @@ "api_client_test.go", "api_op_DescribeJobExecution.go", "api_op_GetPendingJobExecutions.go", + "api_op_StartCommandExecution.go", "api_op_StartNextPendingJobExecution.go", "api_op_UpdateJobExecution.go", "auth.go", diff --git a/service/iotjobsdataplane/options.go b/service/iotjobsdataplane/options.go index 754baa71f08..ba5fd48a53c 100644 --- a/service/iotjobsdataplane/options.go +++ b/service/iotjobsdataplane/options.go @@ -65,6 +65,10 @@ type Options struct { // 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 diff --git a/service/iotjobsdataplane/serializers.go b/service/iotjobsdataplane/serializers.go index 733fff78ddc..471a058e47b 100644 --- a/service/iotjobsdataplane/serializers.go +++ b/service/iotjobsdataplane/serializers.go @@ -6,12 +6,14 @@ import ( "bytes" "context" "fmt" + "github.com/aws/aws-sdk-go-v2/service/iotjobsdataplane/types" smithy "github.com/aws/smithy-go" "github.com/aws/smithy-go/encoding/httpbinding" smithyjson "github.com/aws/smithy-go/encoding/json" "github.com/aws/smithy-go/middleware" "github.com/aws/smithy-go/tracing" smithyhttp "github.com/aws/smithy-go/transport/http" + "math" ) type awsRestjson1_serializeOpDescribeJobExecution struct { @@ -173,6 +175,109 @@ func awsRestjson1_serializeOpHttpBindingsGetPendingJobExecutionsInput(v *GetPend return nil } +type awsRestjson1_serializeOpStartCommandExecution struct { +} + +func (*awsRestjson1_serializeOpStartCommandExecution) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartCommandExecution) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartCommandExecutionInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/command-executions") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartCommandExecutionInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartCommandExecutionInput(v *StartCommandExecutionInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartCommandExecutionInput(v *StartCommandExecutionInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + if v.CommandArn != nil { + ok := object.Key("commandArn") + ok.String(*v.CommandArn) + } + + if v.ExecutionTimeoutSeconds != nil { + ok := object.Key("executionTimeoutSeconds") + ok.Long(*v.ExecutionTimeoutSeconds) + } + + if v.Parameters != nil { + ok := object.Key("parameters") + if err := awsRestjson1_serializeDocumentCommandExecutionParameterMap(v.Parameters, ok); err != nil { + return err + } + } + + if v.TargetArn != nil { + ok := object.Key("targetArn") + ok.String(*v.TargetArn) + } + + return nil +} + type awsRestjson1_serializeOpStartNextPendingJobExecution struct { } @@ -409,6 +514,75 @@ func awsRestjson1_serializeOpDocumentUpdateJobExecutionInput(v *UpdateJobExecuti return nil } +func awsRestjson1_serializeDocumentCommandExecutionParameterMap(v map[string]types.CommandParameterValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + mapVar := v[key] + if err := awsRestjson1_serializeDocumentCommandParameterValue(&mapVar, om); err != nil { + return err + } + } + return nil +} + +func awsRestjson1_serializeDocumentCommandParameterValue(v *types.CommandParameterValue, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.B != nil { + ok := object.Key("B") + ok.Boolean(*v.B) + } + + if v.BIN != nil { + ok := object.Key("BIN") + ok.Base64EncodeBytes(v.BIN) + } + + if v.D != nil { + ok := object.Key("D") + switch { + case math.IsNaN(*v.D): + ok.String("NaN") + + case math.IsInf(*v.D, 1): + ok.String("Infinity") + + case math.IsInf(*v.D, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.D) + + } + } + + if v.I != nil { + ok := object.Key("I") + ok.Integer(*v.I) + } + + if v.L != nil { + ok := object.Key("L") + ok.Long(*v.L) + } + + if v.S != nil { + ok := object.Key("S") + ok.String(*v.S) + } + + if v.UL != nil { + ok := object.Key("UL") + ok.String(*v.UL) + } + + return nil +} + func awsRestjson1_serializeDocumentDetailsMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/iotjobsdataplane/snapshot/api_op_StartCommandExecution.go.snap b/service/iotjobsdataplane/snapshot/api_op_StartCommandExecution.go.snap new file mode 100644 index 00000000000..ef8c3f118af --- /dev/null +++ b/service/iotjobsdataplane/snapshot/api_op_StartCommandExecution.go.snap @@ -0,0 +1,42 @@ +StartCommandExecution + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/iotjobsdataplane/snapshot_test.go b/service/iotjobsdataplane/snapshot_test.go index 244d538b528..27e27302ba3 100644 --- a/service/iotjobsdataplane/snapshot_test.go +++ b/service/iotjobsdataplane/snapshot_test.go @@ -86,6 +86,18 @@ func TestCheckSnapshot_GetPendingJobExecutions(t *testing.T) { } } +func TestCheckSnapshot_StartCommandExecution(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartCommandExecution(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartCommandExecution") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartNextPendingJobExecution(t *testing.T) { svc := New(Options{}) _, err := svc.StartNextPendingJobExecution(context.Background(), nil, func(o *Options) { @@ -133,6 +145,18 @@ func TestUpdateSnapshot_GetPendingJobExecutions(t *testing.T) { } } +func TestUpdateSnapshot_StartCommandExecution(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartCommandExecution(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartCommandExecution") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartNextPendingJobExecution(t *testing.T) { svc := New(Options{}) _, err := svc.StartNextPendingJobExecution(context.Background(), nil, func(o *Options) { diff --git a/service/iotjobsdataplane/types/errors.go b/service/iotjobsdataplane/types/errors.go index 89df5cacd2e..c354ee8df86 100644 --- a/service/iotjobsdataplane/types/errors.go +++ b/service/iotjobsdataplane/types/errors.go @@ -33,9 +33,61 @@ func (e *CertificateValidationException) ErrorCode() string { } func (e *CertificateValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The contents of the request were invalid. For example, this code is returned -// when an UpdateJobExecution request contains invalid status details. The message -// contains details about the error. +// A conflict has occurred when performing the API request. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// An internal server error occurred when performing the API request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// The contents of the request were invalid. type InvalidRequestException struct { Message *string @@ -116,6 +168,32 @@ func (e *ResourceNotFoundException) ErrorCode() string { } func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The service quota has been exceeded for this request. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *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 { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The service is temporarily unavailable. type ServiceUnavailableException struct { Message *string @@ -195,3 +273,29 @@ func (e *ThrottlingException) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// A validation error occurred when performing the API request. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/iotjobsdataplane/types/types.go b/service/iotjobsdataplane/types/types.go index 14edb2a2dca..e823eb8a41a 100644 --- a/service/iotjobsdataplane/types/types.go +++ b/service/iotjobsdataplane/types/types.go @@ -6,11 +6,43 @@ import ( smithydocument "github.com/aws/smithy-go/document" ) +// The list of values used to describe a specific command parameter. +type CommandParameterValue struct { + + // An attribute of type Boolean. For example: + // + // "BOOL": true + B *bool + + // An attribute of type Binary. + BIN []byte + + // An attribute of type Double (Sixty-Four Bits). + D *float64 + + // An attribute of type Integer (Thirty-Two Bits). + I *int32 + + // An attribute of type Long. + L *int64 + + // An attribute of type String. For example: + // + // "S": "Hello" + S *string + + // An attribute of type Unsigned Long. + UL *string + + noSmithyDocumentSerde +} + // Contains data about a job execution. type JobExecution struct { // The estimated number of seconds that remain before the job execution status - // will be changed to TIMED_OUT . + // will be changed to TIMED_OUT . The actual job execution timeout can occur up to + // 60 seconds later than the estimated duration. ApproximateSecondsBeforeTimedOut *int64 // A number that identifies a particular job execution on a particular device. It @@ -23,21 +55,22 @@ type JobExecution struct { // The unique identifier you assigned to this job when it was created. JobId *string - // The time, in milliseconds since the epoch, when the job execution was last - // updated. + // The time, in seconds since the epoch, when the job execution was last updated. LastUpdatedAt int64 - // The time, in milliseconds since the epoch, when the job execution was enqueued. + // The time, in seconds since the epoch, when the job execution was enqueued. QueuedAt int64 - // The time, in milliseconds since the epoch, when the job execution was started. + // The time, in seconds since the epoch, when the job execution was started. StartedAt *int64 // The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", - // "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED". + // "FAILED", "SUCCESS", "CANCELED", "TIMED_OUT", "REJECTED", or "REMOVED". Status JobExecutionStatus // A collection of name/value pairs that describe the status of the job execution. + // + // The maximum length of the value in the name/value pair is 1,024 characters. StatusDetails map[string]string // The name of the thing that is executing the job. @@ -54,10 +87,12 @@ type JobExecution struct { type JobExecutionState struct { // The status of the job execution. Can be one of: "QUEUED", "IN_PROGRESS", - // "FAILED", "SUCCESS", "CANCELED", "REJECTED", or "REMOVED". + // "FAILED", "SUCCESS", "CANCELED", "TIMED_OUT", "REJECTED", or "REMOVED". Status JobExecutionStatus // A collection of name/value pairs that describe the status of the job execution. + // + // The maximum length of the value in the name/value pair is 1,024 characters. StatusDetails map[string]string // The version of the job execution. Job execution versions are incremented each @@ -76,18 +111,17 @@ type JobExecutionSummary struct { // The unique identifier you assigned to this job when it was created. JobId *string - // The time, in milliseconds since the epoch, when the job execution was last - // updated. + // The time, in seconds since the epoch, when the job execution was last updated. LastUpdatedAt int64 - // The time, in milliseconds since the epoch, when the job execution was enqueued. + // The time, in seconds since the epoch, when the job execution was enqueued. QueuedAt int64 - // The time, in milliseconds since the epoch, when the job execution started. + // The time, in seconds since the epoch, when the job execution started. StartedAt *int64 // The version of the job execution. Job execution versions are incremented each - // time AWS IoT Jobs receives an update from a device. + // time IoT Jobs receives an update from a device. VersionNumber int64 noSmithyDocumentSerde diff --git a/service/iotjobsdataplane/validators.go b/service/iotjobsdataplane/validators.go index cfbc49ba123..45fc002fb98 100644 --- a/service/iotjobsdataplane/validators.go +++ b/service/iotjobsdataplane/validators.go @@ -49,6 +49,26 @@ func (m *validateOpGetPendingJobExecutions) HandleInitialize(ctx context.Context return next.HandleInitialize(ctx, in) } +type validateOpStartCommandExecution struct { +} + +func (*validateOpStartCommandExecution) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartCommandExecution) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartCommandExecutionInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartCommandExecutionInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartNextPendingJobExecution struct { } @@ -97,6 +117,10 @@ func addOpGetPendingJobExecutionsValidationMiddleware(stack *middleware.Stack) e return stack.Initialize.Add(&validateOpGetPendingJobExecutions{}, middleware.After) } +func addOpStartCommandExecutionValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartCommandExecution{}, middleware.After) +} + func addOpStartNextPendingJobExecutionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartNextPendingJobExecution{}, middleware.After) } @@ -138,6 +162,24 @@ func validateOpGetPendingJobExecutionsInput(v *GetPendingJobExecutionsInput) err } } +func validateOpStartCommandExecutionInput(v *StartCommandExecutionInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartCommandExecutionInput"} + if v.TargetArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("TargetArn")) + } + if v.CommandArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("CommandArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartNextPendingJobExecutionInput(v *StartNextPendingJobExecutionInput) error { if v == nil { return nil diff --git a/service/lambda/api_op_CreateEventSourceMapping.go b/service/lambda/api_op_CreateEventSourceMapping.go index b7799139c48..38a6f88674c 100644 --- a/service/lambda/api_op_CreateEventSourceMapping.go +++ b/service/lambda/api_op_CreateEventSourceMapping.go @@ -32,15 +32,12 @@ import ( // // [Amazon DocumentDB] // -// The following error handling options are available only for stream sources -// (DynamoDB and Kinesis): +// The following error handling options are available only for DynamoDB and +// Kinesis event sources: // // - BisectBatchOnFunctionError – If the function returns an error, split the // batch in two and retry. // -// - DestinationConfig – Send discarded records to an Amazon SQS queue or Amazon -// SNS topic. -// // - MaximumRecordAgeInSeconds – Discard records older than the specified age. // The default value is infinite (-1). When set to infinite (-1), failed records // are retried until the record expires @@ -52,6 +49,12 @@ import ( // - ParallelizationFactor – Process multiple batches from each shard // concurrently. // +// For stream sources (DynamoDB, Kinesis, Amazon MSK, and self-managed Apache +// Kafka), the following option is also available: +// +// - DestinationConfig – Send discarded records to an Amazon SQS queue, Amazon +// SNS topic, or Amazon S3 bucket. +// // For information about which configuration parameters apply to each event // source, see the following topics. // @@ -217,6 +220,11 @@ type CreateEventSourceMappingInput struct { // failed records are retried until the record expires. MaximumRetryAttempts *int32 + // The metrics configuration for your event source. For more information, see [Event source mapping metrics]. + // + // [Event source mapping metrics]: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics + MetricsConfig *types.EventSourceMappingMetricsConfig + // (Kinesis and DynamoDB Streams only) The number of batches to process from each // shard concurrently. ParallelizationFactor *int32 @@ -368,6 +376,11 @@ type CreateEventSourceMappingOutput struct { // until the record expires in the event source. MaximumRetryAttempts *int32 + // The metrics configuration for your event source. For more information, see [Event source mapping metrics]. + // + // [Event source mapping metrics]: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics + MetricsConfig *types.EventSourceMappingMetricsConfig + // (Kinesis and DynamoDB Streams only) The number of batches to process // concurrently from each shard. The default value is 1. ParallelizationFactor *int32 diff --git a/service/lambda/api_op_DeleteEventSourceMapping.go b/service/lambda/api_op_DeleteEventSourceMapping.go index 04899aa34de..12c8cac8572 100644 --- a/service/lambda/api_op_DeleteEventSourceMapping.go +++ b/service/lambda/api_op_DeleteEventSourceMapping.go @@ -147,6 +147,11 @@ type DeleteEventSourceMappingOutput struct { // until the record expires in the event source. MaximumRetryAttempts *int32 + // The metrics configuration for your event source. For more information, see [Event source mapping metrics]. + // + // [Event source mapping metrics]: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics + MetricsConfig *types.EventSourceMappingMetricsConfig + // (Kinesis and DynamoDB Streams only) The number of batches to process // concurrently from each shard. The default value is 1. ParallelizationFactor *int32 diff --git a/service/lambda/api_op_GetEventSourceMapping.go b/service/lambda/api_op_GetEventSourceMapping.go index 288ad938ebe..ab6517b7f8c 100644 --- a/service/lambda/api_op_GetEventSourceMapping.go +++ b/service/lambda/api_op_GetEventSourceMapping.go @@ -143,6 +143,11 @@ type GetEventSourceMappingOutput struct { // until the record expires in the event source. MaximumRetryAttempts *int32 + // The metrics configuration for your event source. For more information, see [Event source mapping metrics]. + // + // [Event source mapping metrics]: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics + MetricsConfig *types.EventSourceMappingMetricsConfig + // (Kinesis and DynamoDB Streams only) The number of batches to process // concurrently from each shard. The default value is 1. ParallelizationFactor *int32 diff --git a/service/lambda/api_op_GetFunctionEventInvokeConfig.go b/service/lambda/api_op_GetFunctionEventInvokeConfig.go index e0f30677346..4ba35601d9d 100644 --- a/service/lambda/api_op_GetFunctionEventInvokeConfig.go +++ b/service/lambda/api_op_GetFunctionEventInvokeConfig.go @@ -66,9 +66,14 @@ type GetFunctionEventInvokeConfigOutput struct { // // - Queue - The ARN of a standard SQS queue. // + // - Bucket - The ARN of an Amazon S3 bucket. + // // - Topic - The ARN of a standard SNS topic. // // - Event Bus - The ARN of an Amazon EventBridge event bus. + // + // S3 buckets are supported only for on-failure destinations. To retain records of + // successful invocations, use another destination type. DestinationConfig *types.DestinationConfig // The Amazon Resource Name (ARN) of the function. diff --git a/service/lambda/api_op_PutFunctionEventInvokeConfig.go b/service/lambda/api_op_PutFunctionEventInvokeConfig.go index 2fce920632a..0caf9efa1e1 100644 --- a/service/lambda/api_op_PutFunctionEventInvokeConfig.go +++ b/service/lambda/api_op_PutFunctionEventInvokeConfig.go @@ -23,10 +23,14 @@ import ( // queue for too long, Lambda discards it. To retain discarded events, configure a // dead-letter queue with UpdateFunctionConfiguration. // -// To send an invocation record to a queue, topic, function, or event bus, specify -// a [destination]. You can configure separate destinations for successful invocations -// (on-success) and events that fail all processing attempts (on-failure). You can -// configure destinations in addition to or instead of a dead-letter queue. +// To send an invocation record to a queue, topic, S3 bucket, function, or event +// bus, specify a [destination]. You can configure separate destinations for successful +// invocations (on-success) and events that fail all processing attempts +// (on-failure). You can configure destinations in addition to or instead of a +// dead-letter queue. +// +// S3 buckets are supported only for on-failure destinations. To retain records of +// successful invocations, use another destination type. // // [asynchronous invocation]: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html // [destination]: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations @@ -72,9 +76,14 @@ type PutFunctionEventInvokeConfigInput struct { // // - Queue - The ARN of a standard SQS queue. // + // - Bucket - The ARN of an Amazon S3 bucket. + // // - Topic - The ARN of a standard SNS topic. // // - Event Bus - The ARN of an Amazon EventBridge event bus. + // + // S3 buckets are supported only for on-failure destinations. To retain records of + // successful invocations, use another destination type. DestinationConfig *types.DestinationConfig // The maximum age of a request that Lambda sends to a function for processing. @@ -99,9 +108,14 @@ type PutFunctionEventInvokeConfigOutput struct { // // - Queue - The ARN of a standard SQS queue. // + // - Bucket - The ARN of an Amazon S3 bucket. + // // - Topic - The ARN of a standard SNS topic. // // - Event Bus - The ARN of an Amazon EventBridge event bus. + // + // S3 buckets are supported only for on-failure destinations. To retain records of + // successful invocations, use another destination type. DestinationConfig *types.DestinationConfig // The Amazon Resource Name (ARN) of the function. diff --git a/service/lambda/api_op_UpdateEventSourceMapping.go b/service/lambda/api_op_UpdateEventSourceMapping.go index 6e021204741..a1fc62aab9f 100644 --- a/service/lambda/api_op_UpdateEventSourceMapping.go +++ b/service/lambda/api_op_UpdateEventSourceMapping.go @@ -32,15 +32,12 @@ import ( // // [Amazon DocumentDB] // -// The following error handling options are available only for stream sources -// (DynamoDB and Kinesis): +// The following error handling options are available only for DynamoDB and +// Kinesis event sources: // // - BisectBatchOnFunctionError – If the function returns an error, split the // batch in two and retry. // -// - DestinationConfig – Send discarded records to an Amazon SQS queue or Amazon -// SNS topic. -// // - MaximumRecordAgeInSeconds – Discard records older than the specified age. // The default value is infinite (-1). When set to infinite (-1), failed records // are retried until the record expires @@ -52,6 +49,12 @@ import ( // - ParallelizationFactor – Process multiple batches from each shard // concurrently. // +// For stream sources (DynamoDB, Kinesis, Amazon MSK, and self-managed Apache +// Kafka), the following option is also available: +// +// - DestinationConfig – Send discarded records to an Amazon SQS queue, Amazon +// SNS topic, or Amazon S3 bucket. +// // For information about which configuration parameters apply to each event // source, see the following topics. // @@ -198,6 +201,11 @@ type UpdateEventSourceMappingInput struct { // failed records are retried until the record expires. MaximumRetryAttempts *int32 + // The metrics configuration for your event source. For more information, see [Event source mapping metrics]. + // + // [Event source mapping metrics]: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics + MetricsConfig *types.EventSourceMappingMetricsConfig + // (Kinesis and DynamoDB Streams only) The number of batches to process from each // shard concurrently. ParallelizationFactor *int32 @@ -324,6 +332,11 @@ type UpdateEventSourceMappingOutput struct { // until the record expires in the event source. MaximumRetryAttempts *int32 + // The metrics configuration for your event source. For more information, see [Event source mapping metrics]. + // + // [Event source mapping metrics]: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics + MetricsConfig *types.EventSourceMappingMetricsConfig + // (Kinesis and DynamoDB Streams only) The number of batches to process // concurrently from each shard. The default value is 1. ParallelizationFactor *int32 diff --git a/service/lambda/api_op_UpdateFunctionEventInvokeConfig.go b/service/lambda/api_op_UpdateFunctionEventInvokeConfig.go index 09f5cedf764..94c45c39515 100644 --- a/service/lambda/api_op_UpdateFunctionEventInvokeConfig.go +++ b/service/lambda/api_op_UpdateFunctionEventInvokeConfig.go @@ -58,9 +58,14 @@ type UpdateFunctionEventInvokeConfigInput struct { // // - Queue - The ARN of a standard SQS queue. // + // - Bucket - The ARN of an Amazon S3 bucket. + // // - Topic - The ARN of a standard SNS topic. // // - Event Bus - The ARN of an Amazon EventBridge event bus. + // + // S3 buckets are supported only for on-failure destinations. To retain records of + // successful invocations, use another destination type. DestinationConfig *types.DestinationConfig // The maximum age of a request that Lambda sends to a function for processing. @@ -85,9 +90,14 @@ type UpdateFunctionEventInvokeConfigOutput struct { // // - Queue - The ARN of a standard SQS queue. // + // - Bucket - The ARN of an Amazon S3 bucket. + // // - Topic - The ARN of a standard SNS topic. // // - Event Bus - The ARN of an Amazon EventBridge event bus. + // + // S3 buckets are supported only for on-failure destinations. To retain records of + // successful invocations, use another destination type. DestinationConfig *types.DestinationConfig // The Amazon Resource Name (ARN) of the function. diff --git a/service/lambda/deserializers.go b/service/lambda/deserializers.go index 10c0082529d..503334ec207 100644 --- a/service/lambda/deserializers.go +++ b/service/lambda/deserializers.go @@ -1056,6 +1056,11 @@ func awsRestjson1_deserializeOpDocumentCreateEventSourceMappingOutput(v **Create sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) } + case "MetricsConfig": + if err := awsRestjson1_deserializeDocumentEventSourceMappingMetricsConfig(&sv.MetricsConfig, value); err != nil { + return err + } + case "ParallelizationFactor": if value != nil { jtv, ok := value.(json.Number) @@ -2346,6 +2351,11 @@ func awsRestjson1_deserializeOpDocumentDeleteEventSourceMappingOutput(v **Delete sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) } + case "MetricsConfig": + if err := awsRestjson1_deserializeDocumentEventSourceMappingMetricsConfig(&sv.MetricsConfig, value); err != nil { + return err + } + case "ParallelizationFactor": if value != nil { jtv, ok := value.(json.Number) @@ -4019,6 +4029,11 @@ func awsRestjson1_deserializeOpDocumentGetEventSourceMappingOutput(v **GetEventS sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) } + case "MetricsConfig": + if err := awsRestjson1_deserializeDocumentEventSourceMappingMetricsConfig(&sv.MetricsConfig, value); err != nil { + return err + } + case "ParallelizationFactor": if value != nil { jtv, ok := value.(json.Number) @@ -12402,6 +12417,11 @@ func awsRestjson1_deserializeOpDocumentUpdateEventSourceMappingOutput(v **Update sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) } + case "MetricsConfig": + if err := awsRestjson1_deserializeDocumentEventSourceMappingMetricsConfig(&sv.MetricsConfig, value); err != nil { + return err + } + case "ParallelizationFactor": if value != nil { jtv, ok := value.(json.Number) @@ -17433,6 +17453,11 @@ func awsRestjson1_deserializeDocumentEventSourceMappingConfiguration(v **types.E sv.MaximumRetryAttempts = ptr.Int32(int32(i64)) } + case "MetricsConfig": + if err := awsRestjson1_deserializeDocumentEventSourceMappingMetricsConfig(&sv.MetricsConfig, value); err != nil { + return err + } + case "ParallelizationFactor": if value != nil { jtv, ok := value.(json.Number) @@ -17550,6 +17575,78 @@ func awsRestjson1_deserializeDocumentEventSourceMappingConfiguration(v **types.E return nil } +func awsRestjson1_deserializeDocumentEventSourceMappingMetricList(v *[]types.EventSourceMappingMetric, 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.EventSourceMappingMetric + if *v == nil { + cv = []types.EventSourceMappingMetric{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EventSourceMappingMetric + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventSourceMappingMetric to be of type string, got %T instead", value) + } + col = types.EventSourceMappingMetric(jtv) + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEventSourceMappingMetricsConfig(v **types.EventSourceMappingMetricsConfig, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EventSourceMappingMetricsConfig + if *v == nil { + sv = &types.EventSourceMappingMetricsConfig{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Metrics": + if err := awsRestjson1_deserializeDocumentEventSourceMappingMetricList(&sv.Metrics, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentEventSourceMappingsList(v *[]types.EventSourceMappingConfiguration, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/lambda/doc.go b/service/lambda/doc.go index 06419b64a93..92c2a95f5ae 100644 --- a/service/lambda/doc.go +++ b/service/lambda/doc.go @@ -73,5 +73,5 @@ // [Signature Version 4 signing process]: https://docs.aws.amazon.com/general/latest/gr/signature-version-4.html // [Tools for Amazon Web Services]: http://aws.amazon.com/tools/ // [Amazon trust services]: https://www.amazontrust.com/repository/ -// [Lambda endpoints and quotas]: https://docs.aws.amazon.com/general/latest/gr/lambda-service.html/ +// [Lambda endpoints and quotas]: https://docs.aws.amazon.com/general/latest/gr/lambda-service.html package lambda diff --git a/service/lambda/serializers.go b/service/lambda/serializers.go index 1906562e49b..b8bbf15030e 100644 --- a/service/lambda/serializers.go +++ b/service/lambda/serializers.go @@ -643,6 +643,13 @@ func awsRestjson1_serializeOpDocumentCreateEventSourceMappingInput(v *CreateEven ok.Integer(*v.MaximumRetryAttempts) } + if v.MetricsConfig != nil { + ok := object.Key("MetricsConfig") + if err := awsRestjson1_serializeDocumentEventSourceMappingMetricsConfig(v.MetricsConfig, ok); err != nil { + return err + } + } + if v.ParallelizationFactor != nil { ok := object.Key("ParallelizationFactor") ok.Integer(*v.ParallelizationFactor) @@ -5815,6 +5822,13 @@ func awsRestjson1_serializeOpDocumentUpdateEventSourceMappingInput(v *UpdateEven ok.Integer(*v.MaximumRetryAttempts) } + if v.MetricsConfig != nil { + ok := object.Key("MetricsConfig") + if err := awsRestjson1_serializeDocumentEventSourceMappingMetricsConfig(v.MetricsConfig, ok); err != nil { + return err + } + } + if v.ParallelizationFactor != nil { ok := object.Key("ParallelizationFactor") ok.Integer(*v.ParallelizationFactor) @@ -6697,6 +6711,31 @@ func awsRestjson1_serializeDocumentEphemeralStorage(v *types.EphemeralStorage, v return nil } +func awsRestjson1_serializeDocumentEventSourceMappingMetricList(v []types.EventSourceMappingMetric, 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_serializeDocumentEventSourceMappingMetricsConfig(v *types.EventSourceMappingMetricsConfig, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Metrics != nil { + ok := object.Key("Metrics") + if err := awsRestjson1_serializeDocumentEventSourceMappingMetricList(v.Metrics, ok); err != nil { + return err + } + } + + return nil +} + func awsRestjson1_serializeDocumentFileSystemConfig(v *types.FileSystemConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/lambda/types/enums.go b/service/lambda/types/enums.go index a0df67f42b2..32ca52c4e5e 100644 --- a/service/lambda/types/enums.go +++ b/service/lambda/types/enums.go @@ -84,6 +84,23 @@ func (EndPointType) Values() []EndPointType { } } +type EventSourceMappingMetric string + +// Enum values for EventSourceMappingMetric +const ( + EventSourceMappingMetricEventCount EventSourceMappingMetric = "EventCount" +) + +// Values returns all known values for EventSourceMappingMetric. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (EventSourceMappingMetric) Values() []EventSourceMappingMetric { + return []EventSourceMappingMetric{ + "EventCount", + } +} + type EventSourcePosition string // Enum values for EventSourcePosition diff --git a/service/lambda/types/types.go b/service/lambda/types/types.go index e47c4bfd966..752753fc48a 100644 --- a/service/lambda/types/types.go +++ b/service/lambda/types/types.go @@ -418,6 +418,11 @@ type EventSourceMappingConfiguration struct { // until the record expires in the event source. MaximumRetryAttempts *int32 + // The metrics configuration for your event source. For more information, see [Event source mapping metrics]. + // + // [Event source mapping metrics]: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics + MetricsConfig *EventSourceMappingMetricsConfig + // (Kinesis and DynamoDB Streams only) The number of batches to process // concurrently from each shard. The default value is 1. ParallelizationFactor *int32 @@ -473,6 +478,21 @@ type EventSourceMappingConfiguration struct { noSmithyDocumentSerde } +// The metrics configuration for your event source. Use this configuration object +// to define which metrics you want your event source mapping to produce. +type EventSourceMappingMetricsConfig struct { + + // The metrics you want your event source mapping to produce. Include EventCount + // to receive event source mapping metrics related to the number of events + // processed by your event source mapping. For more information about these + // metrics, see [Event source mapping metrics]. + // + // [Event source mapping metrics]: https://docs.aws.amazon.com/lambda/latest/dg/monitoring-metrics-types.html#event-source-mapping-metrics + Metrics []EventSourceMappingMetric + + noSmithyDocumentSerde +} + // Details about the connection between a Lambda function and an [Amazon EFS file system]. // // [Amazon EFS file system]: https://docs.aws.amazon.com/lambda/latest/dg/configuration-filesystem.html @@ -768,9 +788,14 @@ type FunctionEventInvokeConfig struct { // // - Queue - The ARN of a standard SQS queue. // + // - Bucket - The ARN of an Amazon S3 bucket. + // // - Topic - The ARN of a standard SNS topic. // // - Event Bus - The ARN of an Amazon EventBridge event bus. + // + // S3 buckets are supported only for on-failure destinations. To retain records of + // successful invocations, use another destination type. DestinationConfig *DestinationConfig // The Amazon Resource Name (ARN) of the function. @@ -1098,18 +1123,17 @@ type OnFailure struct { // The Amazon Resource Name (ARN) of the destination resource. // - // To retain records of [asynchronous invocations], you can configure an Amazon SNS topic, Amazon SQS queue, - // Lambda function, or Amazon EventBridge event bus as the destination. + // To retain records of unsuccessful [asynchronous invocations], you can configure an Amazon SNS topic, + // Amazon SQS queue, Amazon S3 bucket, Lambda function, or Amazon EventBridge event + // bus as the destination. // - // To retain records of failed invocations from [Kinesis and DynamoDB event sources], you can configure an Amazon SNS - // topic or Amazon SQS queue as the destination. - // - // To retain records of failed invocations from [self-managed Kafka] or [Amazon MSK], you can configure an Amazon - // SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination. + // To retain records of failed invocations from [Kinesis], [DynamoDB], [self-managed Kafka] or [Amazon MSK], you can configure an + // Amazon SNS topic, Amazon SQS queue, or Amazon S3 bucket as the destination. // // [Amazon MSK]: https://docs.aws.amazon.com/lambda/latest/dg/with-msk.html#services-msk-onfailure-destination - // [Kinesis and DynamoDB event sources]: https://docs.aws.amazon.com/lambda/latest/dg/invocation-eventsourcemapping.html#event-source-mapping-destinations + // [Kinesis]: https://docs.aws.amazon.com/lambda/latest/dg/with-kinesis.html // [asynchronous invocations]: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations + // [DynamoDB]: https://docs.aws.amazon.com/lambda/latest/dg/with-ddb.html // [self-managed Kafka]: https://docs.aws.amazon.com/lambda/latest/dg/with-kafka.html#services-smaa-onfailure-destination Destination *string @@ -1117,6 +1141,11 @@ type OnFailure struct { } // A destination for events that were processed successfully. +// +// To retain records of successful [asynchronous invocations], you can configure an Amazon SNS topic, Amazon +// SQS queue, Lambda function, or Amazon EventBridge event bus as the destination. +// +// [asynchronous invocations]: https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html#invocation-async-destinations type OnSuccess struct { // The Amazon Resource Name (ARN) of the destination resource. diff --git a/service/notifications/LICENSE.txt b/service/notifications/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/notifications/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/notifications/api_client.go b/service/notifications/api_client.go new file mode 100644 index 00000000000..c47c6835333 --- /dev/null +++ b/service/notifications/api_client.go @@ -0,0 +1,913 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "Notifications" +const ServiceAPIVersion = "2018-05-10" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/notifications") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/notifications") +} + +// Client provides the API client to make operations call for AWS User +// Notifications. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/notifications") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "notifications", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/notifications") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/service/notifications/api_client_test.go b/service/notifications/api_client_test.go new file mode 100644 index 00000000000..b6b14b78acc --- /dev/null +++ b/service/notifications/api_client_test.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }, func(o *Options) { + if o.Retryer == nil { + t.Errorf("retryer must not be nil in functional options") + } + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/notifications/api_op_AssociateChannel.go b/service/notifications/api_op_AssociateChannel.go new file mode 100644 index 00000000000..ddd85ab595b --- /dev/null +++ b/service/notifications/api_op_AssociateChannel.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Associates a delivery [Channel] with a particular NotificationConfiguration. Supported +// Channels include AWS Chatbot, the AWS Console Mobile Application, and emails +// (notifications-contacts). +// +// [Channel]: https://docs.aws.amazon.com/notifications/latest/userguide/managing-delivery-channels.html +func (c *Client) AssociateChannel(ctx context.Context, params *AssociateChannelInput, optFns ...func(*Options)) (*AssociateChannelOutput, error) { + if params == nil { + params = &AssociateChannelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "AssociateChannel", params, optFns, c.addOperationAssociateChannelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*AssociateChannelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type AssociateChannelInput struct { + + // The Amazon Resource Name (ARN) of the Channel to associate with the + // NotificationConfiguration. + // + // Supported ARNs include AWS Chatbot, the Console Mobile Application, and + // notifications-contacts. + // + // This member is required. + Arn *string + + // The ARN of the NotificationConfiguration to associate with the Channel. + // + // This member is required. + NotificationConfigurationArn *string + + noSmithyDocumentSerde +} + +type AssociateChannelOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationAssociateChannelMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpAssociateChannel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpAssociateChannel{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "AssociateChannel"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpAssociateChannelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opAssociateChannel(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opAssociateChannel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "AssociateChannel", + } +} diff --git a/service/notifications/api_op_CreateEventRule.go b/service/notifications/api_op_CreateEventRule.go new file mode 100644 index 00000000000..f114ebcc2e1 --- /dev/null +++ b/service/notifications/api_op_CreateEventRule.go @@ -0,0 +1,208 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an [EventRule] that is associated with a specified Notification Configuration. +// +// [EventRule]: https://docs.aws.amazon.com/notifications/latest/userguide/glossary.html +func (c *Client) CreateEventRule(ctx context.Context, params *CreateEventRuleInput, optFns ...func(*Options)) (*CreateEventRuleOutput, error) { + if params == nil { + params = &CreateEventRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateEventRule", params, optFns, c.addOperationCreateEventRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateEventRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateEventRuleInput struct { + + // The event type to match. + // + // Must match one of the valid Amazon EventBridge event types. For example, EC2 + // Instance State-change Notification and AWS CloudWatch Alarm State Change. For + // more information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + // + // This member is required. + EventType *string + + // The Amazon Resource Name (ARN) of the NotificationConfiguration associated with + // this EventRule. + // + // This member is required. + NotificationConfigurationArn *string + + // A list of AWS Regions that send events to this EventRule. + // + // This member is required. + Regions []string + + // The matched event source. + // + // Must match one of the valid EventBridge sources. Only AWS service sourced + // events are supported. For example, aws.ec2 and aws.cloudwatch . For more + // information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + // + // This member is required. + Source *string + + // An additional event pattern used to further filter the events this EventRule + // receives. + // + // For more information, see [Amazon EventBridge event patterns] in the Amazon EventBridge User Guide. + // + // [Amazon EventBridge event patterns]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html + EventPattern *string + + noSmithyDocumentSerde +} + +type CreateEventRuleOutput struct { + + // The ARN of the resource. + // + // This member is required. + Arn *string + + // The ARN of a NotificationConfiguration. + // + // This member is required. + NotificationConfigurationArn *string + + // A list of an EventRule's status by Region. Regions are mapped to + // EventRuleStatusSummary. + // + // This member is required. + StatusSummaryByRegion map[string]types.EventRuleStatusSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateEventRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEventRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEventRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateEventRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateEventRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEventRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateEventRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateEventRule", + } +} diff --git a/service/notifications/api_op_CreateNotificationConfiguration.go b/service/notifications/api_op_CreateNotificationConfiguration.go new file mode 100644 index 00000000000..4837f795a8f --- /dev/null +++ b/service/notifications/api_op_CreateNotificationConfiguration.go @@ -0,0 +1,218 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates a new NotificationConfiguration. +func (c *Client) CreateNotificationConfiguration(ctx context.Context, params *CreateNotificationConfigurationInput, optFns ...func(*Options)) (*CreateNotificationConfigurationOutput, error) { + if params == nil { + params = &CreateNotificationConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateNotificationConfiguration", params, optFns, c.addOperationCreateNotificationConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateNotificationConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateNotificationConfigurationInput struct { + + // The description of the NotificationConfiguration. + // + // This member is required. + Description *string + + // The name of the NotificationConfiguration. Supports RFC 3986's unreserved + // characters. + // + // This member is required. + Name *string + + // The aggregation preference of the NotificationConfiguration. + // + // - Values: + // + // - LONG + // + // - Aggregate notifications for long periods of time (12 hours). + // + // - SHORT + // + // - Aggregate notifications for short periods of time (5 minutes). + // + // - NONE + // + // - Don't aggregate notifications. + // + // No delay in delivery. + AggregationDuration types.AggregationDuration + + // A map of tags assigned to a resource. A tag is a string-to-string map of + // key-value pairs. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateNotificationConfigurationOutput struct { + + // The Amazon Resource Name (ARN) of the the resource. + // + // This member is required. + Arn *string + + // The status of this NotificationConfiguration. + // + // The status should always be INACTIVE when part of the + // CreateNotificationConfiguration response. + // + // - Values: + // + // - ACTIVE + // + // - All EventRules are ACTIVE and any call can be run. + // + // - PARTIALLY_ACTIVE + // + // - Some EventRules are ACTIVE and some are INACTIVE . + // + // - Any call can be run. + // + // - INACTIVE + // + // - All EventRules are INACTIVE and any call can be run. + // + // - DELETING + // + // - This NotificationConfiguration is being deleted. + // + // - Only GET and LIST calls can be run. + // + // This member is required. + Status types.NotificationConfigurationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateNotificationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateNotificationConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateNotificationConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateNotificationConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateNotificationConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateNotificationConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateNotificationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateNotificationConfiguration", + } +} diff --git a/service/notifications/api_op_DeleteEventRule.go b/service/notifications/api_op_DeleteEventRule.go new file mode 100644 index 00000000000..c842a15dc58 --- /dev/null +++ b/service/notifications/api_op_DeleteEventRule.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an EventRule. +func (c *Client) DeleteEventRule(ctx context.Context, params *DeleteEventRuleInput, optFns ...func(*Options)) (*DeleteEventRuleOutput, error) { + if params == nil { + params = &DeleteEventRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteEventRule", params, optFns, c.addOperationDeleteEventRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteEventRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteEventRuleInput struct { + + // The Amazon Resource Name (ARN) of the EventRule to delete. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type DeleteEventRuleOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteEventRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEventRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEventRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteEventRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteEventRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEventRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteEventRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteEventRule", + } +} diff --git a/service/notifications/api_op_DeleteNotificationConfiguration.go b/service/notifications/api_op_DeleteNotificationConfiguration.go new file mode 100644 index 00000000000..d6da1c49a73 --- /dev/null +++ b/service/notifications/api_op_DeleteNotificationConfiguration.go @@ -0,0 +1,152 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes a NotificationConfiguration. +func (c *Client) DeleteNotificationConfiguration(ctx context.Context, params *DeleteNotificationConfigurationInput, optFns ...func(*Options)) (*DeleteNotificationConfigurationOutput, error) { + if params == nil { + params = &DeleteNotificationConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteNotificationConfiguration", params, optFns, c.addOperationDeleteNotificationConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteNotificationConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteNotificationConfigurationInput struct { + + // The Amazon Resource Name (ARN) of the NotificationConfiguration to delete. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type DeleteNotificationConfigurationOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteNotificationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteNotificationConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteNotificationConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteNotificationConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteNotificationConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteNotificationConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteNotificationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteNotificationConfiguration", + } +} diff --git a/service/notifications/api_op_DeregisterNotificationHub.go b/service/notifications/api_op_DeregisterNotificationHub.go new file mode 100644 index 00000000000..051f83c53f8 --- /dev/null +++ b/service/notifications/api_op_DeregisterNotificationHub.go @@ -0,0 +1,169 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deregisters a NotificationHub in the specified Region. +// +// You can't deregister the last NotificationHub in the account. +// NotificationEvents stored in the deregistered NotificationHub are no longer be +// visible. Recreating a new NotificationHub in the same Region restores access to +// those NotificationEvents. +func (c *Client) DeregisterNotificationHub(ctx context.Context, params *DeregisterNotificationHubInput, optFns ...func(*Options)) (*DeregisterNotificationHubOutput, error) { + if params == nil { + params = &DeregisterNotificationHubInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeregisterNotificationHub", params, optFns, c.addOperationDeregisterNotificationHubMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeregisterNotificationHubOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeregisterNotificationHubInput struct { + + // The NotificationHub Region. + // + // This member is required. + NotificationHubRegion *string + + noSmithyDocumentSerde +} + +type DeregisterNotificationHubOutput struct { + + // The NotificationHub Region. + // + // This member is required. + NotificationHubRegion *string + + // NotificationHub status information. + // + // This member is required. + StatusSummary *types.NotificationHubStatusSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeregisterNotificationHubMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeregisterNotificationHub{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeregisterNotificationHub{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeregisterNotificationHub"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeregisterNotificationHubValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeregisterNotificationHub(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeregisterNotificationHub(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeregisterNotificationHub", + } +} diff --git a/service/notifications/api_op_DisassociateChannel.go b/service/notifications/api_op_DisassociateChannel.go new file mode 100644 index 00000000000..c39c8fef159 --- /dev/null +++ b/service/notifications/api_op_DisassociateChannel.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Disassociates a Channel from a specified NotificationConfiguration. Supported +// Channels include AWS Chatbot, the AWS Console Mobile Application, and emails +// (notifications-contacts). +func (c *Client) DisassociateChannel(ctx context.Context, params *DisassociateChannelInput, optFns ...func(*Options)) (*DisassociateChannelOutput, error) { + if params == nil { + params = &DisassociateChannelInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DisassociateChannel", params, optFns, c.addOperationDisassociateChannelMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DisassociateChannelOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DisassociateChannelInput struct { + + // The Amazon Resource Name (ARN) of the Channel to disassociate. + // + // This member is required. + Arn *string + + // The ARN of the NotificationConfiguration to disassociate. + // + // This member is required. + NotificationConfigurationArn *string + + noSmithyDocumentSerde +} + +type DisassociateChannelOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDisassociateChannelMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDisassociateChannel{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDisassociateChannel{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DisassociateChannel"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDisassociateChannelValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDisassociateChannel(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDisassociateChannel(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DisassociateChannel", + } +} diff --git a/service/notifications/api_op_GetEventRule.go b/service/notifications/api_op_GetEventRule.go new file mode 100644 index 00000000000..2096eacd2e4 --- /dev/null +++ b/service/notifications/api_op_GetEventRule.go @@ -0,0 +1,222 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns a specified EventRule. +func (c *Client) GetEventRule(ctx context.Context, params *GetEventRuleInput, optFns ...func(*Options)) (*GetEventRuleOutput, error) { + if params == nil { + params = &GetEventRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetEventRule", params, optFns, c.addOperationGetEventRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetEventRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetEventRuleInput struct { + + // The Amazon Resource Name (ARN) of the EventRule to return. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type GetEventRuleOutput struct { + + // The ARN of the resource. + // + // This member is required. + Arn *string + + // The date when the EventRule was created. + // + // This member is required. + CreationTime *time.Time + + // An additional event pattern used to further filter the events this EventRule + // receives. + // + // For more information, see [Amazon EventBridge event patterns] in the Amazon EventBridge User Guide. + // + // [Amazon EventBridge event patterns]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html + // + // This member is required. + EventPattern *string + + // The event type to match. + // + // Must match one of the valid Amazon EventBridge event types. For example, EC2 + // Instance State-change Notification and AWS CloudWatch Alarm State Change. For + // more information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + // + // This member is required. + EventType *string + + // A list of managed rules from EventBridge that are are associated with this + // EventRule. + // + // These are created by AWS User Notifications within your account so this + // EventRule functions. + // + // This member is required. + ManagedRules []string + + // The ARN of a NotificationConfiguration. + // + // This member is required. + NotificationConfigurationArn *string + + // A list of AWS Regions that send events to this EventRule. + // + // This member is required. + Regions []string + + // The matched event source. + // + // Must match one of the valid EventBridge sources. Only AWS service sourced + // events are supported. For example, aws.ec2 and aws.cloudwatch . For more + // information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + // + // This member is required. + Source *string + + // A list of an EventRule's status by Region. Regions are mapped to + // EventRuleStatusSummary. + // + // This member is required. + StatusSummaryByRegion map[string]types.EventRuleStatusSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetEventRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEventRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEventRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetEventRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetEventRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEventRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetEventRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetEventRule", + } +} diff --git a/service/notifications/api_op_GetNotificationConfiguration.go b/service/notifications/api_op_GetNotificationConfiguration.go new file mode 100644 index 00000000000..c591b5104e9 --- /dev/null +++ b/service/notifications/api_op_GetNotificationConfiguration.go @@ -0,0 +1,225 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns a specified NotificationConfiguration. +func (c *Client) GetNotificationConfiguration(ctx context.Context, params *GetNotificationConfigurationInput, optFns ...func(*Options)) (*GetNotificationConfigurationOutput, error) { + if params == nil { + params = &GetNotificationConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetNotificationConfiguration", params, optFns, c.addOperationGetNotificationConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetNotificationConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetNotificationConfigurationInput struct { + + // The Amazon Resource Name (ARN) of the NotificationConfiguration to return. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type GetNotificationConfigurationOutput struct { + + // The ARN of the resource. + // + // This member is required. + Arn *string + + // The creation time of the NotificationConfiguration. + // + // This member is required. + CreationTime *time.Time + + // The description of the NotificationConfiguration. + // + // This member is required. + Description *string + + // The name of the NotificationConfiguration. + // + // This member is required. + Name *string + + // The status of this NotificationConfiguration. + // + // The status should always be INACTIVE when part of the + // CreateNotificationConfiguration response. + // + // - Values: + // + // - ACTIVE + // + // - All EventRules are ACTIVE and any call can be run. + // + // - PARTIALLY_ACTIVE + // + // - Some EventRules are ACTIVE and some are INACTIVE . + // + // - Any call can be run. + // + // - INACTIVE + // + // - All EventRules are INACTIVE and any call can be run. + // + // - DELETING + // + // - This NotificationConfiguration is being deleted. Only GET and LIST calls can + // be run. + // + // - Only GET and LIST calls can be run. + // + // This member is required. + Status types.NotificationConfigurationStatus + + // The aggregation preference of the NotificationConfiguration. + // + // - Values: + // + // - LONG + // + // - Aggregate notifications for long periods of time (12 hours). + // + // - SHORT + // + // - Aggregate notifications for short periods of time (5 minutes). + // + // - NONE + // + // - Don't aggregate notifications. + // + // No delay in delivery. + AggregationDuration types.AggregationDuration + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetNotificationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetNotificationConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetNotificationConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetNotificationConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetNotificationConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetNotificationConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetNotificationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetNotificationConfiguration", + } +} diff --git a/service/notifications/api_op_GetNotificationEvent.go b/service/notifications/api_op_GetNotificationEvent.go new file mode 100644 index 00000000000..da896ea7377 --- /dev/null +++ b/service/notifications/api_op_GetNotificationEvent.go @@ -0,0 +1,189 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns a specified NotificationEvent. +// +// User Notifications stores notifications in the individual Regions you register +// as notification hubs and the Region of the source event rule. +// GetNotificationEvent only returns notifications stored in the same Region in +// which the action is called. User Notifications doesn't backfill notifications to +// new Regions selected as notification hubs. For this reason, we recommend that +// you make calls in your oldest registered notification hub. For more information, +// see [Notification hubs]in the AWS User Notifications User Guide. +// +// [Notification hubs]: https://docs.aws.amazon.com/notifications/latest/userguide/notification-hubs.html +func (c *Client) GetNotificationEvent(ctx context.Context, params *GetNotificationEventInput, optFns ...func(*Options)) (*GetNotificationEventOutput, error) { + if params == nil { + params = &GetNotificationEventInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetNotificationEvent", params, optFns, c.addOperationGetNotificationEventMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetNotificationEventOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetNotificationEventInput struct { + + // The Amazon Resource Name (ARN) of the NotificationEvent to return. + // + // This member is required. + Arn *string + + // The locale code of the language used for the retrieved NotificationEvent. The + // default locale is English en_US . + Locale types.LocaleCode + + noSmithyDocumentSerde +} + +type GetNotificationEventOutput struct { + + // The ARN of the resource. + // + // This member is required. + Arn *string + + // The content of the NotificationEvent. + // + // This member is required. + Content *types.NotificationEventSchema + + // The creation time of the NotificationEvent. + // + // This member is required. + CreationTime *time.Time + + // The ARN of the NotificationConfiguration. + // + // This member is required. + NotificationConfigurationArn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetNotificationEventMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetNotificationEvent{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetNotificationEvent{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetNotificationEvent"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetNotificationEventValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetNotificationEvent(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetNotificationEvent(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetNotificationEvent", + } +} diff --git a/service/notifications/api_op_ListChannels.go b/service/notifications/api_op_ListChannels.go new file mode 100644 index 00000000000..2fff7f6700e --- /dev/null +++ b/service/notifications/api_op_ListChannels.go @@ -0,0 +1,263 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of Channels for a NotificationConfiguration. +func (c *Client) ListChannels(ctx context.Context, params *ListChannelsInput, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if params == nil { + params = &ListChannelsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListChannels", params, optFns, c.addOperationListChannelsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListChannelsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListChannelsInput struct { + + // The Amazon Resource Name (ARN) of the NotificationConfiguration. + // + // This member is required. + NotificationConfigurationArn *string + + // The maximum number of results to be returned in this call. The default value is + // 20. + MaxResults *int32 + + // The start token for paginated calls. Retrieved from the response of a previous + // ListNotificationEvents call. NextToken uses Base64 encoding. + NextToken *string + + noSmithyDocumentSerde +} + +type ListChannelsOutput struct { + + // A list of Channels. + // + // This member is required. + Channels []string + + // A pagination token. If a non-null pagination token is returned in a result, + // pass its value in another request to retrieve more entries. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListChannelsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListChannels{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListChannels{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListChannels"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListChannelsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListChannels(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListChannelsPaginatorOptions is the paginator options for ListChannels +type ListChannelsPaginatorOptions struct { + // The maximum number of results to be returned in this call. The default value is + // 20. + 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 +} + +// ListChannelsPaginator is a paginator for ListChannels +type ListChannelsPaginator struct { + options ListChannelsPaginatorOptions + client ListChannelsAPIClient + params *ListChannelsInput + nextToken *string + firstPage bool +} + +// NewListChannelsPaginator returns a new ListChannelsPaginator +func NewListChannelsPaginator(client ListChannelsAPIClient, params *ListChannelsInput, optFns ...func(*ListChannelsPaginatorOptions)) *ListChannelsPaginator { + if params == nil { + params = &ListChannelsInput{} + } + + options := ListChannelsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListChannelsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListChannelsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListChannels page. +func (p *ListChannelsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListChannelsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListChannels(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 +} + +// ListChannelsAPIClient is a client that implements the ListChannels operation. +type ListChannelsAPIClient interface { + ListChannels(context.Context, *ListChannelsInput, ...func(*Options)) (*ListChannelsOutput, error) +} + +var _ ListChannelsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListChannels(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListChannels", + } +} diff --git a/service/notifications/api_op_ListEventRules.go b/service/notifications/api_op_ListEventRules.go new file mode 100644 index 00000000000..101522a759f --- /dev/null +++ b/service/notifications/api_op_ListEventRules.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of EventRules according to specified filters, in reverse +// chronological order (newest first). +func (c *Client) ListEventRules(ctx context.Context, params *ListEventRulesInput, optFns ...func(*Options)) (*ListEventRulesOutput, error) { + if params == nil { + params = &ListEventRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEventRules", params, optFns, c.addOperationListEventRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEventRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEventRulesInput struct { + + // The Amazon Resource Name (ARN) of the NotificationConfiguration. + // + // This member is required. + NotificationConfigurationArn *string + + // The maximum number of results to be returned in this call. The default value is + // 20. + MaxResults *int32 + + // The start token for paginated calls. Retrieved from the response of a previous + // ListEventRules call. Next token uses Base64 encoding. + NextToken *string + + noSmithyDocumentSerde +} + +type ListEventRulesOutput struct { + + // A list of EventRules. + // + // This member is required. + EventRules []types.EventRuleStructure + + // A pagination token. If a non-null pagination token is returned in a result, + // pass its value in another request to retrieve more entries. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListEventRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListEventRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEventRules{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListEventRules"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListEventRulesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEventRules(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListEventRulesPaginatorOptions is the paginator options for ListEventRules +type ListEventRulesPaginatorOptions struct { + // The maximum number of results to be returned in this call. The default value is + // 20. + 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 +} + +// ListEventRulesPaginator is a paginator for ListEventRules +type ListEventRulesPaginator struct { + options ListEventRulesPaginatorOptions + client ListEventRulesAPIClient + params *ListEventRulesInput + nextToken *string + firstPage bool +} + +// NewListEventRulesPaginator returns a new ListEventRulesPaginator +func NewListEventRulesPaginator(client ListEventRulesAPIClient, params *ListEventRulesInput, optFns ...func(*ListEventRulesPaginatorOptions)) *ListEventRulesPaginator { + if params == nil { + params = &ListEventRulesInput{} + } + + options := ListEventRulesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEventRulesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEventRulesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEventRules page. +func (p *ListEventRulesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEventRulesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListEventRules(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 +} + +// ListEventRulesAPIClient is a client that implements the ListEventRules +// operation. +type ListEventRulesAPIClient interface { + ListEventRules(context.Context, *ListEventRulesInput, ...func(*Options)) (*ListEventRulesOutput, error) +} + +var _ ListEventRulesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListEventRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListEventRules", + } +} diff --git a/service/notifications/api_op_ListNotificationConfigurations.go b/service/notifications/api_op_ListNotificationConfigurations.go new file mode 100644 index 00000000000..6b2e286619f --- /dev/null +++ b/service/notifications/api_op_ListNotificationConfigurations.go @@ -0,0 +1,296 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of abbreviated NotificationConfigurations according to specified +// filters, in reverse chronological order (newest first). +func (c *Client) ListNotificationConfigurations(ctx context.Context, params *ListNotificationConfigurationsInput, optFns ...func(*Options)) (*ListNotificationConfigurationsOutput, error) { + if params == nil { + params = &ListNotificationConfigurationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListNotificationConfigurations", params, optFns, c.addOperationListNotificationConfigurationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListNotificationConfigurationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListNotificationConfigurationsInput struct { + + // The Amazon Resource Name (ARN) of the Channel to match. + ChannelArn *string + + // The matched event source. + // + // Must match one of the valid EventBridge sources. Only AWS service sourced + // events are supported. For example, aws.ec2 and aws.cloudwatch . For more + // information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + EventRuleSource *string + + // The maximum number of results to be returned in this call. Defaults to 20. + MaxResults *int32 + + // The start token for paginated calls. Retrieved from the response of a previous + // ListEventRules call. Next token uses Base64 encoding. + NextToken *string + + // The NotificationConfiguration status to match. + // + // - Values: + // + // - ACTIVE + // + // - All EventRules are ACTIVE and any call can be run. + // + // - PARTIALLY_ACTIVE + // + // - Some EventRules are ACTIVE and some are INACTIVE . Any call can be run. + // + // - Any call can be run. + // + // - INACTIVE + // + // - All EventRules are INACTIVE and any call can be run. + // + // - DELETING + // + // - This NotificationConfiguration is being deleted. + // + // - Only GET and LIST calls can be run. + Status types.NotificationConfigurationStatus + + noSmithyDocumentSerde +} + +type ListNotificationConfigurationsOutput struct { + + // The NotificationConfigurations in the account. + // + // This member is required. + NotificationConfigurations []types.NotificationConfigurationStructure + + // A pagination token. If a non-null pagination token is returned in a result, + // pass its value in another request to retrieve more entries. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListNotificationConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListNotificationConfigurations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListNotificationConfigurations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListNotificationConfigurations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListNotificationConfigurations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListNotificationConfigurationsPaginatorOptions is the paginator options for +// ListNotificationConfigurations +type ListNotificationConfigurationsPaginatorOptions struct { + // The maximum number of results to be returned in this call. Defaults to 20. + 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 +} + +// ListNotificationConfigurationsPaginator is a paginator for +// ListNotificationConfigurations +type ListNotificationConfigurationsPaginator struct { + options ListNotificationConfigurationsPaginatorOptions + client ListNotificationConfigurationsAPIClient + params *ListNotificationConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListNotificationConfigurationsPaginator returns a new +// ListNotificationConfigurationsPaginator +func NewListNotificationConfigurationsPaginator(client ListNotificationConfigurationsAPIClient, params *ListNotificationConfigurationsInput, optFns ...func(*ListNotificationConfigurationsPaginatorOptions)) *ListNotificationConfigurationsPaginator { + if params == nil { + params = &ListNotificationConfigurationsInput{} + } + + options := ListNotificationConfigurationsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListNotificationConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotificationConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListNotificationConfigurations page. +func (p *ListNotificationConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotificationConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListNotificationConfigurations(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 +} + +// ListNotificationConfigurationsAPIClient is a client that implements the +// ListNotificationConfigurations operation. +type ListNotificationConfigurationsAPIClient interface { + ListNotificationConfigurations(context.Context, *ListNotificationConfigurationsInput, ...func(*Options)) (*ListNotificationConfigurationsOutput, error) +} + +var _ ListNotificationConfigurationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListNotificationConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListNotificationConfigurations", + } +} diff --git a/service/notifications/api_op_ListNotificationEvents.go b/service/notifications/api_op_ListNotificationEvents.go new file mode 100644 index 00000000000..cf8a593a950 --- /dev/null +++ b/service/notifications/api_op_ListNotificationEvents.go @@ -0,0 +1,293 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns a list of NotificationEvents according to specified filters, in reverse +// chronological order (newest first). +// +// User Notifications stores notifications in the individual Regions you register +// as notification hubs and the Region of the source event rule. +// ListNotificationEvents only returns notifications stored in the same Region in +// which the action is called. User Notifications doesn't backfill notifications to +// new Regions selected as notification hubs. For this reason, we recommend that +// you make calls in your oldest registered notification hub. For more information, +// see [Notification hubs]in the AWS User Notifications User Guide. +// +// [Notification hubs]: https://docs.aws.amazon.com/notifications/latest/userguide/notification-hubs.html +func (c *Client) ListNotificationEvents(ctx context.Context, params *ListNotificationEventsInput, optFns ...func(*Options)) (*ListNotificationEventsOutput, error) { + if params == nil { + params = &ListNotificationEventsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListNotificationEvents", params, optFns, c.addOperationListNotificationEventsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListNotificationEventsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListNotificationEventsInput struct { + + // The Amazon Resource Name (ARN) of the aggregatedNotificationEventArn to match. + AggregateNotificationEventArn *string + + // Latest time of events to return from this call. + EndTime *time.Time + + // Include aggregated child events in the result. + IncludeChildEvents *bool + + // The locale code of the language used for the retrieved NotificationEvent. The + // default locale is English (en_US) . + Locale types.LocaleCode + + // The maximum number of results to be returned in this call. Defaults to 20. + MaxResults *int32 + + // The start token for paginated calls. Retrieved from the response of a previous + // ListEventRules call. Next token uses Base64 encoding. + NextToken *string + + // The matched event source. + // + // Must match one of the valid EventBridge sources. Only AWS service sourced + // events are supported. For example, aws.ec2 and aws.cloudwatch . For more + // information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + Source *string + + // The earliest time of events to return from this call. + StartTime *time.Time + + noSmithyDocumentSerde +} + +type ListNotificationEventsOutput struct { + + // The list of notification events. + // + // This member is required. + NotificationEvents []types.NotificationEventOverview + + // A pagination token. If a non-null pagination token is returned in a result, + // pass its value in another request to retrieve more entries. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListNotificationEventsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListNotificationEvents{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListNotificationEvents{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListNotificationEvents"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListNotificationEvents(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListNotificationEventsPaginatorOptions is the paginator options for +// ListNotificationEvents +type ListNotificationEventsPaginatorOptions struct { + // The maximum number of results to be returned in this call. Defaults to 20. + 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 +} + +// ListNotificationEventsPaginator is a paginator for ListNotificationEvents +type ListNotificationEventsPaginator struct { + options ListNotificationEventsPaginatorOptions + client ListNotificationEventsAPIClient + params *ListNotificationEventsInput + nextToken *string + firstPage bool +} + +// NewListNotificationEventsPaginator returns a new ListNotificationEventsPaginator +func NewListNotificationEventsPaginator(client ListNotificationEventsAPIClient, params *ListNotificationEventsInput, optFns ...func(*ListNotificationEventsPaginatorOptions)) *ListNotificationEventsPaginator { + if params == nil { + params = &ListNotificationEventsInput{} + } + + options := ListNotificationEventsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListNotificationEventsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotificationEventsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListNotificationEvents page. +func (p *ListNotificationEventsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotificationEventsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListNotificationEvents(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 +} + +// ListNotificationEventsAPIClient is a client that implements the +// ListNotificationEvents operation. +type ListNotificationEventsAPIClient interface { + ListNotificationEvents(context.Context, *ListNotificationEventsInput, ...func(*Options)) (*ListNotificationEventsOutput, error) +} + +var _ ListNotificationEventsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListNotificationEvents(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListNotificationEvents", + } +} diff --git a/service/notifications/api_op_ListNotificationHubs.go b/service/notifications/api_op_ListNotificationHubs.go new file mode 100644 index 00000000000..27533584091 --- /dev/null +++ b/service/notifications/api_op_ListNotificationHubs.go @@ -0,0 +1,256 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of NotificationHubs. +func (c *Client) ListNotificationHubs(ctx context.Context, params *ListNotificationHubsInput, optFns ...func(*Options)) (*ListNotificationHubsOutput, error) { + if params == nil { + params = &ListNotificationHubsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListNotificationHubs", params, optFns, c.addOperationListNotificationHubsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListNotificationHubsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListNotificationHubsInput struct { + + // The maximum number of records to list in a single response. + MaxResults *int32 + + // A pagination token. Set to null to start listing notification hubs from the + // start. + NextToken *string + + noSmithyDocumentSerde +} + +type ListNotificationHubsOutput struct { + + // The NotificationHubs in the account. + // + // This member is required. + NotificationHubs []types.NotificationHubOverview + + // A pagination token. If a non-null pagination token is returned in a result, + // pass its value in another request to retrieve more entries. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListNotificationHubsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListNotificationHubs{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListNotificationHubs{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListNotificationHubs"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListNotificationHubs(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListNotificationHubsPaginatorOptions is the paginator options for +// ListNotificationHubs +type ListNotificationHubsPaginatorOptions struct { + // The maximum number of records to list in a single response. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListNotificationHubsPaginator is a paginator for ListNotificationHubs +type ListNotificationHubsPaginator struct { + options ListNotificationHubsPaginatorOptions + client ListNotificationHubsAPIClient + params *ListNotificationHubsInput + nextToken *string + firstPage bool +} + +// NewListNotificationHubsPaginator returns a new ListNotificationHubsPaginator +func NewListNotificationHubsPaginator(client ListNotificationHubsAPIClient, params *ListNotificationHubsInput, optFns ...func(*ListNotificationHubsPaginatorOptions)) *ListNotificationHubsPaginator { + if params == nil { + params = &ListNotificationHubsInput{} + } + + options := ListNotificationHubsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListNotificationHubsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNotificationHubsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListNotificationHubs page. +func (p *ListNotificationHubsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNotificationHubsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListNotificationHubs(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 +} + +// ListNotificationHubsAPIClient is a client that implements the +// ListNotificationHubs operation. +type ListNotificationHubsAPIClient interface { + ListNotificationHubs(context.Context, *ListNotificationHubsInput, ...func(*Options)) (*ListNotificationHubsOutput, error) +} + +var _ ListNotificationHubsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListNotificationHubs(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListNotificationHubs", + } +} diff --git a/service/notifications/api_op_ListTagsForResource.go b/service/notifications/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..ce868bcef7b --- /dev/null +++ b/service/notifications/api_op_ListTagsForResource.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns a list of tags for a specified Amazon Resource Name (ARN). +// +// For more information, see [Tagging your AWS resources] in the Tagging AWS Resources User Guide. +// +// This is only supported for NotificationConfigurations. +// +// [Tagging your AWS resources]: https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The Amazon Resource Name (ARN) to use to list tags. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // A list of tags for the specified ARN. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/notifications/api_op_RegisterNotificationHub.go b/service/notifications/api_op_RegisterNotificationHub.go new file mode 100644 index 00000000000..b869d1c42a7 --- /dev/null +++ b/service/notifications/api_op_RegisterNotificationHub.go @@ -0,0 +1,176 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Registers a NotificationHub in the specified Region. +// +// There is a maximum of one NotificationHub per Region. You can have a maximum of +// 3 NotificationHubs at a time. +func (c *Client) RegisterNotificationHub(ctx context.Context, params *RegisterNotificationHubInput, optFns ...func(*Options)) (*RegisterNotificationHubOutput, error) { + if params == nil { + params = &RegisterNotificationHubInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "RegisterNotificationHub", params, optFns, c.addOperationRegisterNotificationHubMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*RegisterNotificationHubOutput) + out.ResultMetadata = metadata + return out, nil +} + +type RegisterNotificationHubInput struct { + + // The Region of the NotificationHub. + // + // This member is required. + NotificationHubRegion *string + + noSmithyDocumentSerde +} + +type RegisterNotificationHubOutput struct { + + // The date the resource was created. + // + // This member is required. + CreationTime *time.Time + + // The Region of the NotificationHub. + // + // This member is required. + NotificationHubRegion *string + + // NotificationHub status information. + // + // This member is required. + StatusSummary *types.NotificationHubStatusSummary + + // The date the resource was last activated. + LastActivationTime *time.Time + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationRegisterNotificationHubMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpRegisterNotificationHub{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpRegisterNotificationHub{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "RegisterNotificationHub"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpRegisterNotificationHubValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opRegisterNotificationHub(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opRegisterNotificationHub(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "RegisterNotificationHub", + } +} diff --git a/service/notifications/api_op_TagResource.go b/service/notifications/api_op_TagResource.go new file mode 100644 index 00000000000..b3e98730898 --- /dev/null +++ b/service/notifications/api_op_TagResource.go @@ -0,0 +1,164 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Tags the resource with a tag key and value. +// +// For more information, see [Tagging your AWS resources] in the Tagging AWS Resources User Guide. +// +// This is only supported for NotificationConfigurations. +// +// [Tagging your AWS resources]: https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The Amazon Resource Name (ARN) to use to tag a resource. + // + // This member is required. + Arn *string + + // A map of tags assigned to a resource. A tag is a string-to-string map of + // key-value pairs. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/service/notifications/api_op_UntagResource.go b/service/notifications/api_op_UntagResource.go new file mode 100644 index 00000000000..e90d8aa571d --- /dev/null +++ b/service/notifications/api_op_UntagResource.go @@ -0,0 +1,161 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Untags a resource with a specified Amazon Resource Name (ARN). +// +// For more information, see [Tagging your AWS resources] in the Tagging AWS Resources User Guide. +// +// [Tagging your AWS resources]: https://docs.aws.amazon.com/tag-editor/latest/userguide/tagging.html +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The Amazon Resource Name (ARN) to use to untag a resource. + // + // This member is required. + Arn *string + + // The tag keys to use to untag a resource. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/service/notifications/api_op_UpdateEventRule.go b/service/notifications/api_op_UpdateEventRule.go new file mode 100644 index 00000000000..fb7332e9b3b --- /dev/null +++ b/service/notifications/api_op_UpdateEventRule.go @@ -0,0 +1,180 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates an existing EventRule. +func (c *Client) UpdateEventRule(ctx context.Context, params *UpdateEventRuleInput, optFns ...func(*Options)) (*UpdateEventRuleOutput, error) { + if params == nil { + params = &UpdateEventRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateEventRule", params, optFns, c.addOperationUpdateEventRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateEventRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateEventRuleInput struct { + + // The Amazon Resource Name (ARN) to use to update the EventRule. + // + // This member is required. + Arn *string + + // An additional event pattern used to further filter the events this EventRule + // receives. + // + // For more information, see [Amazon EventBridge event patterns] in the Amazon EventBridge User Guide. + // + // [Amazon EventBridge event patterns]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html + EventPattern *string + + // A list of AWS Regions that sends events to this EventRule. + Regions []string + + noSmithyDocumentSerde +} + +type UpdateEventRuleOutput struct { + + // The Amazon Resource Name (ARN) to use to update the EventRule. + // + // This member is required. + Arn *string + + // The ARN of the NotificationConfiguration. + // + // This member is required. + NotificationConfigurationArn *string + + // The status of the action by Region. + // + // This member is required. + StatusSummaryByRegion map[string]types.EventRuleStatusSummary + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateEventRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateEventRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateEventRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateEventRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateEventRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateEventRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateEventRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateEventRule", + } +} diff --git a/service/notifications/api_op_UpdateNotificationConfiguration.go b/service/notifications/api_op_UpdateNotificationConfiguration.go new file mode 100644 index 00000000000..2419f85e177 --- /dev/null +++ b/service/notifications/api_op_UpdateNotificationConfiguration.go @@ -0,0 +1,193 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notifications/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Updates a NotificationConfiguration. +func (c *Client) UpdateNotificationConfiguration(ctx context.Context, params *UpdateNotificationConfigurationInput, optFns ...func(*Options)) (*UpdateNotificationConfigurationOutput, error) { + if params == nil { + params = &UpdateNotificationConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateNotificationConfiguration", params, optFns, c.addOperationUpdateNotificationConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateNotificationConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateNotificationConfigurationInput struct { + + // The Amazon Resource Name (ARN) used to update the NotificationConfiguration. + // + // This member is required. + Arn *string + + // The status of this NotificationConfiguration. + // + // The status should always be INACTIVE when part of the + // CreateNotificationConfiguration response. + // + // - Values: + // + // - ACTIVE + // + // - All EventRules are ACTIVE and any call can be run. + // + // - PARTIALLY_ACTIVE + // + // - Some EventRules are ACTIVE and some are INACTIVE . Any call can be run. + // + // - Any call can be run. + // + // - INACTIVE + // + // - All EventRules are INACTIVE and any call can be run. + // + // - DELETING + // + // - This NotificationConfiguration is being deleted. + // + // - Only GET and LIST calls can be run. + AggregationDuration types.AggregationDuration + + // The description of the NotificationConfiguration. + Description *string + + // The name of the NotificationConfiguration. + Name *string + + noSmithyDocumentSerde +} + +type UpdateNotificationConfigurationOutput struct { + + // The ARN used to update the NotificationConfiguration. + // + // This member is required. + Arn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateNotificationConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateNotificationConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateNotificationConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateNotificationConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateNotificationConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateNotificationConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateNotificationConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateNotificationConfiguration", + } +} diff --git a/service/notifications/auth.go b/service/notifications/auth.go new file mode 100644 index 00000000000..91907b158ac --- /dev/null +++ b/service/notifications/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "notifications") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/notifications/deserializers.go b/service/notifications/deserializers.go new file mode 100644 index 00000000000..c7e5d37db3d --- /dev/null +++ b/service/notifications/deserializers.go @@ -0,0 +1,5846 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/notifications/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" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strconv" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpAssociateChannel struct { +} + +func (*awsRestjson1_deserializeOpAssociateChannel) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpAssociateChannel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorAssociateChannel(response, &metadata) + } + output := &AssociateChannelOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorAssociateChannel(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpCreateEventRule struct { +} + +func (*awsRestjson1_deserializeOpCreateEventRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateEventRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateEventRule(response, &metadata) + } + output := &CreateEventRuleOutput{} + 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_deserializeOpDocumentCreateEventRuleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateEventRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentCreateEventRuleOutput(v **CreateEventRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateEventRuleOutput + if *v == nil { + sv = &CreateEventRuleOutput{} + } 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 EventRuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "notificationConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.NotificationConfigurationArn = ptr.String(jtv) + } + + case "statusSummaryByRegion": + if err := awsRestjson1_deserializeDocumentStatusSummaryByRegion(&sv.StatusSummaryByRegion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpCreateNotificationConfiguration struct { +} + +func (*awsRestjson1_deserializeOpCreateNotificationConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateNotificationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateNotificationConfiguration(response, &metadata) + } + output := &CreateNotificationConfigurationOutput{} + 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_deserializeOpDocumentCreateNotificationConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateNotificationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentCreateNotificationConfigurationOutput(v **CreateNotificationConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateNotificationConfigurationOutput + if *v == nil { + sv = &CreateNotificationConfigurationOutput{} + } 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 NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationStatus to be of type string, got %T instead", value) + } + sv.Status = types.NotificationConfigurationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteEventRule struct { +} + +func (*awsRestjson1_deserializeOpDeleteEventRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteEventRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteEventRule(response, &metadata) + } + output := &DeleteEventRuleOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteEventRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeleteNotificationConfiguration struct { +} + +func (*awsRestjson1_deserializeOpDeleteNotificationConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteNotificationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteNotificationConfiguration(response, &metadata) + } + output := &DeleteNotificationConfigurationOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteNotificationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpDeregisterNotificationHub struct { +} + +func (*awsRestjson1_deserializeOpDeregisterNotificationHub) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeregisterNotificationHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeregisterNotificationHub(response, &metadata) + } + output := &DeregisterNotificationHubOutput{} + 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_deserializeOpDocumentDeregisterNotificationHubOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeregisterNotificationHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDeregisterNotificationHubOutput(v **DeregisterNotificationHubOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DeregisterNotificationHubOutput + if *v == nil { + sv = &DeregisterNotificationHubOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "notificationHubRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Region to be of type string, got %T instead", value) + } + sv.NotificationHubRegion = ptr.String(jtv) + } + + case "statusSummary": + if err := awsRestjson1_deserializeDocumentNotificationHubStatusSummary(&sv.StatusSummary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDisassociateChannel struct { +} + +func (*awsRestjson1_deserializeOpDisassociateChannel) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDisassociateChannel) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDisassociateChannel(response, &metadata) + } + output := &DisassociateChannelOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDisassociateChannel(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetEventRule struct { +} + +func (*awsRestjson1_deserializeOpGetEventRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetEventRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetEventRule(response, &metadata) + } + output := &GetEventRuleOutput{} + 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_deserializeOpDocumentGetEventRuleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetEventRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetEventRuleOutput(v **GetEventRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetEventRuleOutput + if *v == nil { + sv = &GetEventRuleOutput{} + } 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 EventRuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "eventPattern": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventRuleEventPattern to be of type string, got %T instead", value) + } + sv.EventPattern = ptr.String(jtv) + } + + case "eventType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventType to be of type string, got %T instead", value) + } + sv.EventType = ptr.String(jtv) + } + + case "managedRules": + if err := awsRestjson1_deserializeDocumentManagedRuleArns(&sv.ManagedRules, value); err != nil { + return err + } + + case "notificationConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.NotificationConfigurationArn = ptr.String(jtv) + } + + case "regions": + if err := awsRestjson1_deserializeDocumentRegions(&sv.Regions, value); err != nil { + return err + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "statusSummaryByRegion": + if err := awsRestjson1_deserializeDocumentStatusSummaryByRegion(&sv.StatusSummaryByRegion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetNotificationConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetNotificationConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetNotificationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetNotificationConfiguration(response, &metadata) + } + output := &GetNotificationConfigurationOutput{} + 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_deserializeOpDocumentGetNotificationConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetNotificationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetNotificationConfigurationOutput(v **GetNotificationConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetNotificationConfigurationOutput + if *v == nil { + sv = &GetNotificationConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aggregationDuration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AggregationDuration to be of type string, got %T instead", value) + } + sv.AggregationDuration = types.AggregationDuration(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationStatus to be of type string, got %T instead", value) + } + sv.Status = types.NotificationConfigurationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetNotificationEvent struct { +} + +func (*awsRestjson1_deserializeOpGetNotificationEvent) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetNotificationEvent) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetNotificationEvent(response, &metadata) + } + output := &GetNotificationEventOutput{} + 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_deserializeOpDocumentGetNotificationEventOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetNotificationEvent(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetNotificationEventOutput(v **GetNotificationEventOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetNotificationEventOutput + if *v == nil { + sv = &GetNotificationEventOutput{} + } 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 NotificationEventArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "content": + if err := awsRestjson1_deserializeDocumentNotificationEventSchema(&sv.Content, value); err != nil { + return err + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "notificationConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.NotificationConfigurationArn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListChannels struct { +} + +func (*awsRestjson1_deserializeOpListChannels) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListChannels) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListChannels(response, &metadata) + } + output := &ListChannelsOutput{} + 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_deserializeOpDocumentListChannelsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListChannels(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListChannelsOutput(v **ListChannelsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListChannelsOutput + if *v == nil { + sv = &ListChannelsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "channels": + if err := awsRestjson1_deserializeDocumentChannels(&sv.Channels, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListEventRules struct { +} + +func (*awsRestjson1_deserializeOpListEventRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListEventRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListEventRules(response, &metadata) + } + output := &ListEventRulesOutput{} + 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_deserializeOpDocumentListEventRulesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListEventRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListEventRulesOutput(v **ListEventRulesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListEventRulesOutput + if *v == nil { + sv = &ListEventRulesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "eventRules": + if err := awsRestjson1_deserializeDocumentEventRules(&sv.EventRules, value); err != nil { + return err + } + + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListNotificationConfigurations struct { +} + +func (*awsRestjson1_deserializeOpListNotificationConfigurations) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListNotificationConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListNotificationConfigurations(response, &metadata) + } + output := &ListNotificationConfigurationsOutput{} + 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_deserializeOpDocumentListNotificationConfigurationsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListNotificationConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListNotificationConfigurationsOutput(v **ListNotificationConfigurationsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListNotificationConfigurationsOutput + if *v == nil { + sv = &ListNotificationConfigurationsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "notificationConfigurations": + if err := awsRestjson1_deserializeDocumentNotificationConfigurations(&sv.NotificationConfigurations, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListNotificationEvents struct { +} + +func (*awsRestjson1_deserializeOpListNotificationEvents) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListNotificationEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListNotificationEvents(response, &metadata) + } + output := &ListNotificationEventsOutput{} + 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_deserializeOpDocumentListNotificationEventsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListNotificationEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListNotificationEventsOutput(v **ListNotificationEventsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListNotificationEventsOutput + if *v == nil { + sv = &ListNotificationEventsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "notificationEvents": + if err := awsRestjson1_deserializeDocumentNotificationEvents(&sv.NotificationEvents, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListNotificationHubs struct { +} + +func (*awsRestjson1_deserializeOpListNotificationHubs) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListNotificationHubs) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListNotificationHubs(response, &metadata) + } + output := &ListNotificationHubsOutput{} + 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_deserializeOpDocumentListNotificationHubsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListNotificationHubs(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListNotificationHubsOutput(v **ListNotificationHubsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListNotificationHubsOutput + if *v == nil { + sv = &ListNotificationHubsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "nextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + case "notificationHubs": + if err := awsRestjson1_deserializeDocumentNotificationHubs(&sv.NotificationHubs, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpRegisterNotificationHub struct { +} + +func (*awsRestjson1_deserializeOpRegisterNotificationHub) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpRegisterNotificationHub) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorRegisterNotificationHub(response, &metadata) + } + output := &RegisterNotificationHubOutput{} + 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_deserializeOpDocumentRegisterNotificationHubOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorRegisterNotificationHub(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentRegisterNotificationHubOutput(v **RegisterNotificationHubOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *RegisterNotificationHubOutput + if *v == nil { + sv = &RegisterNotificationHubOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "lastActivationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LastActivationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastActivationTime = ptr.Time(t) + } + + case "notificationHubRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Region to be of type string, got %T instead", value) + } + sv.NotificationHubRegion = ptr.String(jtv) + } + + case "statusSummary": + if err := awsRestjson1_deserializeDocumentNotificationHubStatusSummary(&sv.StatusSummary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpTagResource struct { +} + +func (*awsRestjson1_deserializeOpTagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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 + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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_deserializeOpUpdateEventRule struct { +} + +func (*awsRestjson1_deserializeOpUpdateEventRule) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateEventRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateEventRule(response, &metadata) + } + output := &UpdateEventRuleOutput{} + 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_deserializeOpDocumentUpdateEventRuleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateEventRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateEventRuleOutput(v **UpdateEventRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateEventRuleOutput + if *v == nil { + sv = &UpdateEventRuleOutput{} + } 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 EventRuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "notificationConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.NotificationConfigurationArn = ptr.String(jtv) + } + + case "statusSummaryByRegion": + if err := awsRestjson1_deserializeDocumentStatusSummaryByRegion(&sv.StatusSummaryByRegion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpUpdateNotificationConfiguration struct { +} + +func (*awsRestjson1_deserializeOpUpdateNotificationConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateNotificationConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateNotificationConfiguration(response, &metadata) + } + output := &UpdateNotificationConfigurationOutput{} + 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_deserializeOpDocumentUpdateNotificationConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateNotificationConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentUpdateNotificationConfigurationOutput(v **UpdateNotificationConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateNotificationConfigurationOutput + if *v == nil { + sv = &UpdateNotificationConfigurationOutput{} + } 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 NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_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) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentChannels(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 ChannelArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ConflictException + if *v == nil { + sv = &types.ConflictException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDimension(v **types.Dimension, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Dimension + if *v == nil { + sv = &types.Dimension{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextPartReference to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "value": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextPartReference to be of type string, got %T instead", value) + } + sv.Value = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentDimensions(v *[]types.Dimension, 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.Dimension + if *v == nil { + cv = []types.Dimension{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Dimension + destAddr := &col + if err := awsRestjson1_deserializeDocumentDimension(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEventRules(v *[]types.EventRuleStructure, 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.EventRuleStructure + if *v == nil { + cv = []types.EventRuleStructure{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EventRuleStructure + destAddr := &col + if err := awsRestjson1_deserializeDocumentEventRuleStructure(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentEventRuleStatusSummary(v **types.EventRuleStatusSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EventRuleStatusSummary + if *v == nil { + sv = &types.EventRuleStatusSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventRuleStatusReason to be of type string, got %T instead", value) + } + sv.Reason = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventRuleStatus to be of type string, got %T instead", value) + } + sv.Status = types.EventRuleStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEventRuleStructure(v **types.EventRuleStructure, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EventRuleStructure + if *v == nil { + sv = &types.EventRuleStructure{} + } 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 EventRuleArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "eventPattern": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventRuleEventPattern to be of type string, got %T instead", value) + } + sv.EventPattern = ptr.String(jtv) + } + + case "eventType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventType to be of type string, got %T instead", value) + } + sv.EventType = ptr.String(jtv) + } + + case "managedRules": + if err := awsRestjson1_deserializeDocumentManagedRuleArns(&sv.ManagedRules, value); err != nil { + return err + } + + case "notificationConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.NotificationConfigurationArn = ptr.String(jtv) + } + + case "regions": + if err := awsRestjson1_deserializeDocumentRegions(&sv.Regions, value); err != nil { + return err + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "statusSummaryByRegion": + if err := awsRestjson1_deserializeDocumentStatusSummaryByRegion(&sv.StatusSummaryByRegion, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentInternalServerException(v **types.InternalServerException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.InternalServerException + if *v == nil { + sv = &types.InternalServerException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentManagedRuleArns(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 ManagedRuleArn to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMedia(v *[]types.MediaElement, 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.MediaElement + if *v == nil { + cv = []types.MediaElement{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.MediaElement + destAddr := &col + if err := awsRestjson1_deserializeDocumentMediaElement(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentMediaElement(v **types.MediaElement, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.MediaElement + if *v == nil { + sv = &types.MediaElement{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "caption": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextPartReference to be of type string, got %T instead", value) + } + sv.Caption = ptr.String(jtv) + } + + case "mediaId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MediaId to be of type string, got %T instead", value) + } + sv.MediaId = ptr.String(jtv) + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MediaElementType to be of type string, got %T instead", value) + } + sv.Type = types.MediaElementType(jtv) + } + + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMessageComponents(v **types.MessageComponents, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.MessageComponents + if *v == nil { + sv = &types.MessageComponents{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "completeDescription": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextPartReference to be of type string, got %T instead", value) + } + sv.CompleteDescription = ptr.String(jtv) + } + + case "dimensions": + if err := awsRestjson1_deserializeDocumentDimensions(&sv.Dimensions, value); err != nil { + return err + } + + case "headline": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextPartReference to be of type string, got %T instead", value) + } + sv.Headline = ptr.String(jtv) + } + + case "paragraphSummary": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextPartReference to be of type string, got %T instead", value) + } + sv.ParagraphSummary = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentMessageComponentsSummary(v **types.MessageComponentsSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.MessageComponentsSummary + if *v == nil { + sv = &types.MessageComponentsSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "headline": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Headline = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationConfigurations(v *[]types.NotificationConfigurationStructure, 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.NotificationConfigurationStructure + if *v == nil { + cv = []types.NotificationConfigurationStructure{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotificationConfigurationStructure + destAddr := &col + if err := awsRestjson1_deserializeDocumentNotificationConfigurationStructure(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationConfigurationStructure(v **types.NotificationConfigurationStructure, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NotificationConfigurationStructure + if *v == nil { + sv = &types.NotificationConfigurationStructure{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aggregationDuration": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AggregationDuration to be of type string, got %T instead", value) + } + sv.AggregationDuration = types.AggregationDuration(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "description": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationDescription to be of type string, got %T instead", value) + } + sv.Description = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationStatus to be of type string, got %T instead", value) + } + sv.Status = types.NotificationConfigurationStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationEventOverview(v **types.NotificationEventOverview, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NotificationEventOverview + if *v == nil { + sv = &types.NotificationEventOverview{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aggregateNotificationEventArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationEventArn to be of type string, got %T instead", value) + } + sv.AggregateNotificationEventArn = ptr.String(jtv) + } + + case "aggregationEventType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AggregationEventType to be of type string, got %T instead", value) + } + sv.AggregationEventType = types.AggregationEventType(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationEventArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "notificationConfigurationArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationConfigurationArn to be of type string, got %T instead", value) + } + sv.NotificationConfigurationArn = ptr.String(jtv) + } + + case "notificationEvent": + if err := awsRestjson1_deserializeDocumentNotificationEventSummary(&sv.NotificationEvent, value); err != nil { + return err + } + + case "relatedAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.RelatedAccount = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationEvents(v *[]types.NotificationEventOverview, 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.NotificationEventOverview + if *v == nil { + cv = []types.NotificationEventOverview{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotificationEventOverview + destAddr := &col + if err := awsRestjson1_deserializeDocumentNotificationEventOverview(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationEventSchema(v **types.NotificationEventSchema, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NotificationEventSchema + if *v == nil { + sv = &types.NotificationEventSchema{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "aggregateNotificationEventArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationEventArn to be of type string, got %T instead", value) + } + sv.AggregateNotificationEventArn = ptr.String(jtv) + } + + case "aggregationEventType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AggregationEventType to be of type string, got %T instead", value) + } + sv.AggregationEventType = types.AggregationEventType(jtv) + } + + case "endTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EndTime = ptr.Time(t) + } + + case "eventStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventStatus to be of type string, got %T instead", value) + } + sv.EventStatus = types.EventStatus(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationEventId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "media": + if err := awsRestjson1_deserializeDocumentMedia(&sv.Media, value); err != nil { + return err + } + + case "messageComponents": + if err := awsRestjson1_deserializeDocumentMessageComponents(&sv.MessageComponents, value); err != nil { + return err + } + + case "notificationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationType to be of type string, got %T instead", value) + } + sv.NotificationType = types.NotificationType(jtv) + } + + case "schemaVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SchemaVersion to be of type string, got %T instead", value) + } + sv.SchemaVersion = types.SchemaVersion(jtv) + } + + case "sourceEventDetailUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.SourceEventDetailUrl = ptr.String(jtv) + } + + case "sourceEventDetailUrlDisplayText": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SourceEventDetailUrlDisplayText = ptr.String(jtv) + } + + case "sourceEventMetadata": + if err := awsRestjson1_deserializeDocumentSourceEventMetadata(&sv.SourceEventMetadata, value); err != nil { + return err + } + + case "startTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.StartTime = ptr.Time(t) + } + + case "textParts": + if err := awsRestjson1_deserializeDocumentTextParts(&sv.TextParts, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationEventSummary(v **types.NotificationEventSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NotificationEventSummary + if *v == nil { + sv = &types.NotificationEventSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "eventStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EventStatus to be of type string, got %T instead", value) + } + sv.EventStatus = types.EventStatus(jtv) + } + + case "messageComponents": + if err := awsRestjson1_deserializeDocumentMessageComponentsSummary(&sv.MessageComponents, value); err != nil { + return err + } + + case "notificationType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationType to be of type string, got %T instead", value) + } + sv.NotificationType = types.NotificationType(jtv) + } + + case "schemaVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SchemaVersion to be of type string, got %T instead", value) + } + sv.SchemaVersion = types.SchemaVersion(jtv) + } + + case "sourceEventMetadata": + if err := awsRestjson1_deserializeDocumentSourceEventMetadataSummary(&sv.SourceEventMetadata, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationHubOverview(v **types.NotificationHubOverview, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NotificationHubOverview + if *v == nil { + sv = &types.NotificationHubOverview{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "lastActivationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected LastActivationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastActivationTime = ptr.Time(t) + } + + case "notificationHubRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Region to be of type string, got %T instead", value) + } + sv.NotificationHubRegion = ptr.String(jtv) + } + + case "statusSummary": + if err := awsRestjson1_deserializeDocumentNotificationHubStatusSummary(&sv.StatusSummary, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationHubs(v *[]types.NotificationHubOverview, 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.NotificationHubOverview + if *v == nil { + cv = []types.NotificationHubOverview{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.NotificationHubOverview + destAddr := &col + if err := awsRestjson1_deserializeDocumentNotificationHubOverview(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentNotificationHubStatusSummary(v **types.NotificationHubStatusSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NotificationHubStatusSummary + if *v == nil { + sv = &types.NotificationHubStatusSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationHubStatusReason to be of type string, got %T instead", value) + } + sv.Reason = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NotificationHubStatus to be of type string, got %T instead", value) + } + sv.Status = types.NotificationHubStatus(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentRegions(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 Region to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentResource(v **types.Resource, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Resource + if *v == nil { + sv = &types.Resource{} + } 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 "detailUrl": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.DetailUrl = ptr.String(jtv) + } + + case "id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "tags": + if err := awsRestjson1_deserializeDocumentTags(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResources(v *[]types.Resource, 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.Resource + if *v == nil { + cv = []types.Resource{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Resource + destAddr := &col + if err := awsRestjson1_deserializeDocumentResource(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + 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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaCode to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSourceEventMetadata(v **types.SourceEventMetadata, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SourceEventMetadata + if *v == nil { + sv = &types.SourceEventMetadata{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "eventOccurrenceTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.EventOccurrenceTime = ptr.Time(t) + } + + case "eventOriginRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Region to be of type string, got %T instead", value) + } + sv.EventOriginRegion = ptr.String(jtv) + } + + case "eventType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventType = ptr.String(jtv) + } + + case "eventTypeVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventTypeVersion = ptr.String(jtv) + } + + case "relatedAccount": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AccountId to be of type string, got %T instead", value) + } + sv.RelatedAccount = ptr.String(jtv) + } + + case "relatedResources": + if err := awsRestjson1_deserializeDocumentResources(&sv.RelatedResources, value); err != nil { + return err + } + + case "source": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Source to be of type string, got %T instead", value) + } + sv.Source = ptr.String(jtv) + } + + case "sourceEventId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SourceEventId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSourceEventMetadataSummary(v **types.SourceEventMetadataSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.SourceEventMetadataSummary + if *v == nil { + sv = &types.SourceEventMetadataSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "eventOriginRegion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventOriginRegion = ptr.String(jtv) + } + + case "eventType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.EventType = ptr.String(jtv) + } + + case "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) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentStatusSummaryByRegion(v *map[string]types.EventRuleStatusSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]types.EventRuleStatusSummary + if *v == nil { + mv = map[string]types.EventRuleStatusSummary{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.EventRuleStatusSummary + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentEventRuleStatusSummary(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTags(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_deserializeDocumentTextByLocale(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTextParts(v *map[string]types.TextPartValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]types.TextPartValue + if *v == nil { + mv = map[string]types.TextPartValue{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal types.TextPartValue + mapVar := parsedVal + destAddr := &mapVar + if err := awsRestjson1_deserializeDocumentTextPartValue(&destAddr, value); err != nil { + return err + } + parsedVal = *destAddr + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentTextPartValue(v **types.TextPartValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TextPartValue + if *v == nil { + sv = &types.TextPartValue{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "displayText": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.DisplayText = ptr.String(jtv) + } + + case "textByLocale": + if err := awsRestjson1_deserializeDocumentTextByLocale(&sv.TextByLocale, value); err != nil { + return err + } + + case "type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TextPartType to be of type string, got %T instead", value) + } + sv.Type = types.TextPartType(jtv) + } + + case "url": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Url to be of type string, got %T instead", value) + } + sv.Url = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaCode to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/notifications/doc.go b/service/notifications/doc.go new file mode 100644 index 00000000000..c20cb3fed72 --- /dev/null +++ b/service/notifications/doc.go @@ -0,0 +1,23 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package notifications provides the API client, operations, and parameter types +// for AWS User Notifications. +// +// The AWS User Notifications API Reference provides descriptions, API request +// parameters, and the JSON response for each of the User Notification API actions. +// +// User Notification control APIs are currently available in US East (Virginia) - +// us-east-1 . +// +// [GetNotificationEvent]and [ListNotificationEvents] APIs are currently available in [commercial partition Regions] and only return notifications stored in +// the same Region in which they're called. +// +// The User Notifications console can only be used in US East (Virginia). Your +// data however, is stored in each Region chosen as a [notification hub]in addition to US East +// (Virginia). +// +// [GetNotificationEvent]: https://docs.aws.amazon.com/notifications/latest/APIReference/API_GetNotificationEvent.html +// [notification hub]: https://docs.aws.amazon.com/notifications/latest/userguide/notification-hubs.html> +// [ListNotificationEvents]: https://docs.aws.amazon.com/notifications/latest/APIReference/API_ListNotificationEvents.html +// [commercial partition Regions]: https://docs.aws.amazon.com/notifications/latest/userguide/supported-regions.html +package notifications diff --git a/service/notifications/endpoints.go b/service/notifications/endpoints.go new file mode 100644 index 00000000000..789d9a9201e --- /dev/null +++ b/service/notifications/endpoints.go @@ -0,0 +1,462 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/notifications/internal/endpoints" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "notifications" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_NOTIFICATIONS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "Notifications", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string + + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://notifications-fips.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://notifications.") + out.WriteString(_Region) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + params.Region = bindRegion(options.Region) + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/notifications/endpoints_config_test.go b/service/notifications/endpoints_config_test.go new file mode 100644 index 00000000000..40a1c144bc3 --- /dev/null +++ b/service/notifications/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-notifications.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-notifications.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-notifications.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-notifications.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-notifications.dev", + expectURL: aws.String("https://env-notifications.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-notifications.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-notifications.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-notifications.dev", + expectURL: aws.String("http://config-notifications.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-notifications.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-notifications.dev", + clientEndpoint: aws.String("https://client-notifications.dev"), + expectURL: aws.String("https://client-notifications.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_NOTIFICATIONS", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/notifications/endpoints_test.go b/service/notifications/endpoints_test.go new file mode 100644 index 00000000000..c105db4354e --- /dev/null +++ b/service/notifications/endpoints_test.go @@ -0,0 +1,590 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +// For custom endpoint with region not set and fips disabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-fips.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS enabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-fips.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack enabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-fips.us-gov-west-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications.us-gov-west-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-fips.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS enabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-fips.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack enabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// Missing region +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/notifications/generated.json b/service/notifications/generated.json new file mode 100644 index 00000000000..a493d2f7bc2 --- /dev/null +++ b/service/notifications/generated.json @@ -0,0 +1,53 @@ +{ + "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_AssociateChannel.go", + "api_op_CreateEventRule.go", + "api_op_CreateNotificationConfiguration.go", + "api_op_DeleteEventRule.go", + "api_op_DeleteNotificationConfiguration.go", + "api_op_DeregisterNotificationHub.go", + "api_op_DisassociateChannel.go", + "api_op_GetEventRule.go", + "api_op_GetNotificationConfiguration.go", + "api_op_GetNotificationEvent.go", + "api_op_ListChannels.go", + "api_op_ListEventRules.go", + "api_op_ListNotificationConfigurations.go", + "api_op_ListNotificationEvents.go", + "api_op_ListNotificationHubs.go", + "api_op_ListTagsForResource.go", + "api_op_RegisterNotificationHub.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "api_op_UpdateEventRule.go", + "api_op_UpdateNotificationConfiguration.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/notifications", + "unstable": false +} diff --git a/service/notifications/go.mod b/service/notifications/go.mod new file mode 100644 index 00000000000..11ac590801f --- /dev/null +++ b/service/notifications/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/notifications + +go 1.21 + +require ( + github.com/aws/aws-sdk-go-v2 v1.32.5 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 + github.com/aws/smithy-go v1.22.1 +) + +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/notifications/go.sum b/service/notifications/go.sum new file mode 100644 index 00000000000..bd2678891af --- /dev/null +++ b/service/notifications/go.sum @@ -0,0 +1,2 @@ +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= diff --git a/service/notifications/go_module_metadata.go b/service/notifications/go_module_metadata.go new file mode 100644 index 00000000000..68e108401a8 --- /dev/null +++ b/service/notifications/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package notifications + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/notifications/internal/endpoints/endpoints.go b/service/notifications/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..4ddf62080ed --- /dev/null +++ b/service/notifications/internal/endpoints/endpoints.go @@ -0,0 +1,472 @@ +// 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 Notifications endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "notifications.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "notifications-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "af-south-1", + }: endpoints.Endpoint{ + Hostname: "notifications.af-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-east-1", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-northeast-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-northeast-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-northeast-3.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-south-1", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-south-2", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-south-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-southeast-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-southeast-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-3", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-southeast-3.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-4", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-southeast-4.api.aws", + }, + endpoints.EndpointKey{ + Region: "ap-southeast-5", + }: endpoints.Endpoint{ + Hostname: "notifications.ap-southeast-5.api.aws", + }, + endpoints.EndpointKey{ + Region: "ca-central-1", + }: endpoints.Endpoint{ + Hostname: "notifications.ca-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "ca-west-1", + }: endpoints.Endpoint{ + Hostname: "notifications.ca-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-central-1", + }: endpoints.Endpoint{ + Hostname: "notifications.eu-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-central-2", + }: endpoints.Endpoint{ + Hostname: "notifications.eu-central-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-north-1", + }: endpoints.Endpoint{ + Hostname: "notifications.eu-north-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-south-1", + }: endpoints.Endpoint{ + Hostname: "notifications.eu-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-south-2", + }: endpoints.Endpoint{ + Hostname: "notifications.eu-south-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-1", + }: endpoints.Endpoint{ + Hostname: "notifications.eu-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-2", + }: endpoints.Endpoint{ + Hostname: "notifications.eu-west-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "eu-west-3", + }: endpoints.Endpoint{ + Hostname: "notifications.eu-west-3.api.aws", + }, + endpoints.EndpointKey{ + Region: "il-central-1", + }: endpoints.Endpoint{ + Hostname: "notifications.il-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "me-central-1", + }: endpoints.Endpoint{ + Hostname: "notifications.me-central-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "me-south-1", + }: endpoints.Endpoint{ + Hostname: "notifications.me-south-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "sa-east-1", + }: endpoints.Endpoint{ + Hostname: "notifications.sa-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-1", + }: endpoints.Endpoint{ + Hostname: "notifications.us-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + }: endpoints.Endpoint{ + Hostname: "notifications.us-east-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + }: endpoints.Endpoint{ + Hostname: "notifications.us-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + }: endpoints.Endpoint{ + Hostname: "notifications.us-west-2.api.aws", + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "notifications.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "notifications-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsCn, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "cn-north-1", + }: endpoints.Endpoint{ + Hostname: "notifications.cn-north-1.api.amazonwebservices.com.cn", + }, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + }: endpoints.Endpoint{ + Hostname: "notifications.cn-northwest-1.api.amazonwebservices.com.cn", + }, + }, + }, + { + ID: "aws-iso", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications.{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: "notifications-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "notifications.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "notifications-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "us-gov-east-1", + }: endpoints.Endpoint{ + Hostname: "notifications.us-gov-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + }: endpoints.Endpoint{ + Hostname: "notifications.us-gov-west-1.api.aws", + }, + }, + }, +} diff --git a/service/notifications/internal/endpoints/endpoints_test.go b/service/notifications/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/notifications/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/notifications/options.go b/service/notifications/options.go new file mode 100644 index 00000000000..da10969d4c4 --- /dev/null +++ b/service/notifications/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/service/notifications/protocol_test.go b/service/notifications/protocol_test.go new file mode 100644 index 00000000000..aefb0c1c3f2 --- /dev/null +++ b/service/notifications/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications diff --git a/service/notifications/serializers.go b/service/notifications/serializers.go new file mode 100644 index 00000000000..ec4745b9923 --- /dev/null +++ b/service/notifications/serializers.go @@ -0,0 +1,1781 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "bytes" + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + smithytime "github.com/aws/smithy-go/time" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpAssociateChannel struct { +} + +func (*awsRestjson1_serializeOpAssociateChannel) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpAssociateChannel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*AssociateChannelInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/channels/associate/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsAssociateChannelInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentAssociateChannelInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsAssociateChannelInput(v *AssociateChannelInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentAssociateChannelInput(v *AssociateChannelInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NotificationConfigurationArn != nil { + ok := object.Key("notificationConfigurationArn") + ok.String(*v.NotificationConfigurationArn) + } + + return nil +} + +type awsRestjson1_serializeOpCreateEventRule struct { +} + +func (*awsRestjson1_serializeOpCreateEventRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateEventRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateEventRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/event-rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateEventRuleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateEventRuleInput(v *CreateEventRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateEventRuleInput(v *CreateEventRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EventPattern != nil { + ok := object.Key("eventPattern") + ok.String(*v.EventPattern) + } + + if v.EventType != nil { + ok := object.Key("eventType") + ok.String(*v.EventType) + } + + if v.NotificationConfigurationArn != nil { + ok := object.Key("notificationConfigurationArn") + ok.String(*v.NotificationConfigurationArn) + } + + if v.Regions != nil { + ok := object.Key("regions") + if err := awsRestjson1_serializeDocumentRegions(v.Regions, ok); err != nil { + return err + } + } + + if v.Source != nil { + ok := object.Key("source") + ok.String(*v.Source) + } + + return nil +} + +type awsRestjson1_serializeOpCreateNotificationConfiguration struct { +} + +func (*awsRestjson1_serializeOpCreateNotificationConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateNotificationConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-configurations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateNotificationConfigurationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateNotificationConfigurationInput(v *CreateNotificationConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateNotificationConfigurationInput(v *CreateNotificationConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AggregationDuration) > 0 { + ok := object.Key("aggregationDuration") + ok.String(string(v.AggregationDuration)) + } + + if v.Description != nil { + ok := object.Key("description") + ok.String(*v.Description) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteEventRule struct { +} + +func (*awsRestjson1_serializeOpDeleteEventRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteEventRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteEventRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/event-rules/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteEventRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteEventRuleInput(v *DeleteEventRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteNotificationConfiguration struct { +} + +func (*awsRestjson1_serializeOpDeleteNotificationConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteNotificationConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-configurations/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteNotificationConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteNotificationConfigurationInput(v *DeleteNotificationConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeregisterNotificationHub struct { +} + +func (*awsRestjson1_serializeOpDeregisterNotificationHub) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeregisterNotificationHub) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeregisterNotificationHubInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-hubs/{notificationHubRegion}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeregisterNotificationHubInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeregisterNotificationHubInput(v *DeregisterNotificationHubInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.NotificationHubRegion == nil || len(*v.NotificationHubRegion) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member notificationHubRegion must not be empty")} + } + if v.NotificationHubRegion != nil { + if err := encoder.SetURI("notificationHubRegion").String(*v.NotificationHubRegion); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDisassociateChannel struct { +} + +func (*awsRestjson1_serializeOpDisassociateChannel) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDisassociateChannel) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DisassociateChannelInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/channels/disassociate/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDisassociateChannelInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDisassociateChannelInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDisassociateChannelInput(v *DisassociateChannelInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDisassociateChannelInput(v *DisassociateChannelInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NotificationConfigurationArn != nil { + ok := object.Key("notificationConfigurationArn") + ok.String(*v.NotificationConfigurationArn) + } + + return nil +} + +type awsRestjson1_serializeOpGetEventRule struct { +} + +func (*awsRestjson1_serializeOpGetEventRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetEventRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetEventRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/event-rules/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetEventRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetEventRuleInput(v *GetEventRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetNotificationConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetNotificationConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetNotificationConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-configurations/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetNotificationConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetNotificationConfigurationInput(v *GetNotificationConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetNotificationEvent struct { +} + +func (*awsRestjson1_serializeOpGetNotificationEvent) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetNotificationEvent) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetNotificationEventInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-events/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetNotificationEventInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetNotificationEventInput(v *GetNotificationEventInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if len(v.Locale) > 0 { + encoder.SetQuery("locale").String(string(v.Locale)) + } + + return nil +} + +type awsRestjson1_serializeOpListChannels struct { +} + +func (*awsRestjson1_serializeOpListChannels) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListChannels) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListChannelsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/channels") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListChannelsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListChannelsInput(v *ListChannelsInput, 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.NotificationConfigurationArn != nil { + encoder.SetQuery("notificationConfigurationArn").String(*v.NotificationConfigurationArn) + } + + return nil +} + +type awsRestjson1_serializeOpListEventRules struct { +} + +func (*awsRestjson1_serializeOpListEventRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListEventRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListEventRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/event-rules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListEventRulesInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListEventRulesInput(v *ListEventRulesInput, 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.NotificationConfigurationArn != nil { + encoder.SetQuery("notificationConfigurationArn").String(*v.NotificationConfigurationArn) + } + + return nil +} + +type awsRestjson1_serializeOpListNotificationConfigurations struct { +} + +func (*awsRestjson1_serializeOpListNotificationConfigurations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListNotificationConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListNotificationConfigurationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-configurations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListNotificationConfigurationsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListNotificationConfigurationsInput(v *ListNotificationConfigurationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ChannelArn != nil { + encoder.SetQuery("channelArn").String(*v.ChannelArn) + } + + if v.EventRuleSource != nil { + encoder.SetQuery("eventRuleSource").String(*v.EventRuleSource) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if len(v.Status) > 0 { + encoder.SetQuery("status").String(string(v.Status)) + } + + return nil +} + +type awsRestjson1_serializeOpListNotificationEvents struct { +} + +func (*awsRestjson1_serializeOpListNotificationEvents) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListNotificationEvents) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListNotificationEventsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-events") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListNotificationEventsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListNotificationEventsInput(v *ListNotificationEventsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.AggregateNotificationEventArn != nil { + encoder.SetQuery("aggregateNotificationEventArn").String(*v.AggregateNotificationEventArn) + } + + if v.EndTime != nil { + encoder.SetQuery("endTime").String(smithytime.FormatDateTime(*v.EndTime)) + } + + if v.IncludeChildEvents != nil { + encoder.SetQuery("includeChildEvents").Boolean(*v.IncludeChildEvents) + } + + if len(v.Locale) > 0 { + encoder.SetQuery("locale").String(string(v.Locale)) + } + + if v.MaxResults != nil { + encoder.SetQuery("maxResults").Integer(*v.MaxResults) + } + + if v.NextToken != nil { + encoder.SetQuery("nextToken").String(*v.NextToken) + } + + if v.Source != nil { + encoder.SetQuery("source").String(*v.Source) + } + + if v.StartTime != nil { + encoder.SetQuery("startTime").String(smithytime.FormatDateTime(*v.StartTime)) + } + + return nil +} + +type awsRestjson1_serializeOpListNotificationHubs struct { +} + +func (*awsRestjson1_serializeOpListNotificationHubs) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListNotificationHubs) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListNotificationHubsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-hubs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListNotificationHubsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListNotificationHubsInput(v *ListNotificationHubsInput, 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_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpRegisterNotificationHub struct { +} + +func (*awsRestjson1_serializeOpRegisterNotificationHub) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpRegisterNotificationHub) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*RegisterNotificationHubInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-hubs") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentRegisterNotificationHubInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsRegisterNotificationHubInput(v *RegisterNotificationHubInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentRegisterNotificationHubInput(v *RegisterNotificationHubInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NotificationHubRegion != nil { + ok := object.Key("notificationHubRegion") + ok.String(*v.NotificationHubRegion) + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateEventRule struct { +} + +func (*awsRestjson1_serializeOpUpdateEventRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateEventRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateEventRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/event-rules/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateEventRuleInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateEventRuleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateEventRuleInput(v *UpdateEventRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateEventRuleInput(v *UpdateEventRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EventPattern != nil { + ok := object.Key("eventPattern") + ok.String(*v.EventPattern) + } + + if v.Regions != nil { + ok := object.Key("regions") + if err := awsRestjson1_serializeDocumentRegions(v.Regions, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUpdateNotificationConfiguration struct { +} + +func (*awsRestjson1_serializeOpUpdateNotificationConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateNotificationConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateNotificationConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/notification-configurations/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUpdateNotificationConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateNotificationConfigurationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateNotificationConfigurationInput(v *UpdateNotificationConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateNotificationConfigurationInput(v *UpdateNotificationConfigurationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.AggregationDuration) > 0 { + ok := object.Key("aggregationDuration") + ok.String(string(v.AggregationDuration)) + } + + 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 +} + +func awsRestjson1_serializeDocumentRegions(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_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} diff --git a/service/notifications/snapshot/api_op_AssociateChannel.go.snap b/service/notifications/snapshot/api_op_AssociateChannel.go.snap new file mode 100644 index 00000000000..be0b2f0fe41 --- /dev/null +++ b/service/notifications/snapshot/api_op_AssociateChannel.go.snap @@ -0,0 +1,41 @@ +AssociateChannel + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_CreateEventRule.go.snap b/service/notifications/snapshot/api_op_CreateEventRule.go.snap new file mode 100644 index 00000000000..c5d2f861457 --- /dev/null +++ b/service/notifications/snapshot/api_op_CreateEventRule.go.snap @@ -0,0 +1,41 @@ +CreateEventRule + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_CreateNotificationConfiguration.go.snap b/service/notifications/snapshot/api_op_CreateNotificationConfiguration.go.snap new file mode 100644 index 00000000000..84252f72a28 --- /dev/null +++ b/service/notifications/snapshot/api_op_CreateNotificationConfiguration.go.snap @@ -0,0 +1,41 @@ +CreateNotificationConfiguration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_DeleteEventRule.go.snap b/service/notifications/snapshot/api_op_DeleteEventRule.go.snap new file mode 100644 index 00000000000..e7af5cc8958 --- /dev/null +++ b/service/notifications/snapshot/api_op_DeleteEventRule.go.snap @@ -0,0 +1,41 @@ +DeleteEventRule + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_DeleteNotificationConfiguration.go.snap b/service/notifications/snapshot/api_op_DeleteNotificationConfiguration.go.snap new file mode 100644 index 00000000000..7fd21cc7638 --- /dev/null +++ b/service/notifications/snapshot/api_op_DeleteNotificationConfiguration.go.snap @@ -0,0 +1,41 @@ +DeleteNotificationConfiguration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_DeregisterNotificationHub.go.snap b/service/notifications/snapshot/api_op_DeregisterNotificationHub.go.snap new file mode 100644 index 00000000000..0921955c440 --- /dev/null +++ b/service/notifications/snapshot/api_op_DeregisterNotificationHub.go.snap @@ -0,0 +1,41 @@ +DeregisterNotificationHub + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_DisassociateChannel.go.snap b/service/notifications/snapshot/api_op_DisassociateChannel.go.snap new file mode 100644 index 00000000000..623f6600647 --- /dev/null +++ b/service/notifications/snapshot/api_op_DisassociateChannel.go.snap @@ -0,0 +1,41 @@ +DisassociateChannel + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_GetEventRule.go.snap b/service/notifications/snapshot/api_op_GetEventRule.go.snap new file mode 100644 index 00000000000..ed54f90ee3e --- /dev/null +++ b/service/notifications/snapshot/api_op_GetEventRule.go.snap @@ -0,0 +1,41 @@ +GetEventRule + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_GetNotificationConfiguration.go.snap b/service/notifications/snapshot/api_op_GetNotificationConfiguration.go.snap new file mode 100644 index 00000000000..e6894319433 --- /dev/null +++ b/service/notifications/snapshot/api_op_GetNotificationConfiguration.go.snap @@ -0,0 +1,41 @@ +GetNotificationConfiguration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_GetNotificationEvent.go.snap b/service/notifications/snapshot/api_op_GetNotificationEvent.go.snap new file mode 100644 index 00000000000..706f7baf974 --- /dev/null +++ b/service/notifications/snapshot/api_op_GetNotificationEvent.go.snap @@ -0,0 +1,41 @@ +GetNotificationEvent + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_ListChannels.go.snap b/service/notifications/snapshot/api_op_ListChannels.go.snap new file mode 100644 index 00000000000..721c0287bd7 --- /dev/null +++ b/service/notifications/snapshot/api_op_ListChannels.go.snap @@ -0,0 +1,41 @@ +ListChannels + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_ListEventRules.go.snap b/service/notifications/snapshot/api_op_ListEventRules.go.snap new file mode 100644 index 00000000000..3d59ef3e184 --- /dev/null +++ b/service/notifications/snapshot/api_op_ListEventRules.go.snap @@ -0,0 +1,41 @@ +ListEventRules + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_ListNotificationConfigurations.go.snap b/service/notifications/snapshot/api_op_ListNotificationConfigurations.go.snap new file mode 100644 index 00000000000..cae593c2539 --- /dev/null +++ b/service/notifications/snapshot/api_op_ListNotificationConfigurations.go.snap @@ -0,0 +1,40 @@ +ListNotificationConfigurations + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_ListNotificationEvents.go.snap b/service/notifications/snapshot/api_op_ListNotificationEvents.go.snap new file mode 100644 index 00000000000..5449597e151 --- /dev/null +++ b/service/notifications/snapshot/api_op_ListNotificationEvents.go.snap @@ -0,0 +1,40 @@ +ListNotificationEvents + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_ListNotificationHubs.go.snap b/service/notifications/snapshot/api_op_ListNotificationHubs.go.snap new file mode 100644 index 00000000000..5e1c452ea00 --- /dev/null +++ b/service/notifications/snapshot/api_op_ListNotificationHubs.go.snap @@ -0,0 +1,40 @@ +ListNotificationHubs + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_ListTagsForResource.go.snap b/service/notifications/snapshot/api_op_ListTagsForResource.go.snap new file mode 100644 index 00000000000..071d3ac4e96 --- /dev/null +++ b/service/notifications/snapshot/api_op_ListTagsForResource.go.snap @@ -0,0 +1,41 @@ +ListTagsForResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_RegisterNotificationHub.go.snap b/service/notifications/snapshot/api_op_RegisterNotificationHub.go.snap new file mode 100644 index 00000000000..fc25813060c --- /dev/null +++ b/service/notifications/snapshot/api_op_RegisterNotificationHub.go.snap @@ -0,0 +1,41 @@ +RegisterNotificationHub + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_TagResource.go.snap b/service/notifications/snapshot/api_op_TagResource.go.snap new file mode 100644 index 00000000000..ae6f8e0846c --- /dev/null +++ b/service/notifications/snapshot/api_op_TagResource.go.snap @@ -0,0 +1,41 @@ +TagResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_UntagResource.go.snap b/service/notifications/snapshot/api_op_UntagResource.go.snap new file mode 100644 index 00000000000..c7bbe038d98 --- /dev/null +++ b/service/notifications/snapshot/api_op_UntagResource.go.snap @@ -0,0 +1,41 @@ +UntagResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_UpdateEventRule.go.snap b/service/notifications/snapshot/api_op_UpdateEventRule.go.snap new file mode 100644 index 00000000000..1a879853826 --- /dev/null +++ b/service/notifications/snapshot/api_op_UpdateEventRule.go.snap @@ -0,0 +1,41 @@ +UpdateEventRule + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot/api_op_UpdateNotificationConfiguration.go.snap b/service/notifications/snapshot/api_op_UpdateNotificationConfiguration.go.snap new file mode 100644 index 00000000000..7fec0922e87 --- /dev/null +++ b/service/notifications/snapshot/api_op_UpdateNotificationConfiguration.go.snap @@ -0,0 +1,41 @@ +UpdateNotificationConfiguration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notifications/snapshot_test.go b/service/notifications/snapshot_test.go new file mode 100644 index 00000000000..5b54e698e25 --- /dev/null +++ b/service/notifications/snapshot_test.go @@ -0,0 +1,566 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +//go:build snapshot + +package notifications + +import ( + "context" + "errors" + "fmt" + "github.com/aws/smithy-go/middleware" + "io" + "io/fs" + "os" + "testing" +) + +const ssprefix = "snapshot" + +type snapshotOK struct{} + +func (snapshotOK) Error() string { return "error: success" } + +func createp(path string) (*os.File, error) { + if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { + return nil, err + } + return os.Create(path) +} + +func sspath(op string) string { + return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) +} + +func updateSnapshot(stack *middleware.Stack, operation string) error { + f, err := createp(sspath(operation)) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write([]byte(stack.String())); err != nil { + return err + } + return snapshotOK{} +} + +func testSnapshot(stack *middleware.Stack, operation string) error { + f, err := os.Open(sspath(operation)) + if errors.Is(err, fs.ErrNotExist) { + return snapshotOK{} + } + if err != nil { + return err + } + defer f.Close() + expected, err := io.ReadAll(f) + if err != nil { + return err + } + if actual := stack.String(); actual != string(expected) { + return fmt.Errorf("%s != %s", expected, actual) + } + return snapshotOK{} +} +func TestCheckSnapshot_AssociateChannel(t *testing.T) { + svc := New(Options{}) + _, err := svc.AssociateChannel(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "AssociateChannel") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreateEventRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateEventRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateEventRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreateNotificationConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateNotificationConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateNotificationConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteEventRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteEventRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteEventRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteNotificationConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteNotificationConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteNotificationConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeregisterNotificationHub(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeregisterNotificationHub(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeregisterNotificationHub") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DisassociateChannel(t *testing.T) { + svc := New(Options{}) + _, err := svc.DisassociateChannel(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DisassociateChannel") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetEventRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetEventRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetEventRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetNotificationConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetNotificationConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetNotificationConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetNotificationEvent(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetNotificationEvent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetNotificationEvent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListChannels(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListChannels(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListChannels") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListEventRules(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListEventRules(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListEventRules") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListNotificationConfigurations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNotificationConfigurations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListNotificationConfigurations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListNotificationEvents(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNotificationEvents(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListNotificationEvents") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListNotificationHubs(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNotificationHubs(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListNotificationHubs") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_RegisterNotificationHub(t *testing.T) { + svc := New(Options{}) + _, err := svc.RegisterNotificationHub(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "RegisterNotificationHub") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateEventRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateEventRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateEventRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UpdateNotificationConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateNotificationConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateNotificationConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_AssociateChannel(t *testing.T) { + svc := New(Options{}) + _, err := svc.AssociateChannel(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "AssociateChannel") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreateEventRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateEventRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateEventRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreateNotificationConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateNotificationConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateNotificationConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteEventRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteEventRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteEventRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteNotificationConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteNotificationConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteNotificationConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeregisterNotificationHub(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeregisterNotificationHub(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeregisterNotificationHub") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DisassociateChannel(t *testing.T) { + svc := New(Options{}) + _, err := svc.DisassociateChannel(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DisassociateChannel") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetEventRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetEventRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetEventRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetNotificationConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetNotificationConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetNotificationConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetNotificationEvent(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetNotificationEvent(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetNotificationEvent") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListChannels(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListChannels(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListChannels") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListEventRules(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListEventRules(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListEventRules") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListNotificationConfigurations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNotificationConfigurations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListNotificationConfigurations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListNotificationEvents(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNotificationEvents(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListNotificationEvents") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListNotificationHubs(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNotificationHubs(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListNotificationHubs") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_RegisterNotificationHub(t *testing.T) { + svc := New(Options{}) + _, err := svc.RegisterNotificationHub(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "RegisterNotificationHub") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateEventRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateEventRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateEventRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UpdateNotificationConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateNotificationConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateNotificationConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/notifications/types/enums.go b/service/notifications/types/enums.go new file mode 100644 index 00000000000..786faef5e7f --- /dev/null +++ b/service/notifications/types/enums.go @@ -0,0 +1,316 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type AggregationDuration string + +// Enum values for AggregationDuration +const ( + // Aggregate notifications for long periods of time (12 hours) + AggregationDurationLong AggregationDuration = "LONG" + // Aggregate notifications for short periods of time (5 mins) + AggregationDurationShort AggregationDuration = "SHORT" + // Do not aggregate notifications sourced from a notification configuration + AggregationDurationNone AggregationDuration = "NONE" +) + +// Values returns all known values for AggregationDuration. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AggregationDuration) Values() []AggregationDuration { + return []AggregationDuration{ + "LONG", + "SHORT", + "NONE", + } +} + +type AggregationEventType string + +// Enum values for AggregationEventType +const ( + AggregationEventTypeAggregate AggregationEventType = "AGGREGATE" + AggregationEventTypeChild AggregationEventType = "CHILD" + AggregationEventTypeNone AggregationEventType = "NONE" +) + +// Values returns all known values for AggregationEventType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (AggregationEventType) Values() []AggregationEventType { + return []AggregationEventType{ + "AGGREGATE", + "CHILD", + "NONE", + } +} + +type EventRuleStatus string + +// Enum values for EventRuleStatus +const ( + // EventRule is processing events. Any call can be executed. + EventRuleStatusActive EventRuleStatus = "ACTIVE" + // EventRule is in a bad state and may not be processing events. Any call can be + // executed. + EventRuleStatusInactive EventRuleStatus = "INACTIVE" + // This EventRule is being created. Only GET/LIST calls can be executed. + EventRuleStatusCreating EventRuleStatus = "CREATING" + // This EventRule is being updated. Only GET/LIST calls can be executed. + EventRuleStatusUpdating EventRuleStatus = "UPDATING" + // This EventRule is being deleted. Only GET/LIST calls can be executed. + EventRuleStatusDeleting EventRuleStatus = "DELETING" +) + +// Values returns all known values for EventRuleStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (EventRuleStatus) Values() []EventRuleStatus { + return []EventRuleStatus{ + "ACTIVE", + "INACTIVE", + "CREATING", + "UPDATING", + "DELETING", + } +} + +type EventStatus string + +// Enum values for EventStatus +const ( + EventStatusHealthy EventStatus = "HEALTHY" + EventStatusUnhealthy EventStatus = "UNHEALTHY" +) + +// Values returns all known values for EventStatus. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (EventStatus) Values() []EventStatus { + return []EventStatus{ + "HEALTHY", + "UNHEALTHY", + } +} + +type LocaleCode string + +// Enum values for LocaleCode +const ( + // German (Germany) + LocaleCodeDeDe LocaleCode = "de_DE" + // English (Canada) + LocaleCodeEnCa LocaleCode = "en_CA" + // English (United States). This is the default locale. + LocaleCodeEnUs LocaleCode = "en_US" + // English (United Kingdom) + LocaleCodeEnUk LocaleCode = "en_UK" + // Spanish (Spain) + LocaleCodeEsEs LocaleCode = "es_ES" + // French (Canada) + LocaleCodeFrCa LocaleCode = "fr_CA" + // French (France) + LocaleCodeFrFr LocaleCode = "fr_FR" + // Bahasa Indonesian (Indonesia) + LocaleCodeIdId LocaleCode = "id_ID" + // Italian (Italy) + LocaleCodeItIt LocaleCode = "it_IT" + // Japanese (Japan) + LocaleCodeJaJp LocaleCode = "ja_JP" + // Korean (Korea) + LocaleCodeKoKr LocaleCode = "ko_KR" + // Portuguese (Brazil) + LocaleCodePtBr LocaleCode = "pt_BR" + // Turkish (Turkey) + LocaleCodeTrTr LocaleCode = "tr_TR" + // Chinese (China) + LocaleCodeZhCn LocaleCode = "zh_CN" + // Chinese (Taiwan) + LocaleCodeZhTw LocaleCode = "zh_TW" +) + +// Values returns all known values for LocaleCode. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (LocaleCode) Values() []LocaleCode { + return []LocaleCode{ + "de_DE", + "en_CA", + "en_US", + "en_UK", + "es_ES", + "fr_CA", + "fr_FR", + "id_ID", + "it_IT", + "ja_JP", + "ko_KR", + "pt_BR", + "tr_TR", + "zh_CN", + "zh_TW", + } +} + +type MediaElementType string + +// Enum values for MediaElementType +const ( + MediaElementTypeImage MediaElementType = "IMAGE" +) + +// Values returns all known values for MediaElementType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (MediaElementType) Values() []MediaElementType { + return []MediaElementType{ + "IMAGE", + } +} + +type NotificationConfigurationStatus string + +// Enum values for NotificationConfigurationStatus +const ( + // All of the EventRules are in ACTIVE Status. Any call can be executed. + NotificationConfigurationStatusActive NotificationConfigurationStatus = "ACTIVE" + // Some EventRules are in ACTIVE Status and some are INACTIVE. Any call can be + // executed. + NotificationConfigurationStatusPartiallyActive NotificationConfigurationStatus = "PARTIALLY_ACTIVE" + // All of the EventRules are in INACTIVE Status. Any call can be executed. + NotificationConfigurationStatusInactive NotificationConfigurationStatus = "INACTIVE" + // This NotificationConfiguration is being deleted. Only GET/LIST calls can be + // executed. + NotificationConfigurationStatusDeleting NotificationConfigurationStatus = "DELETING" +) + +// Values returns all known values for NotificationConfigurationStatus. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NotificationConfigurationStatus) Values() []NotificationConfigurationStatus { + return []NotificationConfigurationStatus{ + "ACTIVE", + "PARTIALLY_ACTIVE", + "INACTIVE", + "DELETING", + } +} + +type NotificationHubStatus string + +// Enum values for NotificationHubStatus +const ( + // Incoming Notification Events are being replicated to this Notification Hub. A + // Notification Hub with this status can be deregistered. + NotificationHubStatusActive NotificationHubStatus = "ACTIVE" + // Notification Hub is initializing. Cannot deregister a Notification Hub in this + // status. + NotificationHubStatusRegistering NotificationHubStatus = "REGISTERING" + // Notification Hub is being deleted. Cannot register a Notification Hub in the + // same region as one in this status. + NotificationHubStatusDeregistering NotificationHubStatus = "DEREGISTERING" + // Notification Hub is in a failure state. Incoming Notification Events are not + // being replicated to this Hub. + NotificationHubStatusInactive NotificationHubStatus = "INACTIVE" +) + +// Values returns all known values for NotificationHubStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NotificationHubStatus) Values() []NotificationHubStatus { + return []NotificationHubStatus{ + "ACTIVE", + "REGISTERING", + "DEREGISTERING", + "INACTIVE", + } +} + +type NotificationType string + +// Enum values for NotificationType +const ( + NotificationTypeAlert NotificationType = "ALERT" + NotificationTypeWarning NotificationType = "WARNING" + NotificationTypeAnnouncement NotificationType = "ANNOUNCEMENT" + NotificationTypeInformational NotificationType = "INFORMATIONAL" +) + +// Values returns all known values for NotificationType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NotificationType) Values() []NotificationType { + return []NotificationType{ + "ALERT", + "WARNING", + "ANNOUNCEMENT", + "INFORMATIONAL", + } +} + +type SchemaVersion string + +// Enum values for SchemaVersion +const ( + SchemaVersionSchemaVersion10 SchemaVersion = "v1.0" +) + +// Values returns all known values for SchemaVersion. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (SchemaVersion) Values() []SchemaVersion { + return []SchemaVersion{ + "v1.0", + } +} + +type TextPartType string + +// Enum values for TextPartType +const ( + TextPartTypeLocalizedText TextPartType = "LOCALIZED_TEXT" + TextPartTypePlainText TextPartType = "PLAIN_TEXT" + TextPartTypeUrl TextPartType = "URL" +) + +// Values returns all known values for TextPartType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TextPartType) Values() []TextPartType { + return []TextPartType{ + "LOCALIZED_TEXT", + "PLAIN_TEXT", + "URL", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" + ValidationExceptionReasonOther ValidationExceptionReason = "other" +) + +// Values returns all known values for ValidationExceptionReason. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "fieldValidationFailed", + "other", + } +} diff --git a/service/notifications/types/errors.go b/service/notifications/types/errors.go new file mode 100644 index 00000000000..64518652521 --- /dev/null +++ b/service/notifications/types/errors.go @@ -0,0 +1,206 @@ +// 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 + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Updating or deleting a resource can cause an inconsistent state. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Unexpected error during processing of request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Request references a resource which does not exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Request would cause a service quota to be exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + ResourceType *string + ResourceId *string + ServiceCode *string + QuotaCode *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + ServiceCode *string + QuotaCode *string + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// This exception is thrown when the notification event fails validation. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/notifications/types/types.go b/service/notifications/types/types.go new file mode 100644 index 00000000000..b5f9fdf652c --- /dev/null +++ b/service/notifications/types/types.go @@ -0,0 +1,716 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// The key-value pair of properties for an event. +type Dimension struct { + + // The name of the dimension + // + // This member is required. + Name *string + + // The value of the dimension. + // + // This member is required. + Value *string + + noSmithyDocumentSerde +} + +// Describes EventRule status information. +type EventRuleStatusSummary struct { + + // A human-readable reason for EventRuleStatus. + // + // This member is required. + Reason *string + + // The status of the EventRule. + // + // - Values: + // + // - ACTIVE + // + // - The EventRule can process events. + // + // - INACTIVE + // + // - The EventRule may be unable to process events. + // + // - CREATING + // + // - The EventRule is being created. + // + // Only GET and LIST calls can be run. + // + // - UPDATING + // + // - The EventRule is being updated. + // + // Only GET and LIST calls can be run. + // + // - DELETING + // + // - The EventRule is being deleted. + // + // Only GET and LIST calls can be run. + // + // This member is required. + Status EventRuleStatus + + noSmithyDocumentSerde +} + +// Contains a complete list of fields related to an EventRule. +type EventRuleStructure struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + Arn *string + + // The creation time of the resource. + // + // This member is required. + CreationTime *time.Time + + // An additional event pattern used to further filter the events this EventRule + // receives. + // + // For more information, see [Amazon EventBridge event patterns] in the Amazon EventBridge User Guide. + // + // [Amazon EventBridge event patterns]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-event-patterns.html + // + // This member is required. + EventPattern *string + + // The event type to match. + // + // Must match one of the valid Amazon EventBridge event types. For example, EC2 + // Instance State-change Notification and AWS CloudWatch Alarm State Change. For + // more information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + // + // This member is required. + EventType *string + + // A list of Amazon EventBridge Managed Rule ARNs associated with this EventRule. + // + // These are created by AWS User Notifications within your account so your + // EventRules can function. + // + // This member is required. + ManagedRules []string + + // The ARN for the NotificationConfiguration associated with this EventRule. + // + // This member is required. + NotificationConfigurationArn *string + + // A list of AWS Regions that send events to this EventRule. + // + // This member is required. + Regions []string + + // The matched event source. + // + // Must match one of the valid EventBridge sources. Only AWS service sourced + // events are supported. For example, aws.ec2 and aws.cloudwatch . For more + // information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + // + // This member is required. + Source *string + + // A list of an EventRule's status by Region. Regions are mapped to + // EventRuleStatusSummary. + // + // This member is required. + StatusSummaryByRegion map[string]EventRuleStatusSummary + + noSmithyDocumentSerde +} + +// Describes a media element. +type MediaElement struct { + + // The caption of the media. + // + // This member is required. + Caption *string + + // The unique ID for the media. + // + // This member is required. + MediaId *string + + // The type of media. + // + // This member is required. + Type MediaElementType + + // The url of the media. + // + // This member is required. + Url *string + + noSmithyDocumentSerde +} + +// Describes the components of a notification message. +type MessageComponents struct { + + // A complete summary with all possible relevant information. + CompleteDescription *string + + // A list of properties in key-value pairs. Pairs are shown in order of importance + // from most important to least important. Channels may limit the number of + // dimensions shown to the notification viewer. + // + // Included dimensions, keys, and values are subject to change. + Dimensions []Dimension + + // A sentence long summary. For example, titles or an email subject line. + Headline *string + + // A paragraph long or multiple sentence summary. For example, AWS Chatbot + // notifications. + ParagraphSummary *string + + noSmithyDocumentSerde +} + +// Contains the headline message component. +type MessageComponentsSummary struct { + + // A sentence long summary. For example, titles or an email subject line. + // + // This member is required. + Headline *string + + noSmithyDocumentSerde +} + +// Contains the complete list of fields for a NotificationConfiguration. +type NotificationConfigurationStructure struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + Arn *string + + // The creation time of the resource. + // + // This member is required. + CreationTime *time.Time + + // The description of the NotificationConfiguration. + // + // This member is required. + Description *string + + // The name of the NotificationConfiguration. Supports RFC 3986's unreserved + // characters. + // + // This member is required. + Name *string + + // The status of this NotificationConfiguration. + // + // The status should always be INACTIVE when part of the + // CreateNotificationConfiguration response. + // + // - Values: + // + // - ACTIVE + // + // - All EventRules are ACTIVE and any call can be run. + // + // - PARTIALLY_ACTIVE + // + // - Some EventRules are ACTIVE and some are INACTIVE . + // + // - Any call can be run. + // + // - INACTIVE + // + // - All EventRules are INACTIVE and any call can be run. + // + // - DELETING + // + // - This NotificationConfiguration is being deleted. Only GET and LIST calls can + // be run. + // + // - Only GET and LIST calls can be run. + // + // This member is required. + Status NotificationConfigurationStatus + + // The aggregation preference of the NotificationConfiguration. + // + // - Values: + // + // - LONG + // + // - Aggregate notifications for long periods of time (12 hours). + // + // - SHORT + // + // - Aggregate notifications for short periods of time (5 minutes). + // + // - NONE + // + // - Don't aggregate notifications. + // + // No delay in delivery. + AggregationDuration AggregationDuration + + noSmithyDocumentSerde +} + +// Describes a short summary of a NotificationEvent. This is only used when +// listing notification events. +type NotificationEventOverview struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + Arn *string + + // The creation time of the NotificationEvent. + // + // This member is required. + CreationTime *time.Time + + // The ARN of the NotificationConfiguration. + // + // This member is required. + NotificationConfigurationArn *string + + // Refers to a NotificationEventSummary object. + // + // Similar in structure to content in the GetNotificationEvent response. + // + // This member is required. + NotificationEvent *NotificationEventSummary + + // The account name containing the NotificationHub. + // + // This member is required. + RelatedAccount *string + + // The ARN of the aggregatedNotificationEventArn to match. + AggregateNotificationEventArn *string + + // The NotificationConfiguration's aggregation type. + // + // - Values: + // + // - AGGREGATE + // + // - The notification event is an aggregate notification. Aggregate + // notifications summarize grouped events over a specified time period. + // + // - CHILD + // + // - Some EventRules are ACTIVE and some are INACTIVE . Any call can be run. + // + // - NONE + // + // - The notification isn't aggregated. + AggregationEventType AggregationEventType + + noSmithyDocumentSerde +} + +// A NotificationEvent is a notification-focused representation of an event. They +// contain semantic information used by Channels to create end-user notifications. +type NotificationEventSchema struct { + + // The unique identifier for a NotificationEvent. + // + // This member is required. + Id *string + + // A list of media elements. + // + // This member is required. + Media []MediaElement + + // Describes the components of a notification message. + // + // This member is required. + MessageComponents *MessageComponents + + // The type of event causing the notification. + // + // - Values: + // + // - ALERT + // + // - A notification about an event where something was triggered, initiated, + // reopened, deployed, or a threshold was breached. + // + // - WARNING + // + // - A notification about an event where an issue is about to arise. For + // example, something is approaching a threshold. + // + // - ANNOUNCEMENT + // + // - A notification about an important event. For example, a step in a workflow + // or escalation path or that a workflow was updated. + // + // - INFORMATIONAL + // + // - A notification about informational messages. For example, recommendations, + // service announcements, or reminders. + // + // This member is required. + NotificationType NotificationType + + // The schema version of the Notification Event. + // + // This member is required. + SchemaVersion SchemaVersion + + // The source event metadata. + // + // This member is required. + SourceEventMetadata *SourceEventMetadata + + // A list of text values. + // + // This member is required. + TextParts map[string]TextPartValue + + // If the value of aggregationEventType is not NONE , this is the Amazon Resource + // Event (ARN) of the parent aggregate notification. + // + // This is omitted if notification isn't aggregated. + AggregateNotificationEventArn *string + + // The NotificationConfiguration's aggregation type. + // + // - Values: + // + // - AGGREGATE + // + // - The notification event is an aggregate notification. Aggregate + // notifications summarize grouped events over a specified time period. + // + // - CHILD + // + // - Some EventRules are ACTIVE and some are INACTIVE . Any call can be run. + // + // - NONE + // + // - The notification isn't aggregated. + AggregationEventType AggregationEventType + + // The end time of the event. + EndTime *time.Time + + // The assesed nature of the event. + // + // - Values: + // + // - HEALTHY + // + // - All EventRules are ACTIVE and any call can be run. + // + // - UNHEALTHY + // + // - Some EventRules are ACTIVE and some are INACTIVE . Any call can be run. + EventStatus EventStatus + + // The source event URL. + SourceEventDetailUrl *string + + // The detailed URL for the source event. + SourceEventDetailUrlDisplayText *string + + // The notification event start time. + StartTime *time.Time + + noSmithyDocumentSerde +} + +// Describes a short summary and metadata for a notification event. +type NotificationEventSummary struct { + + // The notification event status. + // + // - Values: + // + // - HEALTHY + // + // - All EventRules are ACTIVE and any call can be run. + // + // - UNHEALTHY + // + // - Some EventRules are ACTIVE and some are INACTIVE . Any call can be run. + // + // This member is required. + EventStatus EventStatus + + // The message components of a notification event. + // + // This member is required. + MessageComponents *MessageComponentsSummary + + // The type of event causing the notification. + // + // - Values: + // + // - ALERT + // + // - A notification about an event where something was triggered, initiated, + // reopened, deployed, or a threshold was breached. + // + // - WARNING + // + // - A notification about an event where an issue is about to arise. For + // example, something is approaching a threshold. + // + // - ANNOUNCEMENT + // + // - A notification about an important event. For example, a step in a workflow + // or escalation path or that a workflow was updated. + // + // - INFORMATIONAL + // + // - A notification about informational messages. For example, recommendations, + // service announcements, or reminders. + // + // This member is required. + NotificationType NotificationType + + // The schema version of the Notification Event. + // + // This member is required. + SchemaVersion SchemaVersion + + // The source event metadata. + // + // This member is required. + SourceEventMetadata *SourceEventMetadataSummary + + noSmithyDocumentSerde +} + +// Describes an overview of a NotificationHub. +// +// A NotificationHub is an account-level setting used to select the Regions where +// you want to store, process and replicate your notifications. +type NotificationHubOverview struct { + + // The date and time the resource was created. + // + // This member is required. + CreationTime *time.Time + + // The Region of the resource. + // + // This member is required. + NotificationHubRegion *string + + // The status summary of the resource. + // + // This member is required. + StatusSummary *NotificationHubStatusSummary + + // The most recent time this NotificationHub had an ACTIVE status. + LastActivationTime *time.Time + + noSmithyDocumentSerde +} + +// NotificationHub status information. +type NotificationHubStatusSummary struct { + + // An Explanation for the current status. + // + // This member is required. + Reason *string + + // Status information about the NotificationHub. + // + // - Values: + // + // - ACTIVE + // + // - Incoming NotificationEvents are replicated to this NotificationHub. + // + // - REGISTERING + // + // - The NotificationHub is initializing. A NotificationHub with this status + // can't be deregistered. + // + // - DEREGISTERING + // + // - The NotificationHub is being deleted. You can't register additional + // NotificationHubs in the same Region as a NotificationHub with this status. + // + // This member is required. + Status NotificationHubStatus + + noSmithyDocumentSerde +} + +// A resource affected by or closely linked to an event. +type Resource struct { + + // The Amazon Resource Name (ARN) of the resource. At least one id or ARN is + // required. + Arn *string + + // The URL to the resource's detail page. If a detail page URL is unavailable, it + // is the URL to an informational page that describes the resource's type. + DetailUrl *string + + // The unique identifier for the resource. + // + // At least one id or ARN is required. + Id *string + + // A map of tags assigned to a resource. A tag is a string-to-string map of + // key-value pairs. + Tags []string + + noSmithyDocumentSerde +} + +// Describes the metadata for a source event. +// +// For more information, see [Event structure reference] in the Amazon EventBridge User Guide. +// +// [Event structure reference]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-events-structure.html +type SourceEventMetadata struct { + + // The date and time the source event occurred. This is based on the Source Event. + // + // This member is required. + EventOccurrenceTime *time.Time + + // The type of event. For example, an AWS CloudWatch state change. + // + // This member is required. + EventType *string + + // The version of the type of event. + // + // This member is required. + EventTypeVersion *string + + // The Primary AWS account of Source Event + // + // This member is required. + RelatedAccount *string + + // A list of resources related to this NotificationEvent. + // + // This member is required. + RelatedResources []Resource + + // The AWS servvice the event originates from. For example aws.cloudwatch . + // + // This member is required. + Source *string + + // The source event id. + // + // This member is required. + SourceEventId *string + + // The Region the event originated from. + EventOriginRegion *string + + noSmithyDocumentSerde +} + +// Contains metadata about the event that caused the NotificationEvent. For other +// specific values, see sourceEventMetadata. +type SourceEventMetadataSummary struct { + + // The event type to match. + // + // Must match one of the valid Amazon EventBridge event types. For example, EC2 + // Instance State-change Notification and AWS CloudWatch Alarm State Change. For + // more information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + // + // This member is required. + EventType *string + + // The matched event source. + // + // Must match one of the valid EventBridge sources. Only AWS service sourced + // events are supported. For example, aws.ec2 and aws.cloudwatch . For more + // information, see [Event delivery from AWS services]in the Amazon EventBridge User Guide. + // + // [Event delivery from AWS services]: https://docs.aws.amazon.com/eventbridge/latest/userguide/eb-service-event.html#eb-service-event-delivery-level + // + // This member is required. + Source *string + + // The Region where the notification originated. + // + // Unavailable for aggregated notifications. + EventOriginRegion *string + + noSmithyDocumentSerde +} + +// Describes text information objects containing fields that determine how text +// part objects are composed. +type TextPartValue struct { + + // The type of text part. Determines the usage of all other fields and whether or + // not they're required. + // + // This member is required. + Type TextPartType + + // A short single line description of the link. Must be hyperlinked with the URL + // itself. + // + // Used for text parts with the type URL . + DisplayText *string + + // A map of locales to the text in that locale. + TextByLocale map[string]string + + // The URL itself. + Url *string + + noSmithyDocumentSerde +} + +// Stores information about a field passed inside a request that resulted in an +// exception. +type ValidationExceptionField struct { + + // A message with the reason for the validation exception error. + // + // This member is required. + Message *string + + // The field name where the invalid entry was detected. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/notifications/validators.go b/service/notifications/validators.go new file mode 100644 index 00000000000..334b6946acc --- /dev/null +++ b/service/notifications/validators.go @@ -0,0 +1,736 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notifications + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpAssociateChannel struct { +} + +func (*validateOpAssociateChannel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpAssociateChannel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*AssociateChannelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpAssociateChannelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateEventRule struct { +} + +func (*validateOpCreateEventRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateEventRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateEventRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateEventRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateNotificationConfiguration struct { +} + +func (*validateOpCreateNotificationConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateNotificationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateNotificationConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateNotificationConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteEventRule struct { +} + +func (*validateOpDeleteEventRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteEventRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteEventRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteEventRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteNotificationConfiguration struct { +} + +func (*validateOpDeleteNotificationConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteNotificationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteNotificationConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteNotificationConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeregisterNotificationHub struct { +} + +func (*validateOpDeregisterNotificationHub) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeregisterNotificationHub) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeregisterNotificationHubInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeregisterNotificationHubInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDisassociateChannel struct { +} + +func (*validateOpDisassociateChannel) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDisassociateChannel) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DisassociateChannelInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDisassociateChannelInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetEventRule struct { +} + +func (*validateOpGetEventRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetEventRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetEventRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetEventRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetNotificationConfiguration struct { +} + +func (*validateOpGetNotificationConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetNotificationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetNotificationConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetNotificationConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetNotificationEvent struct { +} + +func (*validateOpGetNotificationEvent) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetNotificationEvent) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetNotificationEventInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetNotificationEventInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListChannels struct { +} + +func (*validateOpListChannels) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListChannels) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListChannelsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListChannelsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListEventRules struct { +} + +func (*validateOpListEventRules) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListEventRules) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListEventRulesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListEventRulesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpRegisterNotificationHub struct { +} + +func (*validateOpRegisterNotificationHub) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpRegisterNotificationHub) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*RegisterNotificationHubInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpRegisterNotificationHubInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateEventRule struct { +} + +func (*validateOpUpdateEventRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateEventRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateEventRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateEventRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUpdateNotificationConfiguration struct { +} + +func (*validateOpUpdateNotificationConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateNotificationConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateNotificationConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateNotificationConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpAssociateChannelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpAssociateChannel{}, middleware.After) +} + +func addOpCreateEventRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateEventRule{}, middleware.After) +} + +func addOpCreateNotificationConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateNotificationConfiguration{}, middleware.After) +} + +func addOpDeleteEventRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteEventRule{}, middleware.After) +} + +func addOpDeleteNotificationConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteNotificationConfiguration{}, middleware.After) +} + +func addOpDeregisterNotificationHubValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeregisterNotificationHub{}, middleware.After) +} + +func addOpDisassociateChannelValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDisassociateChannel{}, middleware.After) +} + +func addOpGetEventRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetEventRule{}, middleware.After) +} + +func addOpGetNotificationConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetNotificationConfiguration{}, middleware.After) +} + +func addOpGetNotificationEventValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetNotificationEvent{}, middleware.After) +} + +func addOpListChannelsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListChannels{}, middleware.After) +} + +func addOpListEventRulesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListEventRules{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpRegisterNotificationHubValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpRegisterNotificationHub{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func addOpUpdateEventRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateEventRule{}, middleware.After) +} + +func addOpUpdateNotificationConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateNotificationConfiguration{}, middleware.After) +} + +func validateOpAssociateChannelInput(v *AssociateChannelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AssociateChannelInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.NotificationConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationConfigurationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateEventRuleInput(v *CreateEventRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateEventRuleInput"} + if v.NotificationConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationConfigurationArn")) + } + if v.Source == nil { + invalidParams.Add(smithy.NewErrParamRequired("Source")) + } + if v.EventType == nil { + invalidParams.Add(smithy.NewErrParamRequired("EventType")) + } + if v.Regions == nil { + invalidParams.Add(smithy.NewErrParamRequired("Regions")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateNotificationConfigurationInput(v *CreateNotificationConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateNotificationConfigurationInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Description == nil { + invalidParams.Add(smithy.NewErrParamRequired("Description")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteEventRuleInput(v *DeleteEventRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteEventRuleInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteNotificationConfigurationInput(v *DeleteNotificationConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteNotificationConfigurationInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeregisterNotificationHubInput(v *DeregisterNotificationHubInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeregisterNotificationHubInput"} + if v.NotificationHubRegion == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationHubRegion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDisassociateChannelInput(v *DisassociateChannelInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DisassociateChannelInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.NotificationConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationConfigurationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetEventRuleInput(v *GetEventRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetEventRuleInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetNotificationConfigurationInput(v *GetNotificationConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetNotificationConfigurationInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetNotificationEventInput(v *GetNotificationEventInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetNotificationEventInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListChannelsInput(v *ListChannelsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListChannelsInput"} + if v.NotificationConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationConfigurationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListEventRulesInput(v *ListEventRulesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListEventRulesInput"} + if v.NotificationConfigurationArn == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationConfigurationArn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpRegisterNotificationHubInput(v *RegisterNotificationHubInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "RegisterNotificationHubInput"} + if v.NotificationHubRegion == nil { + invalidParams.Add(smithy.NewErrParamRequired("NotificationHubRegion")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateEventRuleInput(v *UpdateEventRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateEventRuleInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUpdateNotificationConfigurationInput(v *UpdateNotificationConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateNotificationConfigurationInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/notificationscontacts/LICENSE.txt b/service/notificationscontacts/LICENSE.txt new file mode 100644 index 00000000000..d6456956733 --- /dev/null +++ b/service/notificationscontacts/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/notificationscontacts/api_client.go b/service/notificationscontacts/api_client.go new file mode 100644 index 00000000000..c1cc9e28a56 --- /dev/null +++ b/service/notificationscontacts/api_client.go @@ -0,0 +1,913 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/aws-sdk-go-v2/aws/defaults" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/aws/retry" + "github.com/aws/aws-sdk-go-v2/aws/signer/v4" + awshttp "github.com/aws/aws-sdk-go-v2/aws/transport/http" + internalauth "github.com/aws/aws-sdk-go-v2/internal/auth" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + internalmiddleware "github.com/aws/aws-sdk-go-v2/internal/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithydocument "github.com/aws/smithy-go/document" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net" + "net/http" + "sync/atomic" + "time" +) + +const ServiceID = "NotificationsContacts" +const ServiceAPIVersion = "2018-05-10" + +type operationMetrics struct { + Duration metrics.Float64Histogram + SerializeDuration metrics.Float64Histogram + ResolveIdentityDuration metrics.Float64Histogram + ResolveEndpointDuration metrics.Float64Histogram + SignRequestDuration metrics.Float64Histogram + DeserializeDuration metrics.Float64Histogram +} + +func (m *operationMetrics) histogramFor(name string) metrics.Float64Histogram { + switch name { + case "client.call.duration": + return m.Duration + case "client.call.serialization_duration": + return m.SerializeDuration + case "client.call.resolve_identity_duration": + return m.ResolveIdentityDuration + case "client.call.resolve_endpoint_duration": + return m.ResolveEndpointDuration + case "client.call.signing_duration": + return m.SignRequestDuration + case "client.call.deserialization_duration": + return m.DeserializeDuration + default: + panic("unrecognized operation metric") + } +} + +func timeOperationMetric[T any]( + ctx context.Context, metric string, fn func() (T, error), + opts ...metrics.RecordMetricOption, +) (T, error) { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + start := time.Now() + v, err := fn() + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + return v, err +} + +func startMetricTimer(ctx context.Context, metric string, opts ...metrics.RecordMetricOption) func() { + instr := getOperationMetrics(ctx).histogramFor(metric) + opts = append([]metrics.RecordMetricOption{withOperationMetadata(ctx)}, opts...) + + var ended bool + start := time.Now() + return func() { + if ended { + return + } + ended = true + + end := time.Now() + + elapsed := end.Sub(start) + instr.Record(ctx, float64(elapsed)/1e9, opts...) + } +} + +func withOperationMetadata(ctx context.Context) metrics.RecordMetricOption { + return func(o *metrics.RecordMetricOptions) { + o.Properties.Set("rpc.service", middleware.GetServiceID(ctx)) + o.Properties.Set("rpc.method", middleware.GetOperationName(ctx)) + } +} + +type operationMetricsKey struct{} + +func withOperationMetrics(parent context.Context, mp metrics.MeterProvider) (context.Context, error) { + meter := mp.Meter("github.com/aws/aws-sdk-go-v2/service/notificationscontacts") + om := &operationMetrics{} + + var err error + + om.Duration, err = operationMetricTimer(meter, "client.call.duration", + "Overall call duration (including retries and time to send or receive request and response body)") + if err != nil { + return nil, err + } + om.SerializeDuration, err = operationMetricTimer(meter, "client.call.serialization_duration", + "The time it takes to serialize a message body") + if err != nil { + return nil, err + } + om.ResolveIdentityDuration, err = operationMetricTimer(meter, "client.call.auth.resolve_identity_duration", + "The time taken to acquire an identity (AWS credentials, bearer token, etc) from an Identity Provider") + if err != nil { + return nil, err + } + om.ResolveEndpointDuration, err = operationMetricTimer(meter, "client.call.resolve_endpoint_duration", + "The time it takes to resolve an endpoint (endpoint resolver, not DNS) for the request") + if err != nil { + return nil, err + } + om.SignRequestDuration, err = operationMetricTimer(meter, "client.call.auth.signing_duration", + "The time it takes to sign a request") + if err != nil { + return nil, err + } + om.DeserializeDuration, err = operationMetricTimer(meter, "client.call.deserialization_duration", + "The time it takes to deserialize a message body") + if err != nil { + return nil, err + } + + return context.WithValue(parent, operationMetricsKey{}, om), nil +} + +func operationMetricTimer(m metrics.Meter, name, desc string) (metrics.Float64Histogram, error) { + return m.Float64Histogram(name, func(o *metrics.InstrumentOptions) { + o.UnitLabel = "s" + o.Description = desc + }) +} + +func getOperationMetrics(ctx context.Context) *operationMetrics { + return ctx.Value(operationMetricsKey{}).(*operationMetrics) +} + +func operationTracer(p tracing.TracerProvider) tracing.Tracer { + return p.Tracer("github.com/aws/aws-sdk-go-v2/service/notificationscontacts") +} + +// Client provides the API client to make operations call for AWS User +// Notifications Contacts. +type Client struct { + options Options + + // Difference between the time reported by the server and the client + timeOffset *atomic.Int64 +} + +// New returns an initialized Client based on the functional options. Provide +// additional functional options to further configure the behavior of the client, +// such as changing the client's endpoint or adding custom middleware behavior. +func New(options Options, optFns ...func(*Options)) *Client { + options = options.Copy() + + resolveDefaultLogger(&options) + + setResolvedDefaultsMode(&options) + + resolveRetryer(&options) + + resolveHTTPClient(&options) + + resolveHTTPSignerV4(&options) + + resolveEndpointResolverV2(&options) + + resolveTracerProvider(&options) + + resolveMeterProvider(&options) + + resolveAuthSchemeResolver(&options) + + for _, fn := range optFns { + fn(&options) + } + + finalizeRetryMaxAttempts(&options) + + ignoreAnonymousAuth(&options) + + wrapWithAnonymousAuth(&options) + + resolveAuthSchemes(&options) + + client := &Client{ + options: options, + } + + initializeTimeOffsetResolver(client) + + return client +} + +// Options returns a copy of the client configuration. +// +// Callers SHOULD NOT perform mutations on any inner structures within client +// config. Config overrides should instead be made on a per-operation basis through +// functional options. +func (c *Client) Options() Options { + return c.options.Copy() +} + +func (c *Client) invokeOperation( + ctx context.Context, opID string, params interface{}, optFns []func(*Options), stackFns ...func(*middleware.Stack, Options) error, +) ( + result interface{}, metadata middleware.Metadata, err error, +) { + ctx = middleware.ClearStackValues(ctx) + ctx = middleware.WithServiceID(ctx, ServiceID) + ctx = middleware.WithOperationName(ctx, opID) + + stack := middleware.NewStack(opID, smithyhttp.NewStackRequest) + options := c.options.Copy() + + for _, fn := range optFns { + fn(&options) + } + + finalizeOperationRetryMaxAttempts(&options, *c) + + finalizeClientEndpointResolverOptions(&options) + + for _, fn := range stackFns { + if err := fn(stack, options); err != nil { + return nil, metadata, err + } + } + + for _, fn := range options.APIOptions { + if err := fn(stack); err != nil { + return nil, metadata, err + } + } + + ctx, err = withOperationMetrics(ctx, options.MeterProvider) + if err != nil { + return nil, metadata, err + } + + tracer := operationTracer(options.TracerProvider) + spanName := fmt.Sprintf("%s.%s", ServiceID, opID) + + ctx = tracing.WithOperationTracer(ctx, tracer) + + ctx, span := tracer.StartSpan(ctx, spanName, func(o *tracing.SpanOptions) { + o.Kind = tracing.SpanKindClient + o.Properties.Set("rpc.system", "aws-api") + o.Properties.Set("rpc.method", opID) + o.Properties.Set("rpc.service", ServiceID) + }) + endTimer := startMetricTimer(ctx, "client.call.duration") + defer endTimer() + defer span.End() + + handler := smithyhttp.NewClientHandlerWithOptions(options.HTTPClient, func(o *smithyhttp.ClientHandler) { + o.Meter = options.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/notificationscontacts") + }) + decorated := middleware.DecorateHandler(handler, stack) + result, metadata, err = decorated.Handle(ctx, params) + if err != nil { + span.SetProperty("exception.type", fmt.Sprintf("%T", err)) + span.SetProperty("exception.message", err.Error()) + + var aerr smithy.APIError + if errors.As(err, &aerr) { + span.SetProperty("api.error_code", aerr.ErrorCode()) + span.SetProperty("api.error_message", aerr.ErrorMessage()) + span.SetProperty("api.error_fault", aerr.ErrorFault().String()) + } + + err = &smithy.OperationError{ + ServiceID: ServiceID, + OperationName: opID, + Err: err, + } + } + + span.SetProperty("error", err != nil) + if err == nil { + span.SetStatus(tracing.SpanStatusOK) + } else { + span.SetStatus(tracing.SpanStatusError) + } + + return result, metadata, err +} + +type operationInputKey struct{} + +func setOperationInput(ctx context.Context, input interface{}) context.Context { + return middleware.WithStackValue(ctx, operationInputKey{}, input) +} + +func getOperationInput(ctx context.Context) interface{} { + return middleware.GetStackValue(ctx, operationInputKey{}) +} + +type setOperationInputMiddleware struct { +} + +func (*setOperationInputMiddleware) ID() string { + return "setOperationInput" +} + +func (m *setOperationInputMiddleware) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + ctx = setOperationInput(ctx, in.Parameters) + return next.HandleSerialize(ctx, in) +} + +func addProtocolFinalizerMiddlewares(stack *middleware.Stack, options Options, operation string) error { + if err := stack.Finalize.Add(&resolveAuthSchemeMiddleware{operation: operation, options: options}, middleware.Before); err != nil { + return fmt.Errorf("add ResolveAuthScheme: %w", err) + } + if err := stack.Finalize.Insert(&getIdentityMiddleware{options: options}, "ResolveAuthScheme", middleware.After); err != nil { + return fmt.Errorf("add GetIdentity: %v", err) + } + if err := stack.Finalize.Insert(&resolveEndpointV2Middleware{options: options}, "GetIdentity", middleware.After); err != nil { + return fmt.Errorf("add ResolveEndpointV2: %v", err) + } + if err := stack.Finalize.Insert(&signRequestMiddleware{options: options}, "ResolveEndpointV2", middleware.After); err != nil { + return fmt.Errorf("add Signing: %w", err) + } + return nil +} +func resolveAuthSchemeResolver(options *Options) { + if options.AuthSchemeResolver == nil { + options.AuthSchemeResolver = &defaultAuthSchemeResolver{} + } +} + +func resolveAuthSchemes(options *Options) { + if options.AuthSchemes == nil { + options.AuthSchemes = []smithyhttp.AuthScheme{ + internalauth.NewHTTPAuthScheme("aws.auth#sigv4", &internalauthsmithy.V4SignerAdapter{ + Signer: options.HTTPSignerV4, + Logger: options.Logger, + LogSigning: options.ClientLogMode.IsSigning(), + }), + } + } +} + +type noSmithyDocumentSerde = smithydocument.NoSerde + +type legacyEndpointContextSetter struct { + LegacyResolver EndpointResolver +} + +func (*legacyEndpointContextSetter) ID() string { + return "legacyEndpointContextSetter" +} + +func (m *legacyEndpointContextSetter) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + if m.LegacyResolver != nil { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, true) + } + + return next.HandleInitialize(ctx, in) + +} +func addlegacyEndpointContextSetter(stack *middleware.Stack, o Options) error { + return stack.Initialize.Add(&legacyEndpointContextSetter{ + LegacyResolver: o.EndpointResolver, + }, middleware.Before) +} + +func resolveDefaultLogger(o *Options) { + if o.Logger != nil { + return + } + o.Logger = logging.Nop{} +} + +func addSetLoggerMiddleware(stack *middleware.Stack, o Options) error { + return middleware.AddSetLoggerMiddleware(stack, o.Logger) +} + +func setResolvedDefaultsMode(o *Options) { + if len(o.resolvedDefaultsMode) > 0 { + return + } + + var mode aws.DefaultsMode + mode.SetFromString(string(o.DefaultsMode)) + + if mode == aws.DefaultsModeAuto { + mode = defaults.ResolveDefaultsModeAuto(o.Region, o.RuntimeEnvironment) + } + + o.resolvedDefaultsMode = mode +} + +// NewFromConfig returns a new client from the provided config. +func NewFromConfig(cfg aws.Config, optFns ...func(*Options)) *Client { + opts := Options{ + Region: cfg.Region, + DefaultsMode: cfg.DefaultsMode, + RuntimeEnvironment: cfg.RuntimeEnvironment, + HTTPClient: cfg.HTTPClient, + Credentials: cfg.Credentials, + APIOptions: cfg.APIOptions, + Logger: cfg.Logger, + ClientLogMode: cfg.ClientLogMode, + AppID: cfg.AppID, + } + resolveAWSRetryerProvider(cfg, &opts) + resolveAWSRetryMaxAttempts(cfg, &opts) + resolveAWSRetryMode(cfg, &opts) + resolveAWSEndpointResolver(cfg, &opts) + resolveUseDualStackEndpoint(cfg, &opts) + resolveUseFIPSEndpoint(cfg, &opts) + resolveBaseEndpoint(cfg, &opts) + return New(opts, optFns...) +} + +func resolveHTTPClient(o *Options) { + var buildable *awshttp.BuildableClient + + if o.HTTPClient != nil { + var ok bool + buildable, ok = o.HTTPClient.(*awshttp.BuildableClient) + if !ok { + return + } + } else { + buildable = awshttp.NewBuildableClient() + } + + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + buildable = buildable.WithDialerOptions(func(dialer *net.Dialer) { + if dialerTimeout, ok := modeConfig.GetConnectTimeout(); ok { + dialer.Timeout = dialerTimeout + } + }) + + buildable = buildable.WithTransportOptions(func(transport *http.Transport) { + if tlsHandshakeTimeout, ok := modeConfig.GetTLSNegotiationTimeout(); ok { + transport.TLSHandshakeTimeout = tlsHandshakeTimeout + } + }) + } + + o.HTTPClient = buildable +} + +func resolveRetryer(o *Options) { + if o.Retryer != nil { + return + } + + if len(o.RetryMode) == 0 { + modeConfig, err := defaults.GetModeConfiguration(o.resolvedDefaultsMode) + if err == nil { + o.RetryMode = modeConfig.RetryMode + } + } + if len(o.RetryMode) == 0 { + o.RetryMode = aws.RetryModeStandard + } + + var standardOptions []func(*retry.StandardOptions) + if v := o.RetryMaxAttempts; v != 0 { + standardOptions = append(standardOptions, func(so *retry.StandardOptions) { + so.MaxAttempts = v + }) + } + + switch o.RetryMode { + case aws.RetryModeAdaptive: + var adaptiveOptions []func(*retry.AdaptiveModeOptions) + if len(standardOptions) != 0 { + adaptiveOptions = append(adaptiveOptions, func(ao *retry.AdaptiveModeOptions) { + ao.StandardOptions = append(ao.StandardOptions, standardOptions...) + }) + } + o.Retryer = retry.NewAdaptiveMode(adaptiveOptions...) + + default: + o.Retryer = retry.NewStandard(standardOptions...) + } +} + +func resolveAWSRetryerProvider(cfg aws.Config, o *Options) { + if cfg.Retryer == nil { + return + } + o.Retryer = cfg.Retryer() +} + +func resolveAWSRetryMode(cfg aws.Config, o *Options) { + if len(cfg.RetryMode) == 0 { + return + } + o.RetryMode = cfg.RetryMode +} +func resolveAWSRetryMaxAttempts(cfg aws.Config, o *Options) { + if cfg.RetryMaxAttempts == 0 { + return + } + o.RetryMaxAttempts = cfg.RetryMaxAttempts +} + +func finalizeRetryMaxAttempts(o *Options) { + if o.RetryMaxAttempts == 0 { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func finalizeOperationRetryMaxAttempts(o *Options, client Client) { + if v := o.RetryMaxAttempts; v == 0 || v == client.options.RetryMaxAttempts { + return + } + + o.Retryer = retry.AddWithMaxAttempts(o.Retryer, o.RetryMaxAttempts) +} + +func resolveAWSEndpointResolver(cfg aws.Config, o *Options) { + if cfg.EndpointResolver == nil && cfg.EndpointResolverWithOptions == nil { + return + } + o.EndpointResolver = withEndpointResolver(cfg.EndpointResolver, cfg.EndpointResolverWithOptions) +} + +func addClientUserAgent(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddSDKAgentKeyValue(awsmiddleware.APIMetadata, "notificationscontacts", goModuleVersion) + if len(options.AppID) > 0 { + ua.AddSDKAgentKey(awsmiddleware.ApplicationIdentifier, options.AppID) + } + + return nil +} + +func getOrAddRequestUserAgent(stack *middleware.Stack) (*awsmiddleware.RequestUserAgent, error) { + id := (*awsmiddleware.RequestUserAgent)(nil).ID() + mw, ok := stack.Build.Get(id) + if !ok { + mw = awsmiddleware.NewRequestUserAgent() + if err := stack.Build.Add(mw, middleware.After); err != nil { + return nil, err + } + } + + ua, ok := mw.(*awsmiddleware.RequestUserAgent) + if !ok { + return nil, fmt.Errorf("%T for %s middleware did not match expected type", mw, id) + } + + return ua, nil +} + +type HTTPSignerV4 interface { + SignHTTP(ctx context.Context, credentials aws.Credentials, r *http.Request, payloadHash string, service string, region string, signingTime time.Time, optFns ...func(*v4.SignerOptions)) error +} + +func resolveHTTPSignerV4(o *Options) { + if o.HTTPSignerV4 != nil { + return + } + o.HTTPSignerV4 = newDefaultV4Signer(*o) +} + +func newDefaultV4Signer(o Options) *v4.Signer { + return v4.NewSigner(func(so *v4.SignerOptions) { + so.Logger = o.Logger + so.LogSigning = o.ClientLogMode.IsSigning() + }) +} + +func addClientRequestID(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.ClientRequestID{}, middleware.After) +} + +func addComputeContentLength(stack *middleware.Stack) error { + return stack.Build.Add(&smithyhttp.ComputeContentLength{}, middleware.After) +} + +func addRawResponseToMetadata(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.AddRawResponse{}, middleware.Before) +} + +func addRecordResponseTiming(stack *middleware.Stack) error { + return stack.Deserialize.Add(&awsmiddleware.RecordResponseTiming{}, middleware.After) +} + +func addSpanRetryLoop(stack *middleware.Stack, options Options) error { + return stack.Finalize.Insert(&spanRetryLoop{options: options}, "Retry", middleware.Before) +} + +type spanRetryLoop struct { + options Options +} + +func (*spanRetryLoop) ID() string { + return "spanRetryLoop" +} + +func (m *spanRetryLoop) HandleFinalize( + ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler, +) ( + middleware.FinalizeOutput, middleware.Metadata, error, +) { + tracer := operationTracer(m.options.TracerProvider) + ctx, span := tracer.StartSpan(ctx, "RetryLoop") + defer span.End() + + return next.HandleFinalize(ctx, in) +} +func addStreamingEventsPayload(stack *middleware.Stack) error { + return stack.Finalize.Add(&v4.StreamingEventsPayload{}, middleware.Before) +} + +func addUnsignedPayload(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.UnsignedPayload{}, "ResolveEndpointV2", middleware.After) +} + +func addComputePayloadSHA256(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ComputePayloadSHA256{}, "ResolveEndpointV2", middleware.After) +} + +func addContentSHA256Header(stack *middleware.Stack) error { + return stack.Finalize.Insert(&v4.ContentSHA256Header{}, (*v4.ComputePayloadSHA256)(nil).ID(), middleware.After) +} + +func addIsWaiterUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureWaiter) + return nil + }) +} + +func addIsPaginatorUserAgent(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeaturePaginator) + return nil + }) +} + +func addRetry(stack *middleware.Stack, o Options) error { + attempt := retry.NewAttemptMiddleware(o.Retryer, smithyhttp.RequestCloner, func(m *retry.Attempt) { + m.LogAttempts = o.ClientLogMode.IsRetries() + m.OperationMeter = o.MeterProvider.Meter("github.com/aws/aws-sdk-go-v2/service/notificationscontacts") + }) + if err := stack.Finalize.Insert(attempt, "Signing", middleware.Before); err != nil { + return err + } + if err := stack.Finalize.Insert(&retry.MetricsHeader{}, attempt.ID(), middleware.After); err != nil { + return err + } + return nil +} + +// resolves dual-stack endpoint configuration +func resolveUseDualStackEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseDualStackEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseDualStackEndpoint = value + } + return nil +} + +// resolves FIPS endpoint configuration +func resolveUseFIPSEndpoint(cfg aws.Config, o *Options) error { + if len(cfg.ConfigSources) == 0 { + return nil + } + value, found, err := internalConfig.ResolveUseFIPSEndpoint(context.Background(), cfg.ConfigSources) + if err != nil { + return err + } + if found { + o.EndpointOptions.UseFIPSEndpoint = value + } + return nil +} + +func resolveAccountID(identity smithyauth.Identity, mode aws.AccountIDEndpointMode) *string { + if mode == aws.AccountIDEndpointModeDisabled { + return nil + } + + if ca, ok := identity.(*internalauthsmithy.CredentialsAdapter); ok && ca.Credentials.AccountID != "" { + return aws.String(ca.Credentials.AccountID) + } + + return nil +} + +func addTimeOffsetBuild(stack *middleware.Stack, c *Client) error { + mw := internalmiddleware.AddTimeOffsetMiddleware{Offset: c.timeOffset} + if err := stack.Build.Add(&mw, middleware.After); err != nil { + return err + } + return stack.Deserialize.Insert(&mw, "RecordResponseTiming", middleware.Before) +} +func initializeTimeOffsetResolver(c *Client) { + c.timeOffset = new(atomic.Int64) +} + +func addUserAgentRetryMode(stack *middleware.Stack, options Options) error { + ua, err := getOrAddRequestUserAgent(stack) + if err != nil { + return err + } + + switch options.Retryer.(type) { + case *retry.Standard: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeStandard) + case *retry.AdaptiveMode: + ua.AddUserAgentFeature(awsmiddleware.UserAgentFeatureRetryModeAdaptive) + } + return nil +} + +func resolveTracerProvider(options *Options) { + if options.TracerProvider == nil { + options.TracerProvider = &tracing.NopTracerProvider{} + } +} + +func resolveMeterProvider(options *Options) { + if options.MeterProvider == nil { + options.MeterProvider = metrics.NopMeterProvider{} + } +} + +func addRecursionDetection(stack *middleware.Stack) error { + return stack.Build.Add(&awsmiddleware.RecursionDetection{}, middleware.After) +} + +func addRequestIDRetrieverMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awsmiddleware.RequestIDRetriever{}, "OperationDeserializer", middleware.Before) + +} + +func addResponseErrorMiddleware(stack *middleware.Stack) error { + return stack.Deserialize.Insert(&awshttp.ResponseErrorWrapper{}, "RequestIDRetriever", middleware.Before) + +} + +func addRequestResponseLogging(stack *middleware.Stack, o Options) error { + return stack.Deserialize.Add(&smithyhttp.RequestResponseLogger{ + LogRequest: o.ClientLogMode.IsRequest(), + LogRequestWithBody: o.ClientLogMode.IsRequestWithBody(), + LogResponse: o.ClientLogMode.IsResponse(), + LogResponseWithBody: o.ClientLogMode.IsResponseWithBody(), + }, middleware.After) +} + +type disableHTTPSMiddleware struct { + DisableHTTPS bool +} + +func (*disableHTTPSMiddleware) ID() string { + return "disableHTTPS" +} + +func (m *disableHTTPSMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.DisableHTTPS && !smithyhttp.GetHostnameImmutable(ctx) { + req.URL.Scheme = "http" + } + + return next.HandleFinalize(ctx, in) +} + +func addDisableHTTPSMiddleware(stack *middleware.Stack, o Options) error { + return stack.Finalize.Insert(&disableHTTPSMiddleware{ + DisableHTTPS: o.EndpointOptions.DisableHTTPS, + }, "ResolveEndpointV2", middleware.After) +} + +type spanInitializeStart struct { +} + +func (*spanInitializeStart) ID() string { + return "spanInitializeStart" +} + +func (m *spanInitializeStart) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "Initialize") + + return next.HandleInitialize(ctx, in) +} + +type spanInitializeEnd struct { +} + +func (*spanInitializeEnd) ID() string { + return "spanInitializeEnd" +} + +func (m *spanInitializeEnd) HandleInitialize( + ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler, +) ( + middleware.InitializeOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleInitialize(ctx, in) +} + +type spanBuildRequestStart struct { +} + +func (*spanBuildRequestStart) ID() string { + return "spanBuildRequestStart" +} + +func (m *spanBuildRequestStart) HandleSerialize( + ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler, +) ( + middleware.SerializeOutput, middleware.Metadata, error, +) { + ctx, _ = tracing.StartSpan(ctx, "BuildRequest") + + return next.HandleSerialize(ctx, in) +} + +type spanBuildRequestEnd struct { +} + +func (*spanBuildRequestEnd) ID() string { + return "spanBuildRequestEnd" +} + +func (m *spanBuildRequestEnd) HandleBuild( + ctx context.Context, in middleware.BuildInput, next middleware.BuildHandler, +) ( + middleware.BuildOutput, middleware.Metadata, error, +) { + ctx, span := tracing.PopSpan(ctx) + span.End() + + return next.HandleBuild(ctx, in) +} + +func addSpanInitializeStart(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeStart{}, middleware.Before) +} + +func addSpanInitializeEnd(stack *middleware.Stack) error { + return stack.Initialize.Add(&spanInitializeEnd{}, middleware.After) +} + +func addSpanBuildRequestStart(stack *middleware.Stack) error { + return stack.Serialize.Add(&spanBuildRequestStart{}, middleware.Before) +} + +func addSpanBuildRequestEnd(stack *middleware.Stack) error { + return stack.Build.Add(&spanBuildRequestEnd{}, middleware.After) +} diff --git a/service/notificationscontacts/api_client_test.go b/service/notificationscontacts/api_client_test.go new file mode 100644 index 00000000000..fe2b8aeca49 --- /dev/null +++ b/service/notificationscontacts/api_client_test.go @@ -0,0 +1,127 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io/ioutil" + "net/http" + "strings" + "testing" +) + +func TestClient_resolveRetryOptions(t *testing.T) { + nopClient := smithyhttp.ClientDoFunc(func(_ *http.Request) (*http.Response, error) { + return &http.Response{ + StatusCode: 200, + Header: http.Header{}, + Body: ioutil.NopCloser(strings.NewReader("")), + }, nil + }) + + cases := map[string]struct { + defaultsMode aws.DefaultsMode + retryer aws.Retryer + retryMaxAttempts int + opRetryMaxAttempts *int + retryMode aws.RetryMode + expectClientRetryMode aws.RetryMode + expectClientMaxAttempts int + expectOpMaxAttempts int + }{ + "defaults": { + defaultsMode: aws.DefaultsModeStandard, + expectClientRetryMode: aws.RetryModeStandard, + expectClientMaxAttempts: 3, + expectOpMaxAttempts: 3, + }, + "custom default retry": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(2), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 2, + }, + "custom op no change max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(10), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + "custom op 0 max attempts": { + retryMode: aws.RetryModeAdaptive, + retryMaxAttempts: 10, + opRetryMaxAttempts: aws.Int(0), + expectClientRetryMode: aws.RetryModeAdaptive, + expectClientMaxAttempts: 10, + expectOpMaxAttempts: 10, + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + client := NewFromConfig(aws.Config{ + DefaultsMode: c.defaultsMode, + Retryer: func() func() aws.Retryer { + if c.retryer == nil { + return nil + } + + return func() aws.Retryer { return c.retryer } + }(), + HTTPClient: nopClient, + RetryMaxAttempts: c.retryMaxAttempts, + RetryMode: c.retryMode, + }, func(o *Options) { + if o.Retryer == nil { + t.Errorf("retryer must not be nil in functional options") + } + }) + + if e, a := c.expectClientRetryMode, client.options.RetryMode; e != a { + t.Errorf("expect %v retry mode, got %v", e, a) + } + if e, a := c.expectClientMaxAttempts, client.options.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v max attempts, got %v", e, a) + } + + _, _, err := client.invokeOperation(context.Background(), "mockOperation", struct{}{}, + []func(*Options){ + func(o *Options) { + if c.opRetryMaxAttempts == nil { + return + } + o.RetryMaxAttempts = *c.opRetryMaxAttempts + }, + }, + func(s *middleware.Stack, o Options) error { + s.Initialize.Clear() + s.Serialize.Clear() + s.Build.Clear() + s.Finalize.Clear() + s.Deserialize.Clear() + + if e, a := c.expectOpMaxAttempts, o.Retryer.MaxAttempts(); e != a { + t.Errorf("expect %v op max attempts, got %v", e, a) + } + return nil + }) + if err != nil { + t.Fatalf("expect no operation error, got %v", err) + } + }) + } +} diff --git a/service/notificationscontacts/api_op_ActivateEmailContact.go b/service/notificationscontacts/api_op_ActivateEmailContact.go new file mode 100644 index 00000000000..a12f2d2ebfe --- /dev/null +++ b/service/notificationscontacts/api_op_ActivateEmailContact.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Activates an email contact using an activation code. This code is in the +// activation email sent to the email address associated with this email contact. +func (c *Client) ActivateEmailContact(ctx context.Context, params *ActivateEmailContactInput, optFns ...func(*Options)) (*ActivateEmailContactOutput, error) { + if params == nil { + params = &ActivateEmailContactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ActivateEmailContact", params, optFns, c.addOperationActivateEmailContactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ActivateEmailContactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ActivateEmailContactInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + Arn *string + + // The activation code for this email contact. + // + // An email contact has a maximum of five activation attempts. Activation codes + // expire after 12 hours and are generated by the [SendActivationCode]API action. + // + // [SendActivationCode]: https://docs.aws.amazon.com/notificationscontacts/latest/APIReference/API_SendActivationCode.html + // + // This member is required. + Code *string + + noSmithyDocumentSerde +} + +type ActivateEmailContactOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationActivateEmailContactMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpActivateEmailContact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpActivateEmailContact{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ActivateEmailContact"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpActivateEmailContactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opActivateEmailContact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opActivateEmailContact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ActivateEmailContact", + } +} diff --git a/service/notificationscontacts/api_op_CreateEmailContact.go b/service/notificationscontacts/api_op_CreateEmailContact.go new file mode 100644 index 00000000000..5a150ed11da --- /dev/null +++ b/service/notificationscontacts/api_op_CreateEmailContact.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Creates an email contact for the provided email address. +func (c *Client) CreateEmailContact(ctx context.Context, params *CreateEmailContactInput, optFns ...func(*Options)) (*CreateEmailContactOutput, error) { + if params == nil { + params = &CreateEmailContactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CreateEmailContact", params, optFns, c.addOperationCreateEmailContactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CreateEmailContactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CreateEmailContactInput struct { + + // The email address this email contact points to. The activation email and any + // subscribed emails are sent here. + // + // This email address can't receive emails until it's activated. + // + // This member is required. + EmailAddress *string + + // The name of the email contact. + // + // This member is required. + Name *string + + // A map of tags assigned to a resource. A tag is a string-to-string map of + // key-value pairs. + Tags map[string]string + + noSmithyDocumentSerde +} + +type CreateEmailContactOutput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + Arn *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCreateEmailContactMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCreateEmailContact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCreateEmailContact{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CreateEmailContact"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCreateEmailContactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCreateEmailContact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCreateEmailContact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CreateEmailContact", + } +} diff --git a/service/notificationscontacts/api_op_DeleteEmailContact.go b/service/notificationscontacts/api_op_DeleteEmailContact.go new file mode 100644 index 00000000000..69808d6f81f --- /dev/null +++ b/service/notificationscontacts/api_op_DeleteEmailContact.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Deletes an email contact. +// +// Deleting an email contact removes it from all associated notification +// configurations. +func (c *Client) DeleteEmailContact(ctx context.Context, params *DeleteEmailContactInput, optFns ...func(*Options)) (*DeleteEmailContactOutput, error) { + if params == nil { + params = &DeleteEmailContactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DeleteEmailContact", params, optFns, c.addOperationDeleteEmailContactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DeleteEmailContactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DeleteEmailContactInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type DeleteEmailContactOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDeleteEmailContactMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDeleteEmailContact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDeleteEmailContact{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DeleteEmailContact"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDeleteEmailContactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDeleteEmailContact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDeleteEmailContact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DeleteEmailContact", + } +} diff --git a/service/notificationscontacts/api_op_GetEmailContact.go b/service/notificationscontacts/api_op_GetEmailContact.go new file mode 100644 index 00000000000..a198185a2c1 --- /dev/null +++ b/service/notificationscontacts/api_op_GetEmailContact.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notificationscontacts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns an email contact. +func (c *Client) GetEmailContact(ctx context.Context, params *GetEmailContactInput, optFns ...func(*Options)) (*GetEmailContactOutput, error) { + if params == nil { + params = &GetEmailContactInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetEmailContact", params, optFns, c.addOperationGetEmailContactMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetEmailContactOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetEmailContactInput struct { + + // The Amazon Resource Name (ARN) of the email contact to get. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type GetEmailContactOutput struct { + + // The email contact for the provided email address. + // + // This member is required. + EmailContact *types.EmailContact + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetEmailContactMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetEmailContact{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetEmailContact{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetEmailContact"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetEmailContactValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetEmailContact(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetEmailContact(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetEmailContact", + } +} diff --git a/service/notificationscontacts/api_op_ListEmailContacts.go b/service/notificationscontacts/api_op_ListEmailContacts.go new file mode 100644 index 00000000000..fe55fac1532 --- /dev/null +++ b/service/notificationscontacts/api_op_ListEmailContacts.go @@ -0,0 +1,261 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/notificationscontacts/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all email contacts created under the Account. +func (c *Client) ListEmailContacts(ctx context.Context, params *ListEmailContactsInput, optFns ...func(*Options)) (*ListEmailContactsOutput, error) { + if params == nil { + params = &ListEmailContactsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListEmailContacts", params, optFns, c.addOperationListEmailContactsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListEmailContactsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListEmailContactsInput struct { + + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + MaxResults *int32 + + // An optional token returned from a prior request. Use this token for pagination + // of results from this action. If this parameter is specified, the response + // includes only results beyond the token, up to the value specified by MaxResults. + NextToken *string + + noSmithyDocumentSerde +} + +type ListEmailContactsOutput struct { + + // A list of email contacts. + // + // This member is required. + EmailContacts []types.EmailContact + + // An optional token returned from a prior request. Use this token for pagination + // of results from this action. If this parameter is specified, the response + // includes only results beyond the token, up to the value specified by MaxResults. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListEmailContactsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListEmailContacts{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListEmailContacts{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListEmailContacts"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListEmailContacts(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListEmailContactsPaginatorOptions is the paginator options for ListEmailContacts +type ListEmailContactsPaginatorOptions struct { + // The maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so that + // the remaining results can be retrieved. + 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 +} + +// ListEmailContactsPaginator is a paginator for ListEmailContacts +type ListEmailContactsPaginator struct { + options ListEmailContactsPaginatorOptions + client ListEmailContactsAPIClient + params *ListEmailContactsInput + nextToken *string + firstPage bool +} + +// NewListEmailContactsPaginator returns a new ListEmailContactsPaginator +func NewListEmailContactsPaginator(client ListEmailContactsAPIClient, params *ListEmailContactsInput, optFns ...func(*ListEmailContactsPaginatorOptions)) *ListEmailContactsPaginator { + if params == nil { + params = &ListEmailContactsInput{} + } + + options := ListEmailContactsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListEmailContactsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListEmailContactsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListEmailContacts page. +func (p *ListEmailContactsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListEmailContactsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListEmailContacts(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 +} + +// ListEmailContactsAPIClient is a client that implements the ListEmailContacts +// operation. +type ListEmailContactsAPIClient interface { + ListEmailContacts(context.Context, *ListEmailContactsInput, ...func(*Options)) (*ListEmailContactsOutput, error) +} + +var _ ListEmailContactsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListEmailContacts(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListEmailContacts", + } +} diff --git a/service/notificationscontacts/api_op_ListTagsForResource.go b/service/notificationscontacts/api_op_ListTagsForResource.go new file mode 100644 index 00000000000..c655d22ed1a --- /dev/null +++ b/service/notificationscontacts/api_op_ListTagsForResource.go @@ -0,0 +1,158 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists all of the tags associated with the Amazon Resource Name (ARN) that you +// specify. The resource can be a user, server, or role. +func (c *Client) ListTagsForResource(ctx context.Context, params *ListTagsForResourceInput, optFns ...func(*Options)) (*ListTagsForResourceOutput, error) { + if params == nil { + params = &ListTagsForResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListTagsForResource", params, optFns, c.addOperationListTagsForResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListTagsForResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListTagsForResourceInput struct { + + // The ARN you specified to list the tags of. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type ListTagsForResourceOutput struct { + + // Key-value pairs that are assigned to a resource, usually for the purpose of + // grouping and searching for items. Tags are metadata that you define. + Tags map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListTagsForResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListTagsForResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListTagsForResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListTagsForResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListTagsForResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListTagsForResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListTagsForResource", + } +} diff --git a/service/notificationscontacts/api_op_SendActivationCode.go b/service/notificationscontacts/api_op_SendActivationCode.go new file mode 100644 index 00000000000..60f0597ff12 --- /dev/null +++ b/service/notificationscontacts/api_op_SendActivationCode.go @@ -0,0 +1,156 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Sends an activation email to the email address associated with the specified +// email contact. +// +// It might take a few minutes for the activation email to arrive. If it doesn't +// arrive, check in your spam folder or try sending another activation email. +func (c *Client) SendActivationCode(ctx context.Context, params *SendActivationCodeInput, optFns ...func(*Options)) (*SendActivationCodeOutput, error) { + if params == nil { + params = &SendActivationCodeInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "SendActivationCode", params, optFns, c.addOperationSendActivationCodeMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*SendActivationCodeOutput) + out.ResultMetadata = metadata + return out, nil +} + +type SendActivationCodeInput struct { + + // The Amazon Resource Name (ARN) of the resource. + // + // This member is required. + Arn *string + + noSmithyDocumentSerde +} + +type SendActivationCodeOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationSendActivationCodeMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpSendActivationCode{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpSendActivationCode{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "SendActivationCode"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpSendActivationCodeValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opSendActivationCode(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opSendActivationCode(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "SendActivationCode", + } +} diff --git a/service/notificationscontacts/api_op_TagResource.go b/service/notificationscontacts/api_op_TagResource.go new file mode 100644 index 00000000000..acdfdb11c90 --- /dev/null +++ b/service/notificationscontacts/api_op_TagResource.go @@ -0,0 +1,159 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Attaches a key-value pair to a resource, as identified by its Amazon Resource +// Name (ARN). Taggable resources in AWS User Notifications Contacts include email +// contacts. +func (c *Client) TagResource(ctx context.Context, params *TagResourceInput, optFns ...func(*Options)) (*TagResourceOutput, error) { + if params == nil { + params = &TagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "TagResource", params, optFns, c.addOperationTagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*TagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type TagResourceInput struct { + + // The ARN of the configuration. + // + // This member is required. + Arn *string + + // A list of tags to apply to the configuration. + // + // This member is required. + Tags map[string]string + + noSmithyDocumentSerde +} + +type TagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationTagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpTagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "TagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpTagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opTagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opTagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "TagResource", + } +} diff --git a/service/notificationscontacts/api_op_UntagResource.go b/service/notificationscontacts/api_op_UntagResource.go new file mode 100644 index 00000000000..0dc4fdd8f27 --- /dev/null +++ b/service/notificationscontacts/api_op_UntagResource.go @@ -0,0 +1,162 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Detaches a key-value pair from a resource, as identified by its Amazon Resource +// Name (ARN). Taggable resources in AWS User Notifications Contacts include email +// contacts.. +func (c *Client) UntagResource(ctx context.Context, params *UntagResourceInput, optFns ...func(*Options)) (*UntagResourceOutput, error) { + if params == nil { + params = &UntagResourceInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UntagResource", params, optFns, c.addOperationUntagResourceMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UntagResourceOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UntagResourceInput struct { + + // The value of the resource that will have the tag removed. An Amazon Resource + // Name (ARN) is an identifier for a specific AWS resource, such as a server, user, + // or role. + // + // This member is required. + Arn *string + + // Specifies a list of tag keys that you want to remove from the specified + // resources. + // + // This member is required. + TagKeys []string + + noSmithyDocumentSerde +} + +type UntagResourceOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUntagResourceMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUntagResource{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UntagResource"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUntagResourceValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUntagResource(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUntagResource(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UntagResource", + } +} diff --git a/service/notificationscontacts/auth.go b/service/notificationscontacts/auth.go new file mode 100644 index 00000000000..7116e4369a2 --- /dev/null +++ b/service/notificationscontacts/auth.go @@ -0,0 +1,313 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +func bindAuthParamsRegion(_ interface{}, params *AuthResolverParameters, _ interface{}, options Options) { + params.Region = options.Region +} + +type setLegacyContextSigningOptionsMiddleware struct { +} + +func (*setLegacyContextSigningOptionsMiddleware) ID() string { + return "setLegacyContextSigningOptions" +} + +func (m *setLegacyContextSigningOptionsMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + rscheme := getResolvedAuthScheme(ctx) + schemeID := rscheme.Scheme.SchemeID() + + if sn := awsmiddleware.GetSigningName(ctx); sn != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningName(&rscheme.SignerProperties, sn) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningName(&rscheme.SignerProperties, sn) + } + } + + if sr := awsmiddleware.GetSigningRegion(ctx); sr != "" { + if schemeID == "aws.auth#sigv4" { + smithyhttp.SetSigV4SigningRegion(&rscheme.SignerProperties, sr) + } else if schemeID == "aws.auth#sigv4a" { + smithyhttp.SetSigV4ASigningRegions(&rscheme.SignerProperties, []string{sr}) + } + } + + return next.HandleFinalize(ctx, in) +} + +func addSetLegacyContextSigningOptionsMiddleware(stack *middleware.Stack) error { + return stack.Finalize.Insert(&setLegacyContextSigningOptionsMiddleware{}, "Signing", middleware.Before) +} + +type withAnonymous struct { + resolver AuthSchemeResolver +} + +var _ AuthSchemeResolver = (*withAnonymous)(nil) + +func (v *withAnonymous) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + opts, err := v.resolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return nil, err + } + + opts = append(opts, &smithyauth.Option{ + SchemeID: smithyauth.SchemeIDAnonymous, + }) + return opts, nil +} + +func wrapWithAnonymousAuth(options *Options) { + if _, ok := options.AuthSchemeResolver.(*defaultAuthSchemeResolver); !ok { + return + } + + options.AuthSchemeResolver = &withAnonymous{ + resolver: options.AuthSchemeResolver, + } +} + +// AuthResolverParameters contains the set of inputs necessary for auth scheme +// resolution. +type AuthResolverParameters struct { + // The name of the operation being invoked. + Operation string + + // The region in which the operation is being invoked. + Region string +} + +func bindAuthResolverParams(ctx context.Context, operation string, input interface{}, options Options) *AuthResolverParameters { + params := &AuthResolverParameters{ + Operation: operation, + } + + bindAuthParamsRegion(ctx, params, input, options) + + return params +} + +// AuthSchemeResolver returns a set of possible authentication options for an +// operation. +type AuthSchemeResolver interface { + ResolveAuthSchemes(context.Context, *AuthResolverParameters) ([]*smithyauth.Option, error) +} + +type defaultAuthSchemeResolver struct{} + +var _ AuthSchemeResolver = (*defaultAuthSchemeResolver)(nil) + +func (*defaultAuthSchemeResolver) ResolveAuthSchemes(ctx context.Context, params *AuthResolverParameters) ([]*smithyauth.Option, error) { + if overrides, ok := operationAuthOptions[params.Operation]; ok { + return overrides(params), nil + } + return serviceAuthOptions(params), nil +} + +var operationAuthOptions = map[string]func(*AuthResolverParameters) []*smithyauth.Option{} + +func serviceAuthOptions(params *AuthResolverParameters) []*smithyauth.Option { + return []*smithyauth.Option{ + { + SchemeID: smithyauth.SchemeIDSigV4, + SignerProperties: func() smithy.Properties { + var props smithy.Properties + smithyhttp.SetSigV4SigningName(&props, "notifications-contacts") + smithyhttp.SetSigV4SigningRegion(&props, params.Region) + return props + }(), + }, + } +} + +type resolveAuthSchemeMiddleware struct { + operation string + options Options +} + +func (*resolveAuthSchemeMiddleware) ID() string { + return "ResolveAuthScheme" +} + +func (m *resolveAuthSchemeMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveAuthScheme") + defer span.End() + + params := bindAuthResolverParams(ctx, m.operation, getOperationInput(ctx), m.options) + options, err := m.options.AuthSchemeResolver.ResolveAuthSchemes(ctx, params) + if err != nil { + return out, metadata, fmt.Errorf("resolve auth scheme: %w", err) + } + + scheme, ok := m.selectScheme(options) + if !ok { + return out, metadata, fmt.Errorf("could not select an auth scheme") + } + + ctx = setResolvedAuthScheme(ctx, scheme) + + span.SetProperty("auth.scheme_id", scheme.Scheme.SchemeID()) + span.End() + return next.HandleFinalize(ctx, in) +} + +func (m *resolveAuthSchemeMiddleware) selectScheme(options []*smithyauth.Option) (*resolvedAuthScheme, bool) { + for _, option := range options { + if option.SchemeID == smithyauth.SchemeIDAnonymous { + return newResolvedAuthScheme(smithyhttp.NewAnonymousScheme(), option), true + } + + for _, scheme := range m.options.AuthSchemes { + if scheme.SchemeID() != option.SchemeID { + continue + } + + if scheme.IdentityResolver(m.options) != nil { + return newResolvedAuthScheme(scheme, option), true + } + } + } + + return nil, false +} + +type resolvedAuthSchemeKey struct{} + +type resolvedAuthScheme struct { + Scheme smithyhttp.AuthScheme + IdentityProperties smithy.Properties + SignerProperties smithy.Properties +} + +func newResolvedAuthScheme(scheme smithyhttp.AuthScheme, option *smithyauth.Option) *resolvedAuthScheme { + return &resolvedAuthScheme{ + Scheme: scheme, + IdentityProperties: option.IdentityProperties, + SignerProperties: option.SignerProperties, + } +} + +func setResolvedAuthScheme(ctx context.Context, scheme *resolvedAuthScheme) context.Context { + return middleware.WithStackValue(ctx, resolvedAuthSchemeKey{}, scheme) +} + +func getResolvedAuthScheme(ctx context.Context) *resolvedAuthScheme { + v, _ := middleware.GetStackValue(ctx, resolvedAuthSchemeKey{}).(*resolvedAuthScheme) + return v +} + +type getIdentityMiddleware struct { + options Options +} + +func (*getIdentityMiddleware) ID() string { + return "GetIdentity" +} + +func (m *getIdentityMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + innerCtx, span := tracing.StartSpan(ctx, "GetIdentity") + defer span.End() + + rscheme := getResolvedAuthScheme(innerCtx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + resolver := rscheme.Scheme.IdentityResolver(m.options) + if resolver == nil { + return out, metadata, fmt.Errorf("no identity resolver") + } + + identity, err := timeOperationMetric(ctx, "client.call.resolve_identity_duration", + func() (smithyauth.Identity, error) { + return resolver.GetIdentity(innerCtx, rscheme.IdentityProperties) + }, + func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("get identity: %w", err) + } + + ctx = setIdentity(ctx, identity) + + span.End() + return next.HandleFinalize(ctx, in) +} + +type identityKey struct{} + +func setIdentity(ctx context.Context, identity smithyauth.Identity) context.Context { + return middleware.WithStackValue(ctx, identityKey{}, identity) +} + +func getIdentity(ctx context.Context) smithyauth.Identity { + v, _ := middleware.GetStackValue(ctx, identityKey{}).(smithyauth.Identity) + return v +} + +type signRequestMiddleware struct { + options Options +} + +func (*signRequestMiddleware) ID() string { + return "Signing" +} + +func (m *signRequestMiddleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "SignRequest") + defer span.End() + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unexpected transport type %T", in.Request) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + identity := getIdentity(ctx) + if identity == nil { + return out, metadata, fmt.Errorf("no identity") + } + + signer := rscheme.Scheme.Signer() + if signer == nil { + return out, metadata, fmt.Errorf("no signer") + } + + _, err = timeOperationMetric(ctx, "client.call.signing_duration", func() (any, error) { + return nil, signer.SignRequest(ctx, req, identity, rscheme.SignerProperties) + }, func(o *metrics.RecordMetricOptions) { + o.Properties.Set("auth.scheme_id", rscheme.Scheme.SchemeID()) + }) + if err != nil { + return out, metadata, fmt.Errorf("sign request: %w", err) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/notificationscontacts/deserializers.go b/service/notificationscontacts/deserializers.go new file mode 100644 index 00000000000..2399f88467b --- /dev/null +++ b/service/notificationscontacts/deserializers.go @@ -0,0 +1,2124 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "bytes" + "context" + "encoding/json" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws/protocol/restjson" + "github.com/aws/aws-sdk-go-v2/service/notificationscontacts/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" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "io" + "strconv" + "strings" + "time" +) + +func deserializeS3Expires(v string) (*time.Time, error) { + t, err := smithytime.ParseHTTPDate(v) + if err != nil { + return nil, nil + } + return &t, nil +} + +type awsRestjson1_deserializeOpActivateEmailContact struct { +} + +func (*awsRestjson1_deserializeOpActivateEmailContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpActivateEmailContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorActivateEmailContact(response, &metadata) + } + output := &ActivateEmailContactOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorActivateEmailContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpCreateEmailContact struct { +} + +func (*awsRestjson1_deserializeOpCreateEmailContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCreateEmailContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCreateEmailContact(response, &metadata) + } + output := &CreateEmailContactOutput{} + 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_deserializeOpDocumentCreateEmailContactOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCreateEmailContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentCreateEmailContactOutput(v **CreateEmailContactOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *CreateEmailContactOutput + if *v == nil { + sv = &CreateEmailContactOutput{} + } 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 EmailContactArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpDeleteEmailContact struct { +} + +func (*awsRestjson1_deserializeOpDeleteEmailContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDeleteEmailContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDeleteEmailContact(response, &metadata) + } + output := &DeleteEmailContactOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDeleteEmailContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpGetEmailContact struct { +} + +func (*awsRestjson1_deserializeOpGetEmailContact) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetEmailContact) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetEmailContact(response, &metadata) + } + output := &GetEmailContactOutput{} + 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_deserializeOpDocumentGetEmailContactOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetEmailContact(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetEmailContactOutput(v **GetEmailContactOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetEmailContactOutput + if *v == nil { + sv = &GetEmailContactOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "emailContact": + if err := awsRestjson1_deserializeDocumentEmailContact(&sv.EmailContact, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListEmailContacts struct { +} + +func (*awsRestjson1_deserializeOpListEmailContacts) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListEmailContacts) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListEmailContacts(response, &metadata) + } + output := &ListEmailContactsOutput{} + 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_deserializeOpDocumentListEmailContactsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListEmailContacts(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListEmailContactsOutput(v **ListEmailContactsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListEmailContactsOutput + if *v == nil { + sv = &ListEmailContactsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "emailContacts": + if err := awsRestjson1_deserializeDocumentEmailContacts(&sv.EmailContacts, 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_deserializeOpListTagsForResource struct { +} + +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + } + output := &ListTagsForResourceOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListTagsForResourceOutput + if *v == nil { + sv = &ListTagsForResourceOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "tags": + if err := awsRestjson1_deserializeDocumentTagMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpSendActivationCode struct { +} + +func (*awsRestjson1_deserializeOpSendActivationCode) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpSendActivationCode) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorSendActivationCode(response, &metadata) + } + output := &SendActivationCodeOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorSendActivationCode(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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 + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("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_deserializeOpHttpBindingsThrottlingException(v *types.ThrottlingException, response *smithyhttp.Response) error { + if v == nil { + return fmt.Errorf("unsupported deserialization for nil %T", v) + } + + if headerValues := response.Header.Values("Retry-After"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 32) + if err != nil { + return err + } + v.RetryAfterSeconds = ptr.Int32(int32(vv)) + } + + return nil +} +func awsRestjson1_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) + + if err := awsRestjson1_deserializeOpHttpBindingsThrottlingException(output, response); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to decode response error with invalid HTTP bindings, %w", err)} + } + + return output +} + +func awsRestjson1_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.ValidationException{} + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + err := awsRestjson1_deserializeDocumentValidationException(&output, shape) + + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + + return output +} + +func awsRestjson1_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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEmailContact(v **types.EmailContact, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.EmailContact + if *v == nil { + sv = &types.EmailContact{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "address": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SensitiveEmailContactAddress to be of type string, got %T instead", value) + } + sv.Address = ptr.String(jtv) + } + + case "arn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EmailContactArn to be of type string, got %T instead", value) + } + sv.Arn = ptr.String(jtv) + } + + case "creationTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected CreationTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreationTime = ptr.Time(t) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EmailContactName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected EmailContactStatus to be of type string, got %T instead", value) + } + sv.Status = types.EmailContactStatus(jtv) + } + + case "updateTime": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected UpdateTime to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.UpdateTime = ptr.Time(t) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentEmailContacts(v *[]types.EmailContact, 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.EmailContact + if *v == nil { + cv = []types.EmailContact{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.EmailContact + destAddr := &col + if err := awsRestjson1_deserializeDocumentEmailContact(&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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.ResourceNotFoundException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ResourceNotFoundException + if *v == nil { + sv = &types.ResourceNotFoundException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = 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", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaCode to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "resourceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceId to be of type string, got %T instead", value) + } + sv.ResourceId = ptr.String(jtv) + } + + case "resourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = ptr.String(jtv) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentTagMap(v *map[string]string, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var mv map[string]string + if *v == nil { + mv = map[string]string{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal string + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TagValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsRestjson1_deserializeDocumentThrottlingException(v **types.ThrottlingException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ThrottlingException + if *v == nil { + sv = &types.ThrottlingException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "quotaCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected QuotaCode to be of type string, got %T instead", value) + } + sv.QuotaCode = ptr.String(jtv) + } + + case "retryAfterSeconds": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.RetryAfterSeconds = ptr.Int32(int32(i64)) + } + + case "serviceCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ServiceCode to be of type string, got %T instead", value) + } + sv.ServiceCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationException(v **types.ValidationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationException + if *v == nil { + sv = &types.ValidationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "fieldList": + if err := awsRestjson1_deserializeDocumentValidationExceptionFieldList(&sv.FieldList, value); err != nil { + return err + } + + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "reason": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ValidationExceptionReason to be of type string, got %T instead", value) + } + sv.Reason = types.ValidationExceptionReason(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionField(v **types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *types.ValidationExceptionField + if *v == nil { + sv = &types.ValidationExceptionField{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + case "name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentValidationExceptionFieldList(v *[]types.ValidationExceptionField, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []types.ValidationExceptionField + if *v == nil { + cv = []types.ValidationExceptionField{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ValidationExceptionField + destAddr := &col + if err := awsRestjson1_deserializeDocumentValidationExceptionField(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} diff --git a/service/notificationscontacts/doc.go b/service/notificationscontacts/doc.go new file mode 100644 index 00000000000..6dea06437f5 --- /dev/null +++ b/service/notificationscontacts/doc.go @@ -0,0 +1,10 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +// Package notificationscontacts provides the API client, operations, and +// parameter types for AWS User Notifications Contacts. +// +// AWS User Notifications Contacts is a service that allows you to create and +// manage email contacts for AWS User Notifications. The AWS User Notifications +// Contacts API Reference provides descriptions, API request parameters, and the +// JSON response for all email contact related API actions. +package notificationscontacts diff --git a/service/notificationscontacts/endpoints.go b/service/notificationscontacts/endpoints.go new file mode 100644 index 00000000000..455eeb0f334 --- /dev/null +++ b/service/notificationscontacts/endpoints.go @@ -0,0 +1,491 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "errors" + "fmt" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalConfig "github.com/aws/aws-sdk-go-v2/internal/configsources" + "github.com/aws/aws-sdk-go-v2/internal/endpoints" + "github.com/aws/aws-sdk-go-v2/internal/endpoints/awsrulesfn" + internalendpoints "github.com/aws/aws-sdk-go-v2/service/notificationscontacts/internal/endpoints" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/ptr" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "os" + "strings" +) + +// EndpointResolverOptions is the service endpoint resolver options +type EndpointResolverOptions = internalendpoints.Options + +// EndpointResolver interface for resolving service endpoints. +type EndpointResolver interface { + ResolveEndpoint(region string, options EndpointResolverOptions) (aws.Endpoint, error) +} + +var _ EndpointResolver = &internalendpoints.Resolver{} + +// NewDefaultEndpointResolver constructs a new service endpoint resolver +func NewDefaultEndpointResolver() *internalendpoints.Resolver { + return internalendpoints.New() +} + +// EndpointResolverFunc is a helper utility that wraps a function so it satisfies +// the EndpointResolver interface. This is useful when you want to add additional +// endpoint resolving logic, or stub out specific endpoints with custom values. +type EndpointResolverFunc func(region string, options EndpointResolverOptions) (aws.Endpoint, error) + +func (fn EndpointResolverFunc) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return fn(region, options) +} + +// EndpointResolverFromURL returns an EndpointResolver configured using the +// provided endpoint url. By default, the resolved endpoint resolver uses the +// client region as signing region, and the endpoint source is set to +// EndpointSourceCustom.You can provide functional options to configure endpoint +// values for the resolved endpoint. +func EndpointResolverFromURL(url string, optFns ...func(*aws.Endpoint)) EndpointResolver { + e := aws.Endpoint{URL: url, Source: aws.EndpointSourceCustom} + for _, fn := range optFns { + fn(&e) + } + + return EndpointResolverFunc( + func(region string, options EndpointResolverOptions) (aws.Endpoint, error) { + if len(e.SigningRegion) == 0 { + e.SigningRegion = region + } + return e, nil + }, + ) +} + +type ResolveEndpoint struct { + Resolver EndpointResolver + Options EndpointResolverOptions +} + +func (*ResolveEndpoint) ID() string { + return "ResolveEndpoint" +} + +func (m *ResolveEndpoint) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + if !awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleSerialize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.Resolver == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + eo := m.Options + eo.Logger = middleware.GetLogger(ctx) + + var endpoint aws.Endpoint + endpoint, err = m.Resolver.ResolveEndpoint(awsmiddleware.GetRegion(ctx), eo) + if err != nil { + nf := (&aws.EndpointNotFoundError{}) + if errors.As(err, &nf) { + ctx = awsmiddleware.SetRequiresLegacyEndpoints(ctx, false) + return next.HandleSerialize(ctx, in) + } + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + req.URL, err = url.Parse(endpoint.URL) + if err != nil { + return out, metadata, fmt.Errorf("failed to parse endpoint URL: %w", err) + } + + if len(awsmiddleware.GetSigningName(ctx)) == 0 { + signingName := endpoint.SigningName + if len(signingName) == 0 { + signingName = "notifications-contacts" + } + ctx = awsmiddleware.SetSigningName(ctx, signingName) + } + ctx = awsmiddleware.SetEndpointSource(ctx, endpoint.Source) + ctx = smithyhttp.SetHostnameImmutable(ctx, endpoint.HostnameImmutable) + ctx = awsmiddleware.SetSigningRegion(ctx, endpoint.SigningRegion) + ctx = awsmiddleware.SetPartitionID(ctx, endpoint.PartitionID) + return next.HandleSerialize(ctx, in) +} +func addResolveEndpointMiddleware(stack *middleware.Stack, o Options) error { + return stack.Serialize.Insert(&ResolveEndpoint{ + Resolver: o.EndpointResolver, + Options: o.EndpointOptions, + }, "OperationSerializer", middleware.Before) +} + +func removeResolveEndpointMiddleware(stack *middleware.Stack) error { + _, err := stack.Serialize.Remove((&ResolveEndpoint{}).ID()) + return err +} + +type wrappedEndpointResolver struct { + awsResolver aws.EndpointResolverWithOptions +} + +func (w *wrappedEndpointResolver) ResolveEndpoint(region string, options EndpointResolverOptions) (endpoint aws.Endpoint, err error) { + return w.awsResolver.ResolveEndpoint(ServiceID, region, options) +} + +type awsEndpointResolverAdaptor func(service, region string) (aws.Endpoint, error) + +func (a awsEndpointResolverAdaptor) ResolveEndpoint(service, region string, options ...interface{}) (aws.Endpoint, error) { + return a(service, region) +} + +var _ aws.EndpointResolverWithOptions = awsEndpointResolverAdaptor(nil) + +// withEndpointResolver returns an aws.EndpointResolverWithOptions that first delegates endpoint resolution to the awsResolver. +// If awsResolver returns aws.EndpointNotFoundError error, the v1 resolver middleware will swallow the error, +// and set an appropriate context flag such that fallback will occur when EndpointResolverV2 is invoked +// via its middleware. +// +// If another error (besides aws.EndpointNotFoundError) is returned, then that error will be propagated. +func withEndpointResolver(awsResolver aws.EndpointResolver, awsResolverWithOptions aws.EndpointResolverWithOptions) EndpointResolver { + var resolver aws.EndpointResolverWithOptions + + if awsResolverWithOptions != nil { + resolver = awsResolverWithOptions + } else if awsResolver != nil { + resolver = awsEndpointResolverAdaptor(awsResolver.ResolveEndpoint) + } + + return &wrappedEndpointResolver{ + awsResolver: resolver, + } +} + +func finalizeClientEndpointResolverOptions(options *Options) { + options.EndpointOptions.LogDeprecated = options.ClientLogMode.IsDeprecatedUsage() + + if len(options.EndpointOptions.ResolvedRegion) == 0 { + const fipsInfix = "-fips-" + const fipsPrefix = "fips-" + const fipsSuffix = "-fips" + + if strings.Contains(options.Region, fipsInfix) || + strings.Contains(options.Region, fipsPrefix) || + strings.Contains(options.Region, fipsSuffix) { + options.EndpointOptions.ResolvedRegion = strings.ReplaceAll(strings.ReplaceAll(strings.ReplaceAll( + options.Region, fipsInfix, "-"), fipsPrefix, ""), fipsSuffix, "") + options.EndpointOptions.UseFIPSEndpoint = aws.FIPSEndpointStateEnabled + } + } + +} + +func resolveEndpointResolverV2(options *Options) { + if options.EndpointResolverV2 == nil { + options.EndpointResolverV2 = NewDefaultEndpointResolverV2() + } +} + +func resolveBaseEndpoint(cfg aws.Config, o *Options) { + if cfg.BaseEndpoint != nil { + o.BaseEndpoint = cfg.BaseEndpoint + } + + _, g := os.LookupEnv("AWS_ENDPOINT_URL") + _, s := os.LookupEnv("AWS_ENDPOINT_URL_NOTIFICATIONSCONTACTS") + + if g && !s { + return + } + + value, found, err := internalConfig.ResolveServiceBaseEndpoint(context.Background(), "NotificationsContacts", cfg.ConfigSources) + if found && err == nil { + o.BaseEndpoint = &value + } +} + +func bindRegion(region string) *string { + if region == "" { + return nil + } + return aws.String(endpoints.MapFIPSRegion(region)) +} + +// EndpointParameters provides the parameters that influence how endpoints are +// resolved. +type EndpointParameters struct { + // When true, send this request to the FIPS-compliant regional endpoint. If the + // configured endpoint does not have a FIPS compliant endpoint, dispatching the + // request will return an error. + // + // Defaults to false if no value is + // provided. + // + // AWS::UseFIPS + UseFIPS *bool + + // Override the endpoint used to send this request + // + // Parameter is + // required. + // + // SDK::Endpoint + Endpoint *string + + // The AWS region used to dispatch the request. + // + // Parameter is + // required. + // + // AWS::Region + Region *string +} + +// ValidateRequired validates required parameters are set. +func (p EndpointParameters) ValidateRequired() error { + if p.UseFIPS == nil { + return fmt.Errorf("parameter UseFIPS is required") + } + + return nil +} + +// WithDefaults returns a shallow copy of EndpointParameterswith default values +// applied to members where applicable. +func (p EndpointParameters) WithDefaults() EndpointParameters { + if p.UseFIPS == nil { + p.UseFIPS = ptr.Bool(false) + } + return p +} + +type stringSlice []string + +func (s stringSlice) Get(i int) *string { + if i < 0 || i >= len(s) { + return nil + } + + v := s[i] + return &v +} + +// EndpointResolverV2 provides the interface for resolving service endpoints. +type EndpointResolverV2 interface { + // ResolveEndpoint attempts to resolve the endpoint with the provided options, + // returning the endpoint if found. Otherwise an error is returned. + ResolveEndpoint(ctx context.Context, params EndpointParameters) ( + smithyendpoints.Endpoint, error, + ) +} + +// resolver provides the implementation for resolving endpoints. +type resolver struct{} + +func NewDefaultEndpointResolverV2() EndpointResolverV2 { + return &resolver{} +} + +// ResolveEndpoint attempts to resolve the endpoint with the provided options, +// returning the endpoint if found. Otherwise an error is returned. +func (r *resolver) ResolveEndpoint( + ctx context.Context, params EndpointParameters, +) ( + endpoint smithyendpoints.Endpoint, err error, +) { + params = params.WithDefaults() + if err = params.ValidateRequired(); err != nil { + return endpoint, fmt.Errorf("endpoint parameters are not valid, %w", err) + } + _UseFIPS := *params.UseFIPS + + if exprVal := params.Endpoint; exprVal != nil { + _Endpoint := *exprVal + _ = _Endpoint + if _UseFIPS == true { + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: FIPS and custom endpoint are not supported") + } + uriString := _Endpoint + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + }, nil + } + if exprVal := params.Region; exprVal != nil { + _Region := *exprVal + _ = _Region + if exprVal := awsrulesfn.GetPartition(_Region); exprVal != nil { + _PartitionResult := *exprVal + _ = _PartitionResult + if _UseFIPS == true { + uriString := func() string { + var out strings.Builder + out.WriteString("https://notifications-contacts-fips.") + out.WriteString(_PartitionResult.ImplicitGlobalRegion) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + uriString := func() string { + var out strings.Builder + out.WriteString("https://notifications-contacts.") + out.WriteString(_PartitionResult.ImplicitGlobalRegion) + out.WriteString(".") + out.WriteString(_PartitionResult.DualStackDnsSuffix) + return out.String() + }() + + uri, err := url.Parse(uriString) + if err != nil { + return endpoint, fmt.Errorf("Failed to parse uri: %s", uriString) + } + + return smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, _PartitionResult.ImplicitGlobalRegion) + return sp + }(), + }, + }) + return out + }(), + }, nil + } + return endpoint, fmt.Errorf("Endpoint resolution failed. Invalid operation or environment input.") + } + return endpoint, fmt.Errorf("endpoint rule error, %s", "Invalid Configuration: Missing Region") +} + +type endpointParamsBinder interface { + bindEndpointParams(*EndpointParameters) +} + +func bindEndpointParams(ctx context.Context, input interface{}, options Options) *EndpointParameters { + params := &EndpointParameters{} + + params.UseFIPS = aws.Bool(options.EndpointOptions.UseFIPSEndpoint == aws.FIPSEndpointStateEnabled) + params.Endpoint = options.BaseEndpoint + params.Region = bindRegion(options.Region) + + if b, ok := input.(endpointParamsBinder); ok { + b.bindEndpointParams(params) + } + + return params +} + +type resolveEndpointV2Middleware struct { + options Options +} + +func (*resolveEndpointV2Middleware) ID() string { + return "ResolveEndpointV2" +} + +func (m *resolveEndpointV2Middleware) HandleFinalize(ctx context.Context, in middleware.FinalizeInput, next middleware.FinalizeHandler) ( + out middleware.FinalizeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "ResolveEndpoint") + defer span.End() + + if awsmiddleware.GetRequiresLegacyEndpoints(ctx) { + return next.HandleFinalize(ctx, in) + } + + req, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, fmt.Errorf("unknown transport type %T", in.Request) + } + + if m.options.EndpointResolverV2 == nil { + return out, metadata, fmt.Errorf("expected endpoint resolver to not be nil") + } + + params := bindEndpointParams(ctx, getOperationInput(ctx), m.options) + endpt, err := timeOperationMetric(ctx, "client.call.resolve_endpoint_duration", + func() (smithyendpoints.Endpoint, error) { + return m.options.EndpointResolverV2.ResolveEndpoint(ctx, *params) + }) + if err != nil { + return out, metadata, fmt.Errorf("failed to resolve service endpoint, %w", err) + } + + span.SetProperty("client.call.resolved_endpoint", endpt.URI.String()) + + if endpt.URI.RawPath == "" && req.URL.RawPath != "" { + endpt.URI.RawPath = endpt.URI.Path + } + req.URL.Scheme = endpt.URI.Scheme + req.URL.Host = endpt.URI.Host + req.URL.Path = smithyhttp.JoinPath(endpt.URI.Path, req.URL.Path) + req.URL.RawPath = smithyhttp.JoinPath(endpt.URI.RawPath, req.URL.RawPath) + for k := range endpt.Headers { + req.Header.Set(k, endpt.Headers.Get(k)) + } + + rscheme := getResolvedAuthScheme(ctx) + if rscheme == nil { + return out, metadata, fmt.Errorf("no resolved auth scheme") + } + + opts, _ := smithyauth.GetAuthOptions(&endpt.Properties) + for _, o := range opts { + rscheme.SignerProperties.SetAll(&o.SignerProperties) + } + + span.End() + return next.HandleFinalize(ctx, in) +} diff --git a/service/notificationscontacts/endpoints_config_test.go b/service/notificationscontacts/endpoints_config_test.go new file mode 100644 index 00000000000..a3b7beaaded --- /dev/null +++ b/service/notificationscontacts/endpoints_config_test.go @@ -0,0 +1,139 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + "os" + "reflect" + "testing" +) + +type mockConfigSource struct { + global string + service string + ignore bool +} + +// GetIgnoreConfiguredEndpoints is used in knowing when to disable configured +// endpoints feature. +func (m mockConfigSource) GetIgnoreConfiguredEndpoints(context.Context) (bool, bool, error) { + return m.ignore, m.ignore, nil +} + +// GetServiceBaseEndpoint is used to retrieve a normalized SDK ID for use +// with configured endpoints. +func (m mockConfigSource) GetServiceBaseEndpoint(ctx context.Context, sdkID string) (string, bool, error) { + if m.service != "" { + return m.service, true, nil + } + return "", false, nil +} + +func TestResolveBaseEndpoint(t *testing.T) { + cases := map[string]struct { + envGlobal string + envService string + envIgnore bool + configGlobal string + configService string + configIgnore bool + clientEndpoint *string + expectURL *string + }{ + "env ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-notificationscontacts.dev", + envIgnore: true, + configGlobal: "http://config-global.dev", + configService: "http://config-notificationscontacts.dev", + expectURL: nil, + }, + "env global": { + envGlobal: "https://env-global.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-notificationscontacts.dev", + expectURL: aws.String("https://env-global.dev"), + }, + "env service": { + envGlobal: "https://env-global.dev", + envService: "https://env-notificationscontacts.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-notificationscontacts.dev", + expectURL: aws.String("https://env-notificationscontacts.dev"), + }, + "config ignore": { + envGlobal: "https://env-global.dev", + envService: "https://env-notificationscontacts.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-notificationscontacts.dev", + configIgnore: true, + expectURL: nil, + }, + "config global": { + configGlobal: "http://config-global.dev", + expectURL: aws.String("http://config-global.dev"), + }, + "config service": { + configGlobal: "http://config-global.dev", + configService: "http://config-notificationscontacts.dev", + expectURL: aws.String("http://config-notificationscontacts.dev"), + }, + "client": { + envGlobal: "https://env-global.dev", + envService: "https://env-notificationscontacts.dev", + configGlobal: "http://config-global.dev", + configService: "http://config-notificationscontacts.dev", + clientEndpoint: aws.String("https://client-notificationscontacts.dev"), + expectURL: aws.String("https://client-notificationscontacts.dev"), + }, + } + + for name, c := range cases { + t.Run(name, func(t *testing.T) { + os.Clearenv() + + awsConfig := aws.Config{} + ignore := c.envIgnore || c.configIgnore + + if c.configGlobal != "" && !ignore { + awsConfig.BaseEndpoint = aws.String(c.configGlobal) + } + + if c.envGlobal != "" { + t.Setenv("AWS_ENDPOINT_URL", c.envGlobal) + if !ignore { + awsConfig.BaseEndpoint = aws.String(c.envGlobal) + } + } + + if c.envService != "" { + t.Setenv("AWS_ENDPOINT_URL_NOTIFICATIONSCONTACTS", c.envService) + } + + awsConfig.ConfigSources = []interface{}{ + mockConfigSource{ + global: c.envGlobal, + service: c.envService, + ignore: c.envIgnore, + }, + mockConfigSource{ + global: c.configGlobal, + service: c.configService, + ignore: c.configIgnore, + }, + } + + client := NewFromConfig(awsConfig, func(o *Options) { + if c.clientEndpoint != nil { + o.BaseEndpoint = c.clientEndpoint + } + }) + + if e, a := c.expectURL, client.options.BaseEndpoint; !reflect.DeepEqual(e, a) { + t.Errorf("expect endpoint %v , got %v", e, a) + } + }) + } +} diff --git a/service/notificationscontacts/endpoints_test.go b/service/notificationscontacts/endpoints_test.go new file mode 100644 index 00000000000..78b2eba608a --- /dev/null +++ b/service/notificationscontacts/endpoints_test.go @@ -0,0 +1,774 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + smithy "github.com/aws/smithy-go" + smithyauth "github.com/aws/smithy-go/auth" + smithyendpoints "github.com/aws/smithy-go/endpoints" + "github.com/aws/smithy-go/ptr" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" + "net/url" + "reflect" + "strings" + "testing" +) + +// For custom endpoint with region not set and fips disabled +func TestEndpointCase0(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://example.com") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: smithy.Properties{}, + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For custom endpoint with fips enabled +func TestEndpointCase1(t *testing.T) { + var params = EndpointParameters{ + Endpoint: ptr.String("https://example.com"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: FIPS and custom endpoint are not supported", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} + +// For region us-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase2(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts-fips.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase3(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-east-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts.us-east-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS enabled and DualStack enabled +func TestEndpointCase4(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts-fips.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region cn-northwest-1 with FIPS disabled and DualStack enabled +func TestEndpointCase5(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("cn-northwest-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts.cn-northwest-1.api.amazonwebservices.com.cn") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "cn-northwest-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase6(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts-fips.us-gov-west-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-gov-west-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-gov-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase7(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-gov-west-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts.us-gov-west-1.api.aws") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-gov-west-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase8(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts-fips.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-iso-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-iso-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase9(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-iso-east-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts.us-iso-east-1.c2s.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-iso-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS enabled and DualStack enabled +func TestEndpointCase10(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts-fips.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-isob-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isob-east-1 with FIPS disabled and DualStack enabled +func TestEndpointCase11(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isob-east-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts.us-isob-east-1.sc2s.sgov.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-isob-east-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS enabled and DualStack enabled +func TestEndpointCase12(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts-fips.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "eu-isoe-west-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region eu-isoe-west-1 with FIPS disabled and DualStack enabled +func TestEndpointCase13(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("eu-isoe-west-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts.eu-isoe-west-1.cloud.adc-e.uk") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "eu-isoe-west-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS enabled and DualStack enabled +func TestEndpointCase14(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(true), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts-fips.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-isof-south-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// For region us-isof-south-1 with FIPS disabled and DualStack enabled +func TestEndpointCase15(t *testing.T) { + var params = EndpointParameters{ + Region: ptr.String("us-isof-south-1"), + UseFIPS: ptr.Bool(false), + } + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err != nil { + t.Fatalf("expect no error, got %v", err) + } + + uri, _ := url.Parse("https://notifications-contacts.us-isof-south-1.csp.hci.ic.gov") + + expectEndpoint := smithyendpoints.Endpoint{ + URI: *uri, + Headers: http.Header{}, + Properties: func() smithy.Properties { + var out smithy.Properties + smithyauth.SetAuthOptions(&out, []*smithyauth.Option{ + { + SchemeID: "aws.auth#sigv4", + SignerProperties: func() smithy.Properties { + var sp smithy.Properties + smithyhttp.SetSigV4SigningRegion(&sp, "us-isof-south-1") + return sp + }(), + }, + }) + return out + }(), + } + + if e, a := expectEndpoint.URI, result.URI; e != a { + t.Errorf("expect %v URI, got %v", e, a) + } + + if !reflect.DeepEqual(expectEndpoint.Headers, result.Headers) { + t.Errorf("expect headers to match\n%v != %v", expectEndpoint.Headers, result.Headers) + } + + if !reflect.DeepEqual(expectEndpoint.Properties, result.Properties) { + t.Errorf("expect properties to match\n%v != %v", expectEndpoint.Properties, result.Properties) + } +} + +// Missing region +func TestEndpointCase16(t *testing.T) { + var params = EndpointParameters{} + + resolver := NewDefaultEndpointResolverV2() + result, err := resolver.ResolveEndpoint(context.Background(), params) + _, _ = result, err + + if err == nil { + t.Fatalf("expect error, got none") + } + if e, a := "Invalid Configuration: Missing Region", err.Error(); !strings.Contains(a, e) { + t.Errorf("expect %v error in %v", e, a) + } +} diff --git a/service/notificationscontacts/generated.json b/service/notificationscontacts/generated.json new file mode 100644 index 00000000000..2204dba057d --- /dev/null +++ b/service/notificationscontacts/generated.json @@ -0,0 +1,41 @@ +{ + "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_ActivateEmailContact.go", + "api_op_CreateEmailContact.go", + "api_op_DeleteEmailContact.go", + "api_op_GetEmailContact.go", + "api_op_ListEmailContacts.go", + "api_op_ListTagsForResource.go", + "api_op_SendActivationCode.go", + "api_op_TagResource.go", + "api_op_UntagResource.go", + "auth.go", + "deserializers.go", + "doc.go", + "endpoints.go", + "endpoints_config_test.go", + "endpoints_test.go", + "generated.json", + "internal/endpoints/endpoints.go", + "internal/endpoints/endpoints_test.go", + "options.go", + "protocol_test.go", + "serializers.go", + "snapshot_test.go", + "types/enums.go", + "types/errors.go", + "types/types.go", + "validators.go" + ], + "go": "1.15", + "module": "github.com/aws/aws-sdk-go-v2/service/notificationscontacts", + "unstable": false +} diff --git a/service/notificationscontacts/go.mod b/service/notificationscontacts/go.mod new file mode 100644 index 00000000000..61ea4b77e4d --- /dev/null +++ b/service/notificationscontacts/go.mod @@ -0,0 +1,16 @@ +module github.com/aws/aws-sdk-go-v2/service/notificationscontacts + +go 1.21 + +require ( + github.com/aws/aws-sdk-go-v2 v1.32.5 + github.com/aws/aws-sdk-go-v2/internal/configsources v1.3.24 + github.com/aws/aws-sdk-go-v2/internal/endpoints/v2 v2.6.24 + github.com/aws/smithy-go v1.22.1 +) + +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/notificationscontacts/go.sum b/service/notificationscontacts/go.sum new file mode 100644 index 00000000000..bd2678891af --- /dev/null +++ b/service/notificationscontacts/go.sum @@ -0,0 +1,2 @@ +github.com/aws/smithy-go v1.22.1 h1:/HPHZQ0g7f4eUeK6HKglFz8uwVfZKgoI25rb/J+dnro= +github.com/aws/smithy-go v1.22.1/go.mod h1:irrKGvNn1InZwb2d7fkIRNucdfwR8R+Ts3wxYa/cJHg= diff --git a/service/notificationscontacts/go_module_metadata.go b/service/notificationscontacts/go_module_metadata.go new file mode 100644 index 00000000000..97430388362 --- /dev/null +++ b/service/notificationscontacts/go_module_metadata.go @@ -0,0 +1,6 @@ +// Code generated by internal/repotools/cmd/updatemodulemeta DO NOT EDIT. + +package notificationscontacts + +// goModuleVersion is the tagged release for this module +const goModuleVersion = "tip" diff --git a/service/notificationscontacts/internal/endpoints/endpoints.go b/service/notificationscontacts/internal/endpoints/endpoints.go new file mode 100644 index 00000000000..2e617965414 --- /dev/null +++ b/service/notificationscontacts/internal/endpoints/endpoints.go @@ -0,0 +1,307 @@ +// 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 NotificationsContacts endpoint resolver +type Resolver struct { + partitions endpoints.Partitions +} + +// ResolveEndpoint resolves the service endpoint for the given region and options +func (r *Resolver) ResolveEndpoint(region string, options Options) (endpoint aws.Endpoint, err error) { + if len(region) == 0 { + return endpoint, &aws.MissingRegionError{} + } + + opt := transformToSharedOptions(options) + return r.partitions.ResolveEndpoint(region, opt) +} + +// New returns a new Resolver +func New() *Resolver { + return &Resolver{ + partitions: defaultPartitions, + } +} + +var partitionRegexp = struct { + Aws *regexp.Regexp + AwsCn *regexp.Regexp + AwsIso *regexp.Regexp + AwsIsoB *regexp.Regexp + AwsIsoE *regexp.Regexp + AwsIsoF *regexp.Regexp + AwsUsGov *regexp.Regexp +}{ + + Aws: regexp.MustCompile("^(us|eu|ap|sa|ca|me|af|il|mx)\\-\\w+\\-\\d+$"), + AwsCn: regexp.MustCompile("^cn\\-\\w+\\-\\d+$"), + AwsIso: regexp.MustCompile("^us\\-iso\\-\\w+\\-\\d+$"), + AwsIsoB: regexp.MustCompile("^us\\-isob\\-\\w+\\-\\d+$"), + AwsIsoE: regexp.MustCompile("^eu\\-isoe\\-\\w+\\-\\d+$"), + AwsIsoF: regexp.MustCompile("^us\\-isof\\-\\w+\\-\\d+$"), + AwsUsGov: regexp.MustCompile("^us\\-gov\\-\\w+\\-\\d+$"), +} + +var defaultPartitions = endpoints.Partitions{ + { + ID: "aws", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "notifications-contacts.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-contacts-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "notifications-contacts-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications-contacts.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.Aws, + IsRegionalized: false, + PartitionEndpoint: "aws-global", + Endpoints: endpoints.Endpoints{ + endpoints.EndpointKey{ + Region: "aws-global", + }: endpoints.Endpoint{ + Hostname: "notifications-contacts.us-east-1.api.aws", + CredentialScope: endpoints.CredentialScope{ + Region: "us-east-1", + }, + }, + }, + }, + { + ID: "aws-cn", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "notifications-contacts.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-contacts-fips.{region}.amazonaws.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "notifications-contacts-fips.{region}.api.amazonwebservices.com.cn", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications-contacts.{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: "notifications-contacts-fips.{region}.c2s.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications-contacts.{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: "notifications-contacts-fips.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications-contacts.{region}.sc2s.sgov.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoB, + IsRegionalized: true, + }, + { + ID: "aws-iso-e", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-contacts-fips.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications-contacts.{region}.cloud.adc-e.uk", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoE, + IsRegionalized: true, + }, + { + ID: "aws-iso-f", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-contacts-fips.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications-contacts.{region}.csp.hci.ic.gov", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsIsoF, + IsRegionalized: true, + }, + { + ID: "aws-us-gov", + Defaults: map[endpoints.DefaultKey]endpoints.Endpoint{ + { + Variant: endpoints.DualStackVariant, + }: { + Hostname: "notifications-contacts.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant, + }: { + Hostname: "notifications-contacts-fips.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "notifications-contacts-fips.{region}.api.aws", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + { + Variant: 0, + }: { + Hostname: "notifications-contacts.{region}.amazonaws.com", + Protocols: []string{"https"}, + SignatureVersions: []string{"v4"}, + }, + }, + RegionRegex: partitionRegexp.AwsUsGov, + IsRegionalized: true, + }, +} diff --git a/service/notificationscontacts/internal/endpoints/endpoints_test.go b/service/notificationscontacts/internal/endpoints/endpoints_test.go new file mode 100644 index 00000000000..08e5da2d833 --- /dev/null +++ b/service/notificationscontacts/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/notificationscontacts/options.go b/service/notificationscontacts/options.go new file mode 100644 index 00000000000..3693e2bad85 --- /dev/null +++ b/service/notificationscontacts/options.go @@ -0,0 +1,232 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "github.com/aws/aws-sdk-go-v2/aws" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + internalauthsmithy "github.com/aws/aws-sdk-go-v2/internal/auth/smithy" + smithyauth "github.com/aws/smithy-go/auth" + "github.com/aws/smithy-go/logging" + "github.com/aws/smithy-go/metrics" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" + "net/http" +) + +type HTTPClient interface { + Do(*http.Request) (*http.Response, error) +} + +type Options struct { + // Set of options to modify how an operation is invoked. These apply to all + // operations invoked for this client. Use functional options on operation call to + // modify this list for per operation behavior. + APIOptions []func(*middleware.Stack) error + + // The optional application specific identifier appended to the User-Agent header. + AppID string + + // This endpoint will be given as input to an EndpointResolverV2. It is used for + // providing a custom base endpoint that is subject to modifications by the + // processing EndpointResolverV2. + BaseEndpoint *string + + // Configures the events that will be sent to the configured logger. + ClientLogMode aws.ClientLogMode + + // The credentials object to use when signing requests. + Credentials aws.CredentialsProvider + + // The configuration DefaultsMode that the SDK should use when constructing the + // clients initial default settings. + DefaultsMode aws.DefaultsMode + + // The endpoint options to be used when attempting to resolve an endpoint. + EndpointOptions EndpointResolverOptions + + // The service endpoint resolver. + // + // Deprecated: Deprecated: EndpointResolver and WithEndpointResolver. Providing a + // value for this field will likely prevent you from using any endpoint-related + // service features released after the introduction of EndpointResolverV2 and + // BaseEndpoint. + // + // To migrate an EndpointResolver implementation that uses a custom endpoint, set + // the client option BaseEndpoint instead. + EndpointResolver EndpointResolver + + // Resolves the endpoint used for a particular service operation. This should be + // used over the deprecated EndpointResolver. + EndpointResolverV2 EndpointResolverV2 + + // Signature Version 4 (SigV4) Signer + HTTPSignerV4 HTTPSignerV4 + + // The logger writer interface to write logging messages to. + Logger logging.Logger + + // The client meter provider. + MeterProvider metrics.MeterProvider + + // The region to send requests to. (Required) + Region string + + // RetryMaxAttempts specifies the maximum number attempts an API client will call + // an operation that fails with a retryable error. A value of 0 is ignored, and + // will not be used to configure the API client created default retryer, or modify + // per operation call's retry max attempts. + // + // If specified in an operation call's functional options with a value that is + // different than the constructed client's Options, the Client's Retryer will be + // wrapped to use the operation's specific RetryMaxAttempts value. + RetryMaxAttempts int + + // RetryMode specifies the retry mode the API client will be created with, if + // Retryer option is not also specified. + // + // When creating a new API Clients this member will only be used if the Retryer + // Options member is nil. This value will be ignored if Retryer is not nil. + // + // Currently does not support per operation call overrides, may in the future. + RetryMode aws.RetryMode + + // Retryer guides how HTTP requests should be retried in case of recoverable + // failures. When nil the API client will use a default retryer. The kind of + // default retry created by the API client can be changed with the RetryMode + // option. + Retryer aws.Retryer + + // The RuntimeEnvironment configuration, only populated if the DefaultsMode is set + // to DefaultsModeAuto and is initialized using config.LoadDefaultConfig . You + // should not populate this structure programmatically, or rely on the values here + // within your applications. + RuntimeEnvironment aws.RuntimeEnvironment + + // The client tracer provider. + TracerProvider tracing.TracerProvider + + // The initial DefaultsMode used when the client options were constructed. If the + // DefaultsMode was set to aws.DefaultsModeAuto this will store what the resolved + // value was at that point in time. + // + // Currently does not support per operation call overrides, may in the future. + resolvedDefaultsMode aws.DefaultsMode + + // The HTTP client to invoke API calls with. Defaults to client's default HTTP + // implementation if nil. + HTTPClient HTTPClient + + // The auth scheme resolver which determines how to authenticate for each + // operation. + AuthSchemeResolver AuthSchemeResolver + + // The list of auth schemes supported by the client. + AuthSchemes []smithyhttp.AuthScheme +} + +// Copy creates a clone where the APIOptions list is deep copied. +func (o Options) Copy() Options { + to := o + to.APIOptions = make([]func(*middleware.Stack) error, len(o.APIOptions)) + copy(to.APIOptions, o.APIOptions) + + return to +} + +func (o Options) GetIdentityResolver(schemeID string) smithyauth.IdentityResolver { + if schemeID == "aws.auth#sigv4" { + return getSigV4IdentityResolver(o) + } + if schemeID == "smithy.api#noAuth" { + return &smithyauth.AnonymousIdentityResolver{} + } + return nil +} + +// WithAPIOptions returns a functional option for setting the Client's APIOptions +// option. +func WithAPIOptions(optFns ...func(*middleware.Stack) error) func(*Options) { + return func(o *Options) { + o.APIOptions = append(o.APIOptions, optFns...) + } +} + +// Deprecated: EndpointResolver and WithEndpointResolver. Providing a value for +// this field will likely prevent you from using any endpoint-related service +// features released after the introduction of EndpointResolverV2 and BaseEndpoint. +// +// To migrate an EndpointResolver implementation that uses a custom endpoint, set +// the client option BaseEndpoint instead. +func WithEndpointResolver(v EndpointResolver) func(*Options) { + return func(o *Options) { + o.EndpointResolver = v + } +} + +// WithEndpointResolverV2 returns a functional option for setting the Client's +// EndpointResolverV2 option. +func WithEndpointResolverV2(v EndpointResolverV2) func(*Options) { + return func(o *Options) { + o.EndpointResolverV2 = v + } +} + +func getSigV4IdentityResolver(o Options) smithyauth.IdentityResolver { + if o.Credentials != nil { + return &internalauthsmithy.CredentialsProviderAdapter{Provider: o.Credentials} + } + return nil +} + +// WithSigV4SigningName applies an override to the authentication workflow to +// use the given signing name for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing name from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningName(name string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningName(ctx, name), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningName", fn), + middleware.Before, + ) + }) + } +} + +// WithSigV4SigningRegion applies an override to the authentication workflow to +// use the given signing region for SigV4-authenticated operations. +// +// This is an advanced setting. The value here is FINAL, taking precedence over +// the resolved signing region from both auth scheme resolution and endpoint +// resolution. +func WithSigV4SigningRegion(region string) func(*Options) { + fn := func(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, + ) { + return next.HandleInitialize(awsmiddleware.SetSigningRegion(ctx, region), in) + } + return func(o *Options) { + o.APIOptions = append(o.APIOptions, func(s *middleware.Stack) error { + return s.Initialize.Add( + middleware.InitializeMiddlewareFunc("withSigV4SigningRegion", fn), + middleware.Before, + ) + }) + } +} + +func ignoreAnonymousAuth(options *Options) { + if aws.IsCredentialsProvider(options.Credentials, (*aws.AnonymousCredentials)(nil)) { + options.Credentials = nil + } +} diff --git a/service/notificationscontacts/protocol_test.go b/service/notificationscontacts/protocol_test.go new file mode 100644 index 00000000000..ec5a3b953b7 --- /dev/null +++ b/service/notificationscontacts/protocol_test.go @@ -0,0 +1,3 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts diff --git a/service/notificationscontacts/serializers.go b/service/notificationscontacts/serializers.go new file mode 100644 index 00000000000..80b45d7b3f3 --- /dev/null +++ b/service/notificationscontacts/serializers.go @@ -0,0 +1,726 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "bytes" + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/encoding/httpbinding" + smithyjson "github.com/aws/smithy-go/encoding/json" + "github.com/aws/smithy-go/middleware" + "github.com/aws/smithy-go/tracing" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +type awsRestjson1_serializeOpActivateEmailContact struct { +} + +func (*awsRestjson1_serializeOpActivateEmailContact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpActivateEmailContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ActivateEmailContactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/emailcontacts/{arn}/activate/{code}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "PUT" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsActivateEmailContactInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsActivateEmailContactInput(v *ActivateEmailContactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if v.Code == nil || len(*v.Code) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member code must not be empty")} + } + if v.Code != nil { + if err := encoder.SetURI("code").String(*v.Code); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpCreateEmailContact struct { +} + +func (*awsRestjson1_serializeOpCreateEmailContact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCreateEmailContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CreateEmailContactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2022-09-19/emailcontacts") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCreateEmailContactInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCreateEmailContactInput(v *CreateEmailContactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCreateEmailContactInput(v *CreateEmailContactInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EmailAddress != nil { + ok := object.Key("emailAddress") + ok.String(*v.EmailAddress) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpDeleteEmailContact struct { +} + +func (*awsRestjson1_serializeOpDeleteEmailContact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDeleteEmailContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DeleteEmailContactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/emailcontacts/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsDeleteEmailContactInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDeleteEmailContactInput(v *DeleteEmailContactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpGetEmailContact struct { +} + +func (*awsRestjson1_serializeOpGetEmailContact) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetEmailContact) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetEmailContactInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/emailcontacts/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetEmailContactInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetEmailContactInput(v *GetEmailContactInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpListEmailContacts struct { +} + +func (*awsRestjson1_serializeOpListEmailContacts) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListEmailContacts) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListEmailContactsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/emailcontacts") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListEmailContactsInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListEmailContactsInput(v *ListEmailContactsInput, 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_serializeOpListTagsForResource struct { +} + +func (*awsRestjson1_serializeOpListTagsForResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListTagsForResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListTagsForResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListTagsForResourceInput(v *ListTagsForResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpSendActivationCode struct { +} + +func (*awsRestjson1_serializeOpSendActivationCode) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpSendActivationCode) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*SendActivationCodeInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/2022-10-31/emailcontacts/{arn}/activate/send") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsSendActivationCodeInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsSendActivationCodeInput(v *SendActivationCodeInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpTagResource struct { +} + +func (*awsRestjson1_serializeOpTagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpTagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*TagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsTagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentTagResourceInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsTagResourceInput(v *TagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + return nil +} + +func awsRestjson1_serializeOpDocumentTagResourceInput(v *TagResourceInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Tags != nil { + ok := object.Key("tags") + if err := awsRestjson1_serializeDocumentTagMap(v.Tags, ok); err != nil { + return err + } + } + + return nil +} + +type awsRestjson1_serializeOpUntagResource struct { +} + +func (*awsRestjson1_serializeOpUntagResource) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUntagResource) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UntagResourceInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/tags/{arn}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "DELETE" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsUntagResourceInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUntagResourceInput(v *UntagResourceInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.Arn == nil || len(*v.Arn) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member arn must not be empty")} + } + if v.Arn != nil { + if err := encoder.SetURI("arn").String(*v.Arn); err != nil { + return err + } + } + + if v.TagKeys != nil { + for i := range v.TagKeys { + encoder.AddQuery("tagKeys").String(v.TagKeys[i]) + } + } + + return nil +} + +func awsRestjson1_serializeDocumentTagMap(v map[string]string, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + for key := range v { + om := object.Key(key) + om.String(v[key]) + } + return nil +} diff --git a/service/notificationscontacts/snapshot/api_op_ActivateEmailContact.go.snap b/service/notificationscontacts/snapshot/api_op_ActivateEmailContact.go.snap new file mode 100644 index 00000000000..8a051264a0f --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_ActivateEmailContact.go.snap @@ -0,0 +1,41 @@ +ActivateEmailContact + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot/api_op_CreateEmailContact.go.snap b/service/notificationscontacts/snapshot/api_op_CreateEmailContact.go.snap new file mode 100644 index 00000000000..55ec4cb528d --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_CreateEmailContact.go.snap @@ -0,0 +1,41 @@ +CreateEmailContact + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot/api_op_DeleteEmailContact.go.snap b/service/notificationscontacts/snapshot/api_op_DeleteEmailContact.go.snap new file mode 100644 index 00000000000..3e458932680 --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_DeleteEmailContact.go.snap @@ -0,0 +1,41 @@ +DeleteEmailContact + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot/api_op_GetEmailContact.go.snap b/service/notificationscontacts/snapshot/api_op_GetEmailContact.go.snap new file mode 100644 index 00000000000..a4ce23d23de --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_GetEmailContact.go.snap @@ -0,0 +1,41 @@ +GetEmailContact + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot/api_op_ListEmailContacts.go.snap b/service/notificationscontacts/snapshot/api_op_ListEmailContacts.go.snap new file mode 100644 index 00000000000..02158e576d4 --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_ListEmailContacts.go.snap @@ -0,0 +1,40 @@ +ListEmailContacts + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot/api_op_ListTagsForResource.go.snap b/service/notificationscontacts/snapshot/api_op_ListTagsForResource.go.snap new file mode 100644 index 00000000000..071d3ac4e96 --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_ListTagsForResource.go.snap @@ -0,0 +1,41 @@ +ListTagsForResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot/api_op_SendActivationCode.go.snap b/service/notificationscontacts/snapshot/api_op_SendActivationCode.go.snap new file mode 100644 index 00000000000..6c06b2f7eb4 --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_SendActivationCode.go.snap @@ -0,0 +1,41 @@ +SendActivationCode + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot/api_op_TagResource.go.snap b/service/notificationscontacts/snapshot/api_op_TagResource.go.snap new file mode 100644 index 00000000000..ae6f8e0846c --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_TagResource.go.snap @@ -0,0 +1,41 @@ +TagResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot/api_op_UntagResource.go.snap b/service/notificationscontacts/snapshot/api_op_UntagResource.go.snap new file mode 100644 index 00000000000..c7bbe038d98 --- /dev/null +++ b/service/notificationscontacts/snapshot/api_op_UntagResource.go.snap @@ -0,0 +1,41 @@ +UntagResource + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/notificationscontacts/snapshot_test.go b/service/notificationscontacts/snapshot_test.go new file mode 100644 index 00000000000..c3e2acb395d --- /dev/null +++ b/service/notificationscontacts/snapshot_test.go @@ -0,0 +1,278 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +//go:build snapshot + +package notificationscontacts + +import ( + "context" + "errors" + "fmt" + "github.com/aws/smithy-go/middleware" + "io" + "io/fs" + "os" + "testing" +) + +const ssprefix = "snapshot" + +type snapshotOK struct{} + +func (snapshotOK) Error() string { return "error: success" } + +func createp(path string) (*os.File, error) { + if err := os.Mkdir(ssprefix, 0700); err != nil && !errors.Is(err, fs.ErrExist) { + return nil, err + } + return os.Create(path) +} + +func sspath(op string) string { + return fmt.Sprintf("%s/api_op_%s.go.snap", ssprefix, op) +} + +func updateSnapshot(stack *middleware.Stack, operation string) error { + f, err := createp(sspath(operation)) + if err != nil { + return err + } + defer f.Close() + if _, err := f.Write([]byte(stack.String())); err != nil { + return err + } + return snapshotOK{} +} + +func testSnapshot(stack *middleware.Stack, operation string) error { + f, err := os.Open(sspath(operation)) + if errors.Is(err, fs.ErrNotExist) { + return snapshotOK{} + } + if err != nil { + return err + } + defer f.Close() + expected, err := io.ReadAll(f) + if err != nil { + return err + } + if actual := stack.String(); actual != string(expected) { + return fmt.Errorf("%s != %s", expected, actual) + } + return snapshotOK{} +} +func TestCheckSnapshot_ActivateEmailContact(t *testing.T) { + svc := New(Options{}) + _, err := svc.ActivateEmailContact(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ActivateEmailContact") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_CreateEmailContact(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateEmailContact(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CreateEmailContact") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_DeleteEmailContact(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteEmailContact(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DeleteEmailContact") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_GetEmailContact(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetEmailContact(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetEmailContact") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListEmailContacts(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListEmailContacts(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListEmailContacts") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_SendActivationCode(t *testing.T) { + svc := New(Options{}) + _, err := svc.SendActivationCode(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "SendActivationCode") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} +func TestUpdateSnapshot_ActivateEmailContact(t *testing.T) { + svc := New(Options{}) + _, err := svc.ActivateEmailContact(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ActivateEmailContact") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_CreateEmailContact(t *testing.T) { + svc := New(Options{}) + _, err := svc.CreateEmailContact(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CreateEmailContact") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_DeleteEmailContact(t *testing.T) { + svc := New(Options{}) + _, err := svc.DeleteEmailContact(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DeleteEmailContact") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_GetEmailContact(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetEmailContact(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetEmailContact") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListEmailContacts(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListEmailContacts(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListEmailContacts") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListTagsForResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_SendActivationCode(t *testing.T) { + svc := New(Options{}) + _, err := svc.SendActivationCode(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "SendActivationCode") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_TagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.TagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "TagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_UntagResource(t *testing.T) { + svc := New(Options{}) + _, err := svc.UntagResource(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UntagResource") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/notificationscontacts/types/enums.go b/service/notificationscontacts/types/enums.go new file mode 100644 index 00000000000..bfa6ff0562f --- /dev/null +++ b/service/notificationscontacts/types/enums.go @@ -0,0 +1,41 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +type EmailContactStatus string + +// Enum values for EmailContactStatus +const ( + EmailContactStatusInactive EmailContactStatus = "inactive" + EmailContactStatusActive EmailContactStatus = "active" +) + +// Values returns all known values for EmailContactStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (EmailContactStatus) Values() []EmailContactStatus { + return []EmailContactStatus{ + "inactive", + "active", + } +} + +type ValidationExceptionReason string + +// Enum values for ValidationExceptionReason +const ( + ValidationExceptionReasonFieldValidationFailed ValidationExceptionReason = "fieldValidationFailed" + ValidationExceptionReasonOther ValidationExceptionReason = "other" +) + +// Values returns all known values for ValidationExceptionReason. Note that this +// can be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ValidationExceptionReason) Values() []ValidationExceptionReason { + return []ValidationExceptionReason{ + "fieldValidationFailed", + "other", + } +} diff --git a/service/notificationscontacts/types/errors.go b/service/notificationscontacts/types/errors.go new file mode 100644 index 00000000000..d550bf581fa --- /dev/null +++ b/service/notificationscontacts/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" +) + +// You do not have sufficient access to perform this action. +type AccessDeniedException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *AccessDeniedException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *AccessDeniedException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *AccessDeniedException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "AccessDeniedException" + } + return *e.ErrorCodeOverride +} +func (e *AccessDeniedException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Updating or deleting a resource can cause an inconsistent state. +type ConflictException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + + noSmithyDocumentSerde +} + +func (e *ConflictException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ConflictException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ConflictException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ConflictException" + } + return *e.ErrorCodeOverride +} +func (e *ConflictException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Unexpected error during processing of request. +type InternalServerException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InternalServerException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InternalServerException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InternalServerException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InternalServerException" + } + return *e.ErrorCodeOverride +} +func (e *InternalServerException) ErrorFault() smithy.ErrorFault { return smithy.FaultServer } + +// Your request references a resource which does not exist. +type ResourceNotFoundException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + + noSmithyDocumentSerde +} + +func (e *ResourceNotFoundException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ResourceNotFoundException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ResourceNotFoundException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ResourceNotFoundException" + } + return *e.ErrorCodeOverride +} +func (e *ResourceNotFoundException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// Request would cause a service quota to be exceeded. +type ServiceQuotaExceededException struct { + Message *string + + ErrorCodeOverride *string + + ResourceId *string + ResourceType *string + ServiceCode *string + QuotaCode *string + + noSmithyDocumentSerde +} + +func (e *ServiceQuotaExceededException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ServiceQuotaExceededException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ServiceQuotaExceededException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ServiceQuotaExceededException" + } + return *e.ErrorCodeOverride +} +func (e *ServiceQuotaExceededException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request was denied due to request throttling. +type ThrottlingException struct { + Message *string + + ErrorCodeOverride *string + + ServiceCode *string + QuotaCode *string + RetryAfterSeconds *int32 + + noSmithyDocumentSerde +} + +func (e *ThrottlingException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ThrottlingException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ThrottlingException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ThrottlingException" + } + return *e.ErrorCodeOverride +} +func (e *ThrottlingException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The input fails to satisfy the constraints specified by an AWS service. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + Reason ValidationExceptionReason + FieldList []ValidationExceptionField + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/notificationscontacts/types/types.go b/service/notificationscontacts/types/types.go new file mode 100644 index 00000000000..478707a40ac --- /dev/null +++ b/service/notificationscontacts/types/types.go @@ -0,0 +1,64 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types + +import ( + smithydocument "github.com/aws/smithy-go/document" + "time" +) + +// An email contact. +type EmailContact struct { + + // The email address this email contact points to. The activation email and any + // subscribed emails are sent here. + // + // This member is required. + Address *string + + // The Amazon Resource Name (ARN) of the email contact. + // + // This member is required. + Arn *string + + // The creation time of the resource. + // + // This member is required. + CreationTime *time.Time + + // The name of the email contact. + // + // This member is required. + Name *string + + // The status of the email contact. Only activated email contacts receive emails. + // + // This member is required. + Status EmailContactStatus + + // The time the resource was last updated. + // + // This member is required. + UpdateTime *time.Time + + noSmithyDocumentSerde +} + +// Stores information about a field passed inside a request that resulted in an +// exception. +type ValidationExceptionField struct { + + // A message with the reason for the validation exception error. + // + // This member is required. + Message *string + + // The field name where the invalid entry was detected. + // + // This member is required. + Name *string + + noSmithyDocumentSerde +} + +type noSmithyDocumentSerde = smithydocument.NoSerde diff --git a/service/notificationscontacts/validators.go b/service/notificationscontacts/validators.go new file mode 100644 index 00000000000..b6fdaf37b37 --- /dev/null +++ b/service/notificationscontacts/validators.go @@ -0,0 +1,334 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package notificationscontacts + +import ( + "context" + "fmt" + smithy "github.com/aws/smithy-go" + "github.com/aws/smithy-go/middleware" +) + +type validateOpActivateEmailContact struct { +} + +func (*validateOpActivateEmailContact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpActivateEmailContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ActivateEmailContactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpActivateEmailContactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpCreateEmailContact struct { +} + +func (*validateOpCreateEmailContact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCreateEmailContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CreateEmailContactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCreateEmailContactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpDeleteEmailContact struct { +} + +func (*validateOpDeleteEmailContact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDeleteEmailContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DeleteEmailContactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDeleteEmailContactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpGetEmailContact struct { +} + +func (*validateOpGetEmailContact) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetEmailContact) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetEmailContactInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetEmailContactInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListTagsForResource struct { +} + +func (*validateOpListTagsForResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListTagsForResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListTagsForResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListTagsForResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpSendActivationCode struct { +} + +func (*validateOpSendActivationCode) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpSendActivationCode) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*SendActivationCodeInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpSendActivationCodeInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpTagResource struct { +} + +func (*validateOpTagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpTagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*TagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpTagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpUntagResource struct { +} + +func (*validateOpUntagResource) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UntagResourceInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUntagResourceInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +func addOpActivateEmailContactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpActivateEmailContact{}, middleware.After) +} + +func addOpCreateEmailContactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCreateEmailContact{}, middleware.After) +} + +func addOpDeleteEmailContactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDeleteEmailContact{}, middleware.After) +} + +func addOpGetEmailContactValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetEmailContact{}, middleware.After) +} + +func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) +} + +func addOpSendActivationCodeValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpSendActivationCode{}, middleware.After) +} + +func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) +} + +func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) +} + +func validateOpActivateEmailContactInput(v *ActivateEmailContactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ActivateEmailContactInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.Code == nil { + invalidParams.Add(smithy.NewErrParamRequired("Code")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpCreateEmailContactInput(v *CreateEmailContactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CreateEmailContactInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.EmailAddress == nil { + invalidParams.Add(smithy.NewErrParamRequired("EmailAddress")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpDeleteEmailContactInput(v *DeleteEmailContactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DeleteEmailContactInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpGetEmailContactInput(v *GetEmailContactInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetEmailContactInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListTagsForResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpSendActivationCodeInput(v *SendActivationCodeInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SendActivationCodeInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpTagResourceInput(v *TagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "TagResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.Tags == nil { + invalidParams.Add(smithy.NewErrParamRequired("Tags")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpUntagResourceInput(v *UntagResourceInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UntagResourceInput"} + if v.Arn == nil { + invalidParams.Add(smithy.NewErrParamRequired("Arn")) + } + if v.TagKeys == nil { + invalidParams.Add(smithy.NewErrParamRequired("TagKeys")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} diff --git a/service/polly/internal/endpoints/endpoints.go b/service/polly/internal/endpoints/endpoints.go index 5972e78e3d2..a356b99c0b4 100644 --- a/service/polly/internal/endpoints/endpoints.go +++ b/service/polly/internal/endpoints/endpoints.go @@ -142,45 +142,129 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "af-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "af-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.af-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.ap-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.ap-northeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.ap-northeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ap-northeast-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-northeast-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.ap-northeast-3.api.aws", + }, endpoints.EndpointKey{ Region: "ap-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.ap-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.ap-southeast-1.api.aws", + }, endpoints.EndpointKey{ Region: "ap-southeast-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ap-southeast-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.ap-southeast-2.api.aws", + }, endpoints.EndpointKey{ Region: "ca-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "ca-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.ca-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-central-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-central-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.eu-central-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-north-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-north-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.eu-north-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.eu-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-2", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.eu-west-2.api.aws", + }, endpoints.EndpointKey{ Region: "eu-west-3", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "eu-west-3", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.eu-west-3.api.aws", + }, endpoints.EndpointKey{ Region: "fips-us-east-1", }: endpoints.Endpoint{ @@ -220,9 +304,21 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "me-south-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "me-south-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.me-south-1.api.aws", + }, endpoints.EndpointKey{ Region: "sa-east-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "sa-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.sa-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-1", }: endpoints.Endpoint{}, @@ -232,6 +328,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "polly-fips.us-east-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "polly-fips.us-east-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.us-east-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-east-2", }: endpoints.Endpoint{}, @@ -241,6 +349,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "polly-fips.us-east-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "polly-fips.us-east-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-east-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.us-east-2.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-1", }: endpoints.Endpoint{}, @@ -250,6 +370,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "polly-fips.us-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "polly-fips.us-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.us-west-1.api.aws", + }, endpoints.EndpointKey{ Region: "us-west-2", }: endpoints.Endpoint{}, @@ -259,6 +391,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "polly-fips.us-west-2.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "polly-fips.us-west-2.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-west-2", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.us-west-2.api.aws", + }, }, }, { @@ -299,6 +443,12 @@ var defaultPartitions = endpoints.Partitions{ endpoints.EndpointKey{ Region: "cn-northwest-1", }: endpoints.Endpoint{}, + endpoints.EndpointKey{ + Region: "cn-northwest-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.cn-northwest-1.api.amazonwebservices.com.cn", + }, }, }, { @@ -438,6 +588,18 @@ var defaultPartitions = endpoints.Partitions{ }: { Hostname: "polly-fips.us-gov-west-1.amazonaws.com", }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.FIPSVariant | endpoints.DualStackVariant, + }: { + Hostname: "polly-fips.us-gov-west-1.api.aws", + }, + endpoints.EndpointKey{ + Region: "us-gov-west-1", + Variant: endpoints.DualStackVariant, + }: { + Hostname: "polly.us-gov-west-1.api.aws", + }, }, }, } diff --git a/service/resiliencehub/api_op_AcceptResourceGroupingRecommendations.go b/service/resiliencehub/api_op_AcceptResourceGroupingRecommendations.go index 3e87af385c3..ef2e540581b 100644 --- a/service/resiliencehub/api_op_AcceptResourceGroupingRecommendations.go +++ b/service/resiliencehub/api_op_AcceptResourceGroupingRecommendations.go @@ -40,8 +40,8 @@ type AcceptResourceGroupingRecommendationsInput struct { // This member is required. AppArn *string - // Indicates the list of resource grouping recommendations you want to include in - // your application. + // List of resource grouping recommendations you want to include in your + // application. // // This member is required. Entries []types.AcceptGroupingRecommendationEntry @@ -61,8 +61,8 @@ type AcceptResourceGroupingRecommendationsOutput struct { // This member is required. AppArn *string - // Indicates the list of resource grouping recommendations that could not be - // included in your application. + // List of resource grouping recommendations that could not be included in your + // application. // // This member is required. FailedEntries []types.FailedGroupingRecommendationEntry diff --git a/service/resiliencehub/api_op_CreateResiliencyPolicy.go b/service/resiliencehub/api_op_CreateResiliencyPolicy.go index 1eafe44fef6..b39fe666f56 100644 --- a/service/resiliencehub/api_op_CreateResiliencyPolicy.go +++ b/service/resiliencehub/api_op_CreateResiliencyPolicy.go @@ -42,7 +42,7 @@ type CreateResiliencyPolicyInput struct { // This member is required. Policy map[string]types.FailurePolicy - // The name of the policy + // Name of the resiliency policy. // // This member is required. PolicyName *string @@ -62,7 +62,7 @@ type CreateResiliencyPolicyInput struct { // resilience policy data can be stored. DataLocationConstraint types.DataLocationConstraint - // The description for the policy. + // Description of the resiliency policy. PolicyDescription *string // Tags assigned to the resource. A tag is a label that you assign to an Amazon diff --git a/service/resiliencehub/api_op_DescribeMetricsExport.go b/service/resiliencehub/api_op_DescribeMetricsExport.go new file mode 100644 index 00000000000..f29ed32861a --- /dev/null +++ b/service/resiliencehub/api_op_DescribeMetricsExport.go @@ -0,0 +1,170 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Describes the metrics of the application configuration being exported. +func (c *Client) DescribeMetricsExport(ctx context.Context, params *DescribeMetricsExportInput, optFns ...func(*Options)) (*DescribeMetricsExportOutput, error) { + if params == nil { + params = &DescribeMetricsExportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "DescribeMetricsExport", params, optFns, c.addOperationDescribeMetricsExportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*DescribeMetricsExportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type DescribeMetricsExportInput struct { + + // Identifier of the metrics export task. + // + // This member is required. + MetricsExportId *string + + noSmithyDocumentSerde +} + +type DescribeMetricsExportOutput struct { + + // Identifier for the metrics export task. + // + // This member is required. + MetricsExportId *string + + // Indicates the status of the metrics export task. + // + // This member is required. + Status types.MetricsExportStatusType + + // Explains the error that occurred while exporting the metrics. + ErrorMessage *string + + // Specifies the name of the Amazon S3 bucket where the exported metrics is stored. + ExportLocation *types.S3Location + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationDescribeMetricsExportMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpDescribeMetricsExport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpDescribeMetricsExport{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "DescribeMetricsExport"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpDescribeMetricsExportValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opDescribeMetricsExport(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opDescribeMetricsExport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "DescribeMetricsExport", + } +} diff --git a/service/resiliencehub/api_op_DescribeResourceGroupingRecommendationTask.go b/service/resiliencehub/api_op_DescribeResourceGroupingRecommendationTask.go index 4fd39f3fec2..35c555c2920 100644 --- a/service/resiliencehub/api_op_DescribeResourceGroupingRecommendationTask.go +++ b/service/resiliencehub/api_op_DescribeResourceGroupingRecommendationTask.go @@ -40,7 +40,7 @@ type DescribeResourceGroupingRecommendationTaskInput struct { // This member is required. AppArn *string - // Indicates the identifier of the grouping recommendation task. + // Identifier of the grouping recommendation task. GroupingId *string noSmithyDocumentSerde @@ -48,7 +48,7 @@ type DescribeResourceGroupingRecommendationTaskInput struct { type DescribeResourceGroupingRecommendationTaskOutput struct { - // Indicates the identifier of the grouping recommendation task. + // Identifier of the grouping recommendation task. // // This member is required. GroupingId *string @@ -58,7 +58,7 @@ type DescribeResourceGroupingRecommendationTaskOutput struct { // This member is required. Status types.ResourcesGroupingRecGenStatusType - // Indicates the error that occurred while generating a grouping recommendation. + // Error that occurred while generating a grouping recommendation. ErrorMessage *string // Metadata pertaining to the operation's result. diff --git a/service/resiliencehub/api_op_ListAppAssessmentComplianceDrifts.go b/service/resiliencehub/api_op_ListAppAssessmentComplianceDrifts.go index d37cf018914..6abf082e372 100644 --- a/service/resiliencehub/api_op_ListAppAssessmentComplianceDrifts.go +++ b/service/resiliencehub/api_op_ListAppAssessmentComplianceDrifts.go @@ -11,8 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Indicates the list of compliance drifts that were detected while running an -// assessment. +// List of compliance drifts that were detected while running an assessment. func (c *Client) ListAppAssessmentComplianceDrifts(ctx context.Context, params *ListAppAssessmentComplianceDriftsInput, optFns ...func(*Options)) (*ListAppAssessmentComplianceDriftsOutput, error) { if params == nil { params = &ListAppAssessmentComplianceDriftsInput{} @@ -39,7 +38,7 @@ type ListAppAssessmentComplianceDriftsInput struct { // This member is required. AssessmentArn *string - // Indicates the maximum number of compliance drifts requested. + // Maximum number of compliance drifts requested. MaxResults *int32 // Null, or the token from a previous call to get the next set of results. @@ -168,7 +167,7 @@ func (c *Client) addOperationListAppAssessmentComplianceDriftsMiddlewares(stack // ListAppAssessmentComplianceDriftsPaginatorOptions is the paginator options for // ListAppAssessmentComplianceDrifts type ListAppAssessmentComplianceDriftsPaginatorOptions struct { - // Indicates the maximum number of compliance drifts requested. + // Maximum number of compliance drifts requested. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/resiliencehub/api_op_ListAppAssessmentResourceDrifts.go b/service/resiliencehub/api_op_ListAppAssessmentResourceDrifts.go index e2465504e93..18dfbd1d9cf 100644 --- a/service/resiliencehub/api_op_ListAppAssessmentResourceDrifts.go +++ b/service/resiliencehub/api_op_ListAppAssessmentResourceDrifts.go @@ -11,8 +11,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Indicates the list of resource drifts that were detected while running an -// assessment. +// List of resource drifts that were detected while running an assessment. func (c *Client) ListAppAssessmentResourceDrifts(ctx context.Context, params *ListAppAssessmentResourceDriftsInput, optFns ...func(*Options)) (*ListAppAssessmentResourceDriftsOutput, error) { if params == nil { params = &ListAppAssessmentResourceDriftsInput{} @@ -39,9 +38,9 @@ type ListAppAssessmentResourceDriftsInput struct { // This member is required. AssessmentArn *string - // Indicates the maximum number of drift results to include in the response. If - // more results exist than the specified MaxResults value, a token is included in - // the response so that the remaining results can be retrieved. + // Maximum number of drift results to include in the response. If more results + // exist than the specified MaxResults value, a token is included in the response + // so that the remaining results can be retrieved. MaxResults *int32 // Null, or the token from a previous call to get the next set of results. @@ -169,9 +168,9 @@ func (c *Client) addOperationListAppAssessmentResourceDriftsMiddlewares(stack *m // ListAppAssessmentResourceDriftsPaginatorOptions is the paginator options for // ListAppAssessmentResourceDrifts type ListAppAssessmentResourceDriftsPaginatorOptions struct { - // Indicates the maximum number of drift results to include in the response. If - // more results exist than the specified MaxResults value, a token is included in - // the response so that the remaining results can be retrieved. + // Maximum number of drift results to include in the response. If more results + // exist than the specified MaxResults value, a token is included in the response + // so that the remaining results can be retrieved. Limit int32 // Set to true if pagination should stop if the service returns a pagination token diff --git a/service/resiliencehub/api_op_ListApps.go b/service/resiliencehub/api_op_ListApps.go index 715a1f40fd5..ddab7191b28 100644 --- a/service/resiliencehub/api_op_ListApps.go +++ b/service/resiliencehub/api_op_ListApps.go @@ -52,8 +52,8 @@ type ListAppsInput struct { // [Amazon Resource Names (ARNs)]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html AwsApplicationArn *string - // Indicates the lower limit of the range that is used to filter applications - // based on their last assessment times. + // Lower limit of the range that is used to filter applications based on their + // last assessment times. FromLastAssessmentTime *time.Time // Maximum number of results to include in the response. If more results exist @@ -73,8 +73,8 @@ type ListAppsInput struct { // field to True . ReverseOrder *bool - // Indicates the upper limit of the range that is used to filter the applications - // based on their last assessment times. + // Upper limit of the range that is used to filter the applications based on their + // last assessment times. ToLastAssessmentTime *time.Time noSmithyDocumentSerde diff --git a/service/resiliencehub/api_op_ListMetrics.go b/service/resiliencehub/api_op_ListMetrics.go new file mode 100644 index 00000000000..cbeb9213cad --- /dev/null +++ b/service/resiliencehub/api_op_ListMetrics.go @@ -0,0 +1,272 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Lists the metrics that can be exported. +func (c *Client) ListMetrics(ctx context.Context, params *ListMetricsInput, optFns ...func(*Options)) (*ListMetricsOutput, error) { + if params == nil { + params = &ListMetricsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListMetrics", params, optFns, c.addOperationListMetricsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListMetricsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListMetricsInput struct { + + // Indicates the list of all the conditions that were applied on the metrics. + Conditions []types.Condition + + // Indicates the data source of the metrics. + DataSource *string + + // Indicates the list of fields in the data source. + Fields []types.Field + + // Maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so + // that the remaining results can be retrieved. + MaxResults *int32 + + // Null, or the token from a previous call to get the next set of results. + NextToken *string + + // (Optional) Indicates the order in which you want to sort the fields in the + // metrics. By default, the fields are sorted in the ascending order. + Sorts []types.Sort + + noSmithyDocumentSerde +} + +type ListMetricsOutput struct { + + // Specifies all the list of metric values for each row of metrics. + // + // This member is required. + Rows [][]string + + // Token for the next set of results, or null if there are no more results. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListMetricsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListMetrics{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListMetrics{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListMetrics"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListMetricsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListMetrics(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListMetricsPaginatorOptions is the paginator options for ListMetrics +type ListMetricsPaginatorOptions struct { + // Maximum number of results to include in the response. If more results exist + // than the specified MaxResults value, a token is included in the response so + // that the remaining results can be retrieved. + 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 +} + +// ListMetricsPaginator is a paginator for ListMetrics +type ListMetricsPaginator struct { + options ListMetricsPaginatorOptions + client ListMetricsAPIClient + params *ListMetricsInput + nextToken *string + firstPage bool +} + +// NewListMetricsPaginator returns a new ListMetricsPaginator +func NewListMetricsPaginator(client ListMetricsAPIClient, params *ListMetricsInput, optFns ...func(*ListMetricsPaginatorOptions)) *ListMetricsPaginator { + if params == nil { + params = &ListMetricsInput{} + } + + options := ListMetricsPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListMetricsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListMetricsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListMetrics page. +func (p *ListMetricsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListMetricsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListMetrics(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 +} + +// ListMetricsAPIClient is a client that implements the ListMetrics operation. +type ListMetricsAPIClient interface { + ListMetrics(context.Context, *ListMetricsInput, ...func(*Options)) (*ListMetricsOutput, error) +} + +var _ ListMetricsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListMetrics(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListMetrics", + } +} diff --git a/service/resiliencehub/api_op_ListResiliencyPolicies.go b/service/resiliencehub/api_op_ListResiliencyPolicies.go index de7539dcae0..f8abfbae160 100644 --- a/service/resiliencehub/api_op_ListResiliencyPolicies.go +++ b/service/resiliencehub/api_op_ListResiliencyPolicies.go @@ -37,7 +37,7 @@ type ListResiliencyPoliciesInput struct { // Null, or the token from a previous call to get the next set of results. NextToken *string - // The name of the policy + // Name of the resiliency policy. PolicyName *string noSmithyDocumentSerde diff --git a/service/resiliencehub/api_op_RejectResourceGroupingRecommendations.go b/service/resiliencehub/api_op_RejectResourceGroupingRecommendations.go index 5b6d7ec15c2..2b85deb21b1 100644 --- a/service/resiliencehub/api_op_RejectResourceGroupingRecommendations.go +++ b/service/resiliencehub/api_op_RejectResourceGroupingRecommendations.go @@ -39,8 +39,8 @@ type RejectResourceGroupingRecommendationsInput struct { // This member is required. AppArn *string - // Indicates the list of resource grouping recommendations you have selected to - // exclude from your application. + // List of resource grouping recommendations you have selected to exclude from + // your application. // // This member is required. Entries []types.RejectGroupingRecommendationEntry @@ -60,8 +60,8 @@ type RejectResourceGroupingRecommendationsOutput struct { // This member is required. AppArn *string - // Indicates the list of resource grouping recommendations that failed to get - // excluded in your application. + // List of resource grouping recommendations that failed to get excluded in your + // application. // // This member is required. FailedEntries []types.FailedGroupingRecommendationEntry diff --git a/service/resiliencehub/api_op_StartMetricsExport.go b/service/resiliencehub/api_op_StartMetricsExport.go new file mode 100644 index 00000000000..6d4307c178a --- /dev/null +++ b/service/resiliencehub/api_op_StartMetricsExport.go @@ -0,0 +1,201 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package resiliencehub + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/resiliencehub/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Initiates the export task of metrics. +func (c *Client) StartMetricsExport(ctx context.Context, params *StartMetricsExportInput, optFns ...func(*Options)) (*StartMetricsExportOutput, error) { + if params == nil { + params = &StartMetricsExportInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartMetricsExport", params, optFns, c.addOperationStartMetricsExportMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartMetricsExportOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartMetricsExportInput struct { + + // (Optional) Specifies the name of the Amazon Simple Storage Service bucket where + // the exported metrics will be stored. + BucketName *string + + // Used for an idempotency token. A client token is a unique, case-sensitive + // string of up to 64 ASCII characters. You should not reuse the same client token + // for other API requests. + ClientToken *string + + noSmithyDocumentSerde +} + +type StartMetricsExportOutput struct { + + // Identifier of the metrics export task. + // + // This member is required. + MetricsExportId *string + + // Indicates the status of the metrics export task. + // + // This member is required. + Status types.MetricsExportStatusType + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartMetricsExportMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartMetricsExport{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartMetricsExport{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartMetricsExport"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addIdempotencyToken_opStartMetricsExportMiddleware(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartMetricsExport(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +type idempotencyToken_initializeOpStartMetricsExport struct { + tokenProvider IdempotencyTokenProvider +} + +func (*idempotencyToken_initializeOpStartMetricsExport) ID() string { + return "OperationIdempotencyTokenAutoFill" +} + +func (m *idempotencyToken_initializeOpStartMetricsExport) 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.(*StartMetricsExportInput) + if !ok { + return out, metadata, fmt.Errorf("expected middleware input to be of type *StartMetricsExportInput ") + } + + 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_opStartMetricsExportMiddleware(stack *middleware.Stack, cfg Options) error { + return stack.Initialize.Add(&idempotencyToken_initializeOpStartMetricsExport{tokenProvider: cfg.IdempotencyTokenProvider}, middleware.Before) +} + +func newServiceMetadataMiddleware_opStartMetricsExport(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartMetricsExport", + } +} diff --git a/service/resiliencehub/api_op_StartResourceGroupingRecommendationTask.go b/service/resiliencehub/api_op_StartResourceGroupingRecommendationTask.go index 1c86aa8b367..035fef205ed 100644 --- a/service/resiliencehub/api_op_StartResourceGroupingRecommendationTask.go +++ b/service/resiliencehub/api_op_StartResourceGroupingRecommendationTask.go @@ -54,7 +54,7 @@ type StartResourceGroupingRecommendationTaskOutput struct { // This member is required. AppArn *string - // Indicates the identifier of the grouping recommendation task. + // Identifier of the grouping recommendation task. // // This member is required. GroupingId *string @@ -64,8 +64,7 @@ type StartResourceGroupingRecommendationTaskOutput struct { // This member is required. Status types.ResourcesGroupingRecGenStatusType - // Indicates the error that occurred while executing a grouping recommendation - // task. + // Error that occurred while executing a grouping recommendation task. ErrorMessage *string // Metadata pertaining to the operation's result. diff --git a/service/resiliencehub/api_op_UpdateResiliencyPolicy.go b/service/resiliencehub/api_op_UpdateResiliencyPolicy.go index 76ff11866d5..b9161ad50ad 100644 --- a/service/resiliencehub/api_op_UpdateResiliencyPolicy.go +++ b/service/resiliencehub/api_op_UpdateResiliencyPolicy.go @@ -50,14 +50,14 @@ type UpdateResiliencyPolicyInput struct { // resilience policy data can be stored. DataLocationConstraint types.DataLocationConstraint - // The type of resiliency policy to be created, including the recovery time - // objective (RTO) and recovery point objective (RPO) in seconds. + // Resiliency policy to be created, including the recovery time objective (RTO) + // and recovery point objective (RPO) in seconds. Policy map[string]types.FailurePolicy - // The description for the policy. + // Description of the resiliency policy. PolicyDescription *string - // The name of the policy + // Name of the resiliency policy. PolicyName *string // The tier for this resiliency policy, ranging from the highest severity ( @@ -69,8 +69,8 @@ type UpdateResiliencyPolicyInput struct { type UpdateResiliencyPolicyOutput struct { - // The type of resiliency policy that was updated, including the recovery time - // objective (RTO) and recovery point objective (RPO) in seconds. + // The resiliency policy that was updated, including the recovery time objective + // (RTO) and recovery point objective (RPO) in seconds. // // This member is required. Policy *types.ResiliencyPolicy diff --git a/service/resiliencehub/deserializers.go b/service/resiliencehub/deserializers.go index 0d1064273d2..3917d92ed2b 100644 --- a/service/resiliencehub/deserializers.go +++ b/service/resiliencehub/deserializers.go @@ -4180,6 +4180,197 @@ func awsRestjson1_deserializeOpDocumentDescribeDraftAppVersionResourcesImportSta return nil } +type awsRestjson1_deserializeOpDescribeMetricsExport struct { +} + +func (*awsRestjson1_deserializeOpDescribeMetricsExport) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpDescribeMetricsExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorDescribeMetricsExport(response, &metadata) + } + output := &DescribeMetricsExportOutput{} + 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_deserializeOpDocumentDescribeMetricsExportOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorDescribeMetricsExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentDescribeMetricsExportOutput(v **DescribeMetricsExportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *DescribeMetricsExportOutput + if *v == nil { + sv = &DescribeMetricsExportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "errorMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String500 to be of type string, got %T instead", value) + } + sv.ErrorMessage = ptr.String(jtv) + } + + case "exportLocation": + if err := awsRestjson1_deserializeDocumentS3Location(&sv.ExportLocation, value); err != nil { + return err + } + + case "metricsExportId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.MetricsExportId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricsExportStatusType to be of type string, got %T instead", value) + } + sv.Status = types.MetricsExportStatusType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpDescribeResiliencyPolicy struct { } @@ -6646,13 +6837,183 @@ func awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(v **ListApp return err } - case "resolutionId": + case "resolutionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.ResolutionId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpListAppVersions struct { +} + +func (*awsRestjson1_deserializeOpListAppVersions) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorListAppVersions(response, &metadata) + } + output := &ListAppVersionsOutput{} + 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_deserializeOpDocumentListAppVersionsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorListAppVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersionsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListAppVersionsOutput + if *v == nil { + sv = &ListAppVersionsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "appVersions": + if err := awsRestjson1_deserializeDocumentAppVersionList(&sv.AppVersions, value); err != nil { + return err + } + + case "nextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.ResolutionId = ptr.String(jtv) + sv.NextToken = ptr.String(jtv) } default: @@ -6664,14 +7025,14 @@ func awsRestjson1_deserializeOpDocumentListAppVersionResourcesOutput(v **ListApp return nil } -type awsRestjson1_deserializeOpListAppVersions struct { +type awsRestjson1_deserializeOpListMetrics struct { } -func (*awsRestjson1_deserializeOpListAppVersions) ID() string { +func (*awsRestjson1_deserializeOpListMetrics) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListMetrics) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -6689,9 +7050,9 @@ func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx contex } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListAppVersions(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListMetrics(response, &metadata) } - output := &ListAppVersionsOutput{} + output := &ListMetricsOutput{} out.Result = output var buff [1024]byte @@ -6712,7 +7073,7 @@ func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx contex return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListAppVersionsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListMetricsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -6726,7 +7087,7 @@ func (m *awsRestjson1_deserializeOpListAppVersions) HandleDeserialize(ctx contex return out, metadata, err } -func awsRestjson1_deserializeOpErrorListAppVersions(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListMetrics(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -6773,8 +7134,8 @@ func awsRestjson1_deserializeOpErrorListAppVersions(response *smithyhttp.Respons 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) @@ -6789,7 +7150,7 @@ func awsRestjson1_deserializeOpErrorListAppVersions(response *smithyhttp.Respons } } -func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersionsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListMetricsOutput(v **ListMetricsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -6802,20 +7163,15 @@ func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersions return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListAppVersionsOutput + var sv *ListMetricsOutput if *v == nil { - sv = &ListAppVersionsOutput{} + sv = &ListMetricsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "appVersions": - if err := awsRestjson1_deserializeDocumentAppVersionList(&sv.AppVersions, value); err != nil { - return err - } - case "nextToken": if value != nil { jtv, ok := value.(string) @@ -6825,6 +7181,11 @@ func awsRestjson1_deserializeOpDocumentListAppVersionsOutput(v **ListAppVersions sv.NextToken = ptr.String(jtv) } + case "rows": + if err := awsRestjson1_deserializeDocumentRowList(&sv.Rows, value); err != nil { + return err + } + default: _, _ = key, value @@ -9327,6 +9688,186 @@ func awsRestjson1_deserializeOpDocumentStartAppAssessmentOutput(v **StartAppAsse return nil } +type awsRestjson1_deserializeOpStartMetricsExport struct { +} + +func (*awsRestjson1_deserializeOpStartMetricsExport) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartMetricsExport) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorStartMetricsExport(response, &metadata) + } + output := &StartMetricsExportOutput{} + 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_deserializeOpDocumentStartMetricsExportOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartMetricsExport(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ServiceQuotaExceededException", errorCode): + return awsRestjson1_deserializeErrorServiceQuotaExceededException(response, errorBody) + + case strings.EqualFold("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_deserializeOpDocumentStartMetricsExportOutput(v **StartMetricsExportOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartMetricsExportOutput + if *v == nil { + sv = &StartMetricsExportOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "metricsExportId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String255 to be of type string, got %T instead", value) + } + sv.MetricsExportId = ptr.String(jtv) + } + + case "status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected MetricsExportStatusType to be of type string, got %T instead", value) + } + sv.Status = types.MetricsExportStatusType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpStartResourceGroupingRecommendationTask struct { } @@ -16057,6 +16598,74 @@ func awsRestjson1_deserializeDocumentResourceNotFoundException(v **types.Resourc return nil } +func awsRestjson1_deserializeDocumentRow(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 String255 to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRowList(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 err := awsRestjson1_deserializeDocumentRow(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentS3Location(v **types.S3Location, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/resiliencehub/generated.json b/service/resiliencehub/generated.json index f2bf77eca6f..0b9227349ed 100644 --- a/service/resiliencehub/generated.json +++ b/service/resiliencehub/generated.json @@ -31,6 +31,7 @@ "api_op_DescribeAppVersionResourcesResolutionStatus.go", "api_op_DescribeAppVersionTemplate.go", "api_op_DescribeDraftAppVersionResourcesImportStatus.go", + "api_op_DescribeMetricsExport.go", "api_op_DescribeResiliencyPolicy.go", "api_op_DescribeResourceGroupingRecommendationTask.go", "api_op_ImportResourcesToDraftAppVersion.go", @@ -46,6 +47,7 @@ "api_op_ListAppVersionResources.go", "api_op_ListAppVersions.go", "api_op_ListApps.go", + "api_op_ListMetrics.go", "api_op_ListRecommendationTemplates.go", "api_op_ListResiliencyPolicies.go", "api_op_ListResourceGroupingRecommendations.go", @@ -60,6 +62,7 @@ "api_op_RemoveDraftAppVersionResourceMappings.go", "api_op_ResolveAppVersionResources.go", "api_op_StartAppAssessment.go", + "api_op_StartMetricsExport.go", "api_op_StartResourceGroupingRecommendationTask.go", "api_op_TagResource.go", "api_op_UntagResource.go", diff --git a/service/resiliencehub/serializers.go b/service/resiliencehub/serializers.go index 11efac8f655..07e2fd5d956 100644 --- a/service/resiliencehub/serializers.go +++ b/service/resiliencehub/serializers.go @@ -2252,6 +2252,87 @@ func awsRestjson1_serializeOpDocumentDescribeDraftAppVersionResourcesImportStatu return nil } +type awsRestjson1_serializeOpDescribeMetricsExport struct { +} + +func (*awsRestjson1_serializeOpDescribeMetricsExport) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpDescribeMetricsExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*DescribeMetricsExportInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/describe-metrics-export") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentDescribeMetricsExportInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsDescribeMetricsExportInput(v *DescribeMetricsExportInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentDescribeMetricsExportInput(v *DescribeMetricsExportInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.MetricsExportId != nil { + ok := object.Key("metricsExportId") + ok.String(*v.MetricsExportId) + } + + return nil +} + type awsRestjson1_serializeOpDescribeResiliencyPolicy struct { } @@ -3661,6 +3742,118 @@ func awsRestjson1_serializeOpDocumentListAppVersionsInput(v *ListAppVersionsInpu return nil } +type awsRestjson1_serializeOpListMetrics struct { +} + +func (*awsRestjson1_serializeOpListMetrics) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListMetrics) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListMetricsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/list-metrics") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListMetricsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListMetricsInput(v *ListMetricsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListMetricsInput(v *ListMetricsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Conditions != nil { + ok := object.Key("conditions") + if err := awsRestjson1_serializeDocumentConditionList(v.Conditions, ok); err != nil { + return err + } + } + + if v.DataSource != nil { + ok := object.Key("dataSource") + ok.String(*v.DataSource) + } + + if v.Fields != nil { + ok := object.Key("fields") + if err := awsRestjson1_serializeDocumentFieldList(v.Fields, 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) + } + + if v.Sorts != nil { + ok := object.Key("sorts") + if err := awsRestjson1_serializeDocumentSortList(v.Sorts, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpListRecommendationTemplates struct { } @@ -4897,6 +5090,92 @@ func awsRestjson1_serializeOpDocumentStartAppAssessmentInput(v *StartAppAssessme return nil } +type awsRestjson1_serializeOpStartMetricsExport struct { +} + +func (*awsRestjson1_serializeOpStartMetricsExport) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartMetricsExport) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartMetricsExportInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/start-metrics-export") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartMetricsExportInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartMetricsExportInput(v *StartMetricsExportInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartMetricsExportInput(v *StartMetricsExportInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.BucketName != nil { + ok := object.Key("bucketName") + ok.String(*v.BucketName) + } + + if v.ClientToken != nil { + ok := object.Key("clientToken") + ok.String(*v.ClientToken) + } + + return nil +} + type awsRestjson1_serializeOpStartResourceGroupingRecommendationTask struct { } @@ -5771,6 +6050,41 @@ func awsRestjson1_serializeDocumentArnList(v []string, value smithyjson.Value) e return nil } +func awsRestjson1_serializeDocumentCondition(v *types.Condition, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Field != nil { + ok := object.Key("field") + ok.String(*v.Field) + } + + if len(v.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_serializeDocumentConditionList(v []types.Condition, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentCondition(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentDisruptionPolicy(v map[string]types.FailurePolicy, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -5908,6 +6222,36 @@ func awsRestjson1_serializeDocumentFailurePolicy(v *types.FailurePolicy, value s return nil } +func awsRestjson1_serializeDocumentField(v *types.Field, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Aggregation) > 0 { + ok := object.Key("aggregation") + ok.String(string(v.Aggregation)) + } + + if v.Name != nil { + ok := object.Key("name") + ok.String(*v.Name) + } + + return nil +} + +func awsRestjson1_serializeDocumentFieldList(v []types.Field, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentField(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentIamRoleArnList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() @@ -6116,6 +6460,36 @@ func awsRestjson1_serializeDocumentResourceMappingList(v []types.ResourceMapping return nil } +func awsRestjson1_serializeDocumentSort(v *types.Sort, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Ascending != nil { + ok := object.Key("ascending") + ok.Boolean(*v.Ascending) + } + + if v.Field != nil { + ok := object.Key("field") + ok.String(*v.Field) + } + + return nil +} + +func awsRestjson1_serializeDocumentSortList(v []types.Sort, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsRestjson1_serializeDocumentSort(&v[i], av); err != nil { + return err + } + } + return nil +} + func awsRestjson1_serializeDocumentString255List(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/resiliencehub/snapshot/api_op_DescribeMetricsExport.go.snap b/service/resiliencehub/snapshot/api_op_DescribeMetricsExport.go.snap new file mode 100644 index 00000000000..d2f0b4b0e00 --- /dev/null +++ b/service/resiliencehub/snapshot/api_op_DescribeMetricsExport.go.snap @@ -0,0 +1,41 @@ +DescribeMetricsExport + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/resiliencehub/snapshot/api_op_ListMetrics.go.snap b/service/resiliencehub/snapshot/api_op_ListMetrics.go.snap new file mode 100644 index 00000000000..3544ed6354c --- /dev/null +++ b/service/resiliencehub/snapshot/api_op_ListMetrics.go.snap @@ -0,0 +1,41 @@ +ListMetrics + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/resiliencehub/snapshot/api_op_StartMetricsExport.go.snap b/service/resiliencehub/snapshot/api_op_StartMetricsExport.go.snap new file mode 100644 index 00000000000..ba583c501e5 --- /dev/null +++ b/service/resiliencehub/snapshot/api_op_StartMetricsExport.go.snap @@ -0,0 +1,41 @@ +StartMetricsExport + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + OperationIdempotencyTokenAutoFill + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/resiliencehub/snapshot_test.go b/service/resiliencehub/snapshot_test.go index d9480cf6ce5..d61ecc31edd 100644 --- a/service/resiliencehub/snapshot_test.go +++ b/service/resiliencehub/snapshot_test.go @@ -338,6 +338,18 @@ func TestCheckSnapshot_DescribeDraftAppVersionResourcesImportStatus(t *testing.T } } +func TestCheckSnapshot_DescribeMetricsExport(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeMetricsExport(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "DescribeMetricsExport") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_DescribeResiliencyPolicy(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeResiliencyPolicy(context.Background(), nil, func(o *Options) { @@ -518,6 +530,18 @@ func TestCheckSnapshot_ListAppVersions(t *testing.T) { } } +func TestCheckSnapshot_ListMetrics(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListMetrics(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListMetrics") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListRecommendationTemplates(t *testing.T) { svc := New(Options{}) _, err := svc.ListRecommendationTemplates(context.Background(), nil, func(o *Options) { @@ -686,6 +710,18 @@ func TestCheckSnapshot_StartAppAssessment(t *testing.T) { } } +func TestCheckSnapshot_StartMetricsExport(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartMetricsExport(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartMetricsExport") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartResourceGroupingRecommendationTask(t *testing.T) { svc := New(Options{}) _, err := svc.StartResourceGroupingRecommendationTask(context.Background(), nil, func(o *Options) { @@ -1057,6 +1093,18 @@ func TestUpdateSnapshot_DescribeDraftAppVersionResourcesImportStatus(t *testing. } } +func TestUpdateSnapshot_DescribeMetricsExport(t *testing.T) { + svc := New(Options{}) + _, err := svc.DescribeMetricsExport(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "DescribeMetricsExport") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_DescribeResiliencyPolicy(t *testing.T) { svc := New(Options{}) _, err := svc.DescribeResiliencyPolicy(context.Background(), nil, func(o *Options) { @@ -1237,6 +1285,18 @@ func TestUpdateSnapshot_ListAppVersions(t *testing.T) { } } +func TestUpdateSnapshot_ListMetrics(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListMetrics(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListMetrics") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListRecommendationTemplates(t *testing.T) { svc := New(Options{}) _, err := svc.ListRecommendationTemplates(context.Background(), nil, func(o *Options) { @@ -1405,6 +1465,18 @@ func TestUpdateSnapshot_StartAppAssessment(t *testing.T) { } } +func TestUpdateSnapshot_StartMetricsExport(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartMetricsExport(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartMetricsExport") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartResourceGroupingRecommendationTask(t *testing.T) { svc := New(Options{}) _, err := svc.StartResourceGroupingRecommendationTask(context.Background(), nil, func(o *Options) { diff --git a/service/resiliencehub/types/enums.go b/service/resiliencehub/types/enums.go index 624ce6789a6..402ec20f329 100644 --- a/service/resiliencehub/types/enums.go +++ b/service/resiliencehub/types/enums.go @@ -178,6 +178,33 @@ func (ComplianceStatus) Values() []ComplianceStatus { } } +type ConditionOperatorType string + +// Enum values for ConditionOperatorType +const ( + ConditionOperatorTypeEquals ConditionOperatorType = "Equals" + ConditionOperatorTypeNotEquals ConditionOperatorType = "NotEquals" + ConditionOperatorTypeGreaterThen ConditionOperatorType = "GreaterThen" + ConditionOperatorTypeGreaterOrEquals ConditionOperatorType = "GreaterOrEquals" + ConditionOperatorTypeLessThen ConditionOperatorType = "LessThen" + ConditionOperatorTypeLessOrEquals ConditionOperatorType = "LessOrEquals" +) + +// Values returns all known values for ConditionOperatorType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ConditionOperatorType) Values() []ConditionOperatorType { + return []ConditionOperatorType{ + "Equals", + "NotEquals", + "GreaterThen", + "GreaterOrEquals", + "LessThen", + "LessOrEquals", + } +} + type ConfigRecommendationOptimizationType string // Enum values for ConfigRecommendationOptimizationType @@ -397,6 +424,31 @@ func (ExcludeRecommendationReason) Values() []ExcludeRecommendationReason { } } +type FieldAggregationType string + +// Enum values for FieldAggregationType +const ( + FieldAggregationTypeMin FieldAggregationType = "Min" + FieldAggregationTypeMax FieldAggregationType = "Max" + FieldAggregationTypeSum FieldAggregationType = "Sum" + FieldAggregationTypeAvg FieldAggregationType = "Avg" + FieldAggregationTypeCount FieldAggregationType = "Count" +) + +// Values returns all known values for FieldAggregationType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (FieldAggregationType) Values() []FieldAggregationType { + return []FieldAggregationType{ + "Min", + "Max", + "Sum", + "Avg", + "Count", + } +} + type GroupingRecommendationConfidenceLevel string // Enum values for GroupingRecommendationConfidenceLevel @@ -488,6 +540,29 @@ func (HaArchitecture) Values() []HaArchitecture { } } +type MetricsExportStatusType string + +// Enum values for MetricsExportStatusType +const ( + MetricsExportStatusTypePending MetricsExportStatusType = "Pending" + MetricsExportStatusTypeInProgress MetricsExportStatusType = "InProgress" + MetricsExportStatusTypeFailed MetricsExportStatusType = "Failed" + MetricsExportStatusTypeSuccess MetricsExportStatusType = "Success" +) + +// Values returns all known values for MetricsExportStatusType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (MetricsExportStatusType) Values() []MetricsExportStatusType { + return []MetricsExportStatusType{ + "Pending", + "InProgress", + "Failed", + "Success", + } +} + type PermissionModelType string // Enum values for PermissionModelType diff --git a/service/resiliencehub/types/types.go b/service/resiliencehub/types/types.go index c67a3151c17..5ce2ff4f3ae 100644 --- a/service/resiliencehub/types/types.go +++ b/service/resiliencehub/types/types.go @@ -81,7 +81,7 @@ type App struct { // This member is required. AppArn *string - // Date and time when the app was created. + // Date and time when the application was created. // // This member is required. CreationTime *time.Time @@ -642,6 +642,26 @@ type ComponentRecommendation struct { noSmithyDocumentSerde } +// Indicates the condition based on which you want to filter the metrics. +type Condition struct { + + // Indicates the field in the metric. + // + // This member is required. + Field *string + + // Indicates the type of operator or comparison to be used when evaluating a + // condition against the specified field. + // + // This member is required. + Operator ConditionOperatorType + + // Indicates the value or data against which a condition is evaluated. + Value *string + + noSmithyDocumentSerde +} + // Defines a recommendation configuration. type ConfigRecommendation struct { @@ -859,6 +879,22 @@ type FailurePolicy struct { noSmithyDocumentSerde } +// Indicates the field or attribute of a resource or data structure on which a +// condition is being applied or evaluated. +type Field struct { + + // Name of the field. + // + // This member is required. + Name *string + + // (Optional) Indicates the type of aggregation or summary operation (such as Sum, + // Average, and so on) to be performed on a particular field or set of data. + Aggregation FieldAggregationType + + noSmithyDocumentSerde +} + // Creates a new recommended Application Component (AppComponent). type GroupingAppComponent struct { @@ -1327,7 +1363,7 @@ type ResiliencyPolicy struct { // [Amazon Resource Names (ARNs)]: https://docs.aws.amazon.com/general/latest/gr/aws-arns-and-namespaces.html PolicyArn *string - // The description for the policy. + // Description of the resiliency policy. PolicyDescription *string // The name of the policy @@ -1563,6 +1599,23 @@ type SopRecommendation struct { noSmithyDocumentSerde } +// Indicates the sorting order of the fields in the metrics. +type Sort struct { + + // Indicates the order in which you want to sort the metrics. By default, the list + // is sorted in ascending order. To sort the list in descending order, set this + // field to False. + // + // This member is required. + Field *string + + // Indicates the name or identifier of the field or attribute that should be used + // as the basis for sorting the metrics. + Ascending *bool + + noSmithyDocumentSerde +} + // The Terraform s3 state file you need to import. type TerraformSource struct { diff --git a/service/resiliencehub/validators.go b/service/resiliencehub/validators.go index 9018c4f800e..44e2e0678c7 100644 --- a/service/resiliencehub/validators.go +++ b/service/resiliencehub/validators.go @@ -470,6 +470,26 @@ func (m *validateOpDescribeDraftAppVersionResourcesImportStatus) HandleInitializ return next.HandleInitialize(ctx, in) } +type validateOpDescribeMetricsExport struct { +} + +func (*validateOpDescribeMetricsExport) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpDescribeMetricsExport) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*DescribeMetricsExportInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpDescribeMetricsExportInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpDescribeResiliencyPolicy struct { } @@ -730,6 +750,26 @@ func (m *validateOpListAppVersions) HandleInitialize(ctx context.Context, in mid return next.HandleInitialize(ctx, in) } +type validateOpListMetrics struct { +} + +func (*validateOpListMetrics) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListMetrics) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListMetricsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListMetricsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListSopRecommendations struct { } @@ -1182,6 +1222,10 @@ func addOpDescribeDraftAppVersionResourcesImportStatusValidationMiddleware(stack return stack.Initialize.Add(&validateOpDescribeDraftAppVersionResourcesImportStatus{}, middleware.After) } +func addOpDescribeMetricsExportValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpDescribeMetricsExport{}, middleware.After) +} + func addOpDescribeResiliencyPolicyValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpDescribeResiliencyPolicy{}, middleware.After) } @@ -1234,6 +1278,10 @@ func addOpListAppVersionsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListAppVersions{}, middleware.After) } +func addOpListMetricsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListMetrics{}, middleware.After) +} + func addOpListSopRecommendationsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListSopRecommendations{}, middleware.After) } @@ -1338,6 +1386,41 @@ func validateAcceptGroupingRecommendationEntry(v *types.AcceptGroupingRecommenda } } +func validateCondition(v *types.Condition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Condition"} + if v.Field == nil { + invalidParams.Add(smithy.NewErrParamRequired("Field")) + } + if len(v.Operator) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Operator")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateConditionList(v []types.Condition) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ConditionList"} + for i := range v { + if err := validateCondition(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateDisruptionPolicy(v map[string]types.FailurePolicy) error { if v == nil { return nil @@ -1456,6 +1539,38 @@ func validateFailurePolicy(v *types.FailurePolicy) error { } } +func validateField(v *types.Field) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Field"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateFieldList(v []types.Field) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "FieldList"} + for i := range v { + if err := validateField(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateLogicalResourceId(v *types.LogicalResourceId) error { if v == nil { return nil @@ -1575,6 +1690,38 @@ func validateResourceMappingList(v []types.ResourceMapping) error { } } +func validateSort(v *types.Sort) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "Sort"} + if v.Field == nil { + invalidParams.Add(smithy.NewErrParamRequired("Field")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateSortList(v []types.Sort) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "SortList"} + for i := range v { + if err := validateSort(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateTerraformSource(v *types.TerraformSource) error { if v == nil { return nil @@ -2097,6 +2244,21 @@ func validateOpDescribeDraftAppVersionResourcesImportStatusInput(v *DescribeDraf } } +func validateOpDescribeMetricsExportInput(v *DescribeMetricsExportInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "DescribeMetricsExportInput"} + if v.MetricsExportId == nil { + invalidParams.Add(smithy.NewErrParamRequired("MetricsExportId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpDescribeResiliencyPolicyInput(v *DescribeResiliencyPolicyInput) error { if v == nil { return nil @@ -2314,6 +2476,33 @@ func validateOpListAppVersionsInput(v *ListAppVersionsInput) error { } } +func validateOpListMetricsInput(v *ListMetricsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListMetricsInput"} + if v.Fields != nil { + if err := validateFieldList(v.Fields); err != nil { + invalidParams.AddNested("Fields", err.(smithy.InvalidParamsError)) + } + } + if v.Conditions != nil { + if err := validateConditionList(v.Conditions); err != nil { + invalidParams.AddNested("Conditions", err.(smithy.InvalidParamsError)) + } + } + if v.Sorts != nil { + if err := validateSortList(v.Sorts); err != nil { + invalidParams.AddNested("Sorts", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListSopRecommendationsInput(v *ListSopRecommendationsInput) error { if v == nil { return nil diff --git a/service/s3/api_op_AbortMultipartUpload.go b/service/s3/api_op_AbortMultipartUpload.go index 52a8258da64..2fa64dde939 100644 --- a/service/s3/api_op_AbortMultipartUpload.go +++ b/service/s3/api_op_AbortMultipartUpload.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // This operation aborts a multipart upload. After a multipart upload is aborted, @@ -147,6 +148,16 @@ type AbortMultipartUploadInput struct { // status code 403 Forbidden (access denied). ExpectedBucketOwner *string + // If present, this header aborts an in progress multipart upload only if it was + // initiated on the provided timestamp. If the initiated timestamp of the multipart + // upload does not match the provided value, the operation returns a 412 + // Precondition Failed error. If the initiated timestamp matches or if the + // multipart upload doesn’t exist, the operation returns a 204 Success (No Content) + // response. + // + // This functionality is only supported for directory buckets. + IfMatchInitiatedTime *time.Time + // Confirms that the requester knows that they will be charged for the request. // Bucket owners need not specify this parameter in their requests. If either the // source or destination S3 bucket has Requester Pays enabled, the requester will diff --git a/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go b/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go index 98437e81fdd..ebeba22954a 100644 --- a/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go +++ b/service/s3/api_op_DeleteBucketAnalyticsConfiguration.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Deletes an analytics configuration for the bucket (specified by the analytics // configuration ID). diff --git a/service/s3/api_op_DeleteBucketCors.go b/service/s3/api_op_DeleteBucketCors.go index f0cd1be503d..e101447514a 100644 --- a/service/s3/api_op_DeleteBucketCors.go +++ b/service/s3/api_op_DeleteBucketCors.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Deletes the cors configuration information set for the bucket. // diff --git a/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go b/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go index 3bc32aca99b..3fd1f17cd02 100644 --- a/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go +++ b/service/s3/api_op_DeleteBucketIntelligentTieringConfiguration.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Deletes the S3 Intelligent-Tiering configuration from the specified bucket. // diff --git a/service/s3/api_op_DeleteBucketInventoryConfiguration.go b/service/s3/api_op_DeleteBucketInventoryConfiguration.go index ffb5e0d4a07..68fbe69dfd7 100644 --- a/service/s3/api_op_DeleteBucketInventoryConfiguration.go +++ b/service/s3/api_op_DeleteBucketInventoryConfiguration.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Deletes an inventory configuration (identified by the inventory ID) from the // bucket. diff --git a/service/s3/api_op_DeleteBucketLifecycle.go b/service/s3/api_op_DeleteBucketLifecycle.go index 10c8ddbff9a..12e5d124f6a 100644 --- a/service/s3/api_op_DeleteBucketLifecycle.go +++ b/service/s3/api_op_DeleteBucketLifecycle.go @@ -13,20 +13,43 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. -// // Deletes the lifecycle configuration from the specified bucket. Amazon S3 // removes all the lifecycle configuration rules in the lifecycle subresource // associated with the bucket. Your objects never expire, and Amazon S3 no longer // automatically deletes any objects on the basis of rules contained in the deleted // lifecycle configuration. // -// To use this operation, you must have permission to perform the -// s3:PutLifecycleConfiguration action. By default, the bucket owner has this -// permission and the bucket owner can grant this permission to others. +// Permissions +// - General purpose bucket permissions - By default, all Amazon S3 resources +// are private, including buckets, objects, and related subresources (for example, +// lifecycle configuration and website configuration). Only the resource owner +// (that is, the Amazon Web Services account that created it) can access the +// resource. The resource owner can optionally grant access permissions to others +// by writing an access policy. For this operation, a user must have the +// s3:PutLifecycleConfiguration permission. +// +// For more information about permissions, see [Managing Access Permissions to Your Amazon S3 Resources]. +// +// - Directory bucket permissions - You must have the +// s3express:PutLifecycleConfiguration permission in an IAM identity-based policy +// to use this operation. Cross-account access to this API operation isn't +// supported. The resource owner can optionally grant access permissions to others +// by creating a role or user for them as long as they are within the same account +// as the owner and resource. +// +// For more information about directory bucket policies and permissions, see [Authorizing Regional endpoint APIs with IAM]in +// +// the Amazon S3 User Guide. // -// There is usually some time lag before lifecycle configuration deletion is fully -// propagated to all the Amazon S3 systems. +// Directory buckets - For directory buckets, you must make requests for this API +// +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region_code.amazonaws.com/bucket-name +// . Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints] +// in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region.amazonaws.com . // // For more information about the object expiration, see [Elements to Describe Lifecycle Actions]. // @@ -39,6 +62,10 @@ import ( // [PutBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycleConfiguration.html // [Elements to Describe Lifecycle Actions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#intro-lifecycle-rules-actions // [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html +// [Authorizing Regional endpoint APIs with IAM]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html +// [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html +// +// [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html func (c *Client) DeleteBucketLifecycle(ctx context.Context, params *DeleteBucketLifecycleInput, optFns ...func(*Options)) (*DeleteBucketLifecycleOutput, error) { if params == nil { params = &DeleteBucketLifecycleInput{} @@ -64,6 +91,9 @@ type DeleteBucketLifecycleInput struct { // The account ID of the expected bucket owner. If the account ID that you provide // does not match the actual owner of the bucket, the request fails with the HTTP // status code 403 Forbidden (access denied). + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. ExpectedBucketOwner *string noSmithyDocumentSerde diff --git a/service/s3/api_op_DeleteBucketMetricsConfiguration.go b/service/s3/api_op_DeleteBucketMetricsConfiguration.go index 92dbe8e4d7c..86ab957322e 100644 --- a/service/s3/api_op_DeleteBucketMetricsConfiguration.go +++ b/service/s3/api_op_DeleteBucketMetricsConfiguration.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Deletes a metrics configuration for the Amazon CloudWatch request metrics // (specified by the metrics configuration ID) from the bucket. Note that this diff --git a/service/s3/api_op_DeleteBucketOwnershipControls.go b/service/s3/api_op_DeleteBucketOwnershipControls.go index 1b8259d9deb..da46b921e8f 100644 --- a/service/s3/api_op_DeleteBucketOwnershipControls.go +++ b/service/s3/api_op_DeleteBucketOwnershipControls.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Removes OwnershipControls for an Amazon S3 bucket. To use this operation, you // must have the s3:PutBucketOwnershipControls permission. For more information diff --git a/service/s3/api_op_DeleteBucketReplication.go b/service/s3/api_op_DeleteBucketReplication.go index 3967f00fd44..d2c8b032885 100644 --- a/service/s3/api_op_DeleteBucketReplication.go +++ b/service/s3/api_op_DeleteBucketReplication.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Deletes the replication configuration from the bucket. // diff --git a/service/s3/api_op_DeleteBucketTagging.go b/service/s3/api_op_DeleteBucketTagging.go index 2b9d9c414fe..22f0656eda0 100644 --- a/service/s3/api_op_DeleteBucketTagging.go +++ b/service/s3/api_op_DeleteBucketTagging.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Deletes the tags from the bucket. // diff --git a/service/s3/api_op_DeleteBucketWebsite.go b/service/s3/api_op_DeleteBucketWebsite.go index 080d7f74847..46aded0bb19 100644 --- a/service/s3/api_op_DeleteBucketWebsite.go +++ b/service/s3/api_op_DeleteBucketWebsite.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // This action removes the website configuration for a bucket. Amazon S3 returns a // 200 OK response upon successfully deleting a website configuration on the diff --git a/service/s3/api_op_DeleteObject.go b/service/s3/api_op_DeleteObject.go index 7d6e7446f9c..577561a416f 100644 --- a/service/s3/api_op_DeleteObject.go +++ b/service/s3/api_op_DeleteObject.go @@ -11,6 +11,7 @@ import ( "github.com/aws/aws-sdk-go-v2/service/s3/types" "github.com/aws/smithy-go/middleware" smithyhttp "github.com/aws/smithy-go/transport/http" + "time" ) // Removes an object from a bucket. The behavior depends on the bucket's @@ -142,6 +143,38 @@ type DeleteObjectInput struct { // status code 403 Forbidden (access denied). ExpectedBucketOwner *string + // The If-Match header field makes the request method conditional on ETags. If the + // ETag value does not match, the operation returns a 412 Precondition Failed + // error. If the ETag matches or if the object doesn't exist, the operation will + // return a 204 Success (No Content) response . + // + // For more information about conditional requests, see [RFC 7232]. + // + // This functionality is only supported for directory buckets. + // + // [RFC 7232]: https://docs.aws.amazon.com/https:/tools.ietf.org/html/rfc7232 + IfMatch *string + + // If present, the object is deleted only if its modification times matches the + // provided Timestamp . If the Timestamp values do not match, the operation + // returns a 412 Precondition Failed error. If the Timestamp matches or if the + // object doesn’t exist, the operation returns a 204 Success (No Content) response. + // + // This functionality is only supported for directory buckets. + IfMatchLastModifiedTime *time.Time + + // If present, the object is deleted only if its size matches the provided size in + // bytes. If the Size value does not match, the operation returns a 412 + // Precondition Failed error. If the Size matches or if the object doesn’t exist, + // the operation returns a 204 Success (No Content) response. + // + // This functionality is only supported for directory buckets. + // + // You can use the If-Match , x-amz-if-match-last-modified-time and + // x-amz-if-match-size conditional headers in conjunction with each-other or + // individually. + IfMatchSize *int64 + // The concatenation of the authentication device's serial number, a space, and // the value that is displayed on your authentication device. Required to // permanently delete a versioned object if versioning is configured with MFA diff --git a/service/s3/api_op_DeleteObjectTagging.go b/service/s3/api_op_DeleteObjectTagging.go index c0f65ea1e37..54bfd7d72af 100644 --- a/service/s3/api_op_DeleteObjectTagging.go +++ b/service/s3/api_op_DeleteObjectTagging.go @@ -12,7 +12,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Removes the entire tag set from the specified object. For more information // about managing object tags, see [Object Tagging]. diff --git a/service/s3/api_op_DeletePublicAccessBlock.go b/service/s3/api_op_DeletePublicAccessBlock.go index 415bffd3b66..7205bb88dd0 100644 --- a/service/s3/api_op_DeletePublicAccessBlock.go +++ b/service/s3/api_op_DeletePublicAccessBlock.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Removes the PublicAccessBlock configuration for an Amazon S3 bucket. To use // this operation, you must have the s3:PutBucketPublicAccessBlock permission. For diff --git a/service/s3/api_op_GetBucketAccelerateConfiguration.go b/service/s3/api_op_GetBucketAccelerateConfiguration.go index 449e43d202d..8d33fa67d96 100644 --- a/service/s3/api_op_GetBucketAccelerateConfiguration.go +++ b/service/s3/api_op_GetBucketAccelerateConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // This implementation of the GET action uses the accelerate subresource to return // the Transfer Acceleration state of a bucket, which is either Enabled or diff --git a/service/s3/api_op_GetBucketAcl.go b/service/s3/api_op_GetBucketAcl.go index 31de039ae6e..8ae6505d075 100644 --- a/service/s3/api_op_GetBucketAcl.go +++ b/service/s3/api_op_GetBucketAcl.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // This implementation of the GET action uses the acl subresource to return the // access control list (ACL) of a bucket. To use GET to return the ACL of the diff --git a/service/s3/api_op_GetBucketAnalyticsConfiguration.go b/service/s3/api_op_GetBucketAnalyticsConfiguration.go index c7cb46d20ee..a0e8ac7c02c 100644 --- a/service/s3/api_op_GetBucketAnalyticsConfiguration.go +++ b/service/s3/api_op_GetBucketAnalyticsConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // This implementation of the GET action returns an analytics configuration // (identified by the analytics configuration ID) from the bucket. diff --git a/service/s3/api_op_GetBucketCors.go b/service/s3/api_op_GetBucketCors.go index b3d7b70295a..ee1d6b91189 100644 --- a/service/s3/api_op_GetBucketCors.go +++ b/service/s3/api_op_GetBucketCors.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the Cross-Origin Resource Sharing (CORS) configuration information set // for the bucket. diff --git a/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go b/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go index 3cffe9435ce..ccf065ee9fd 100644 --- a/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go +++ b/service/s3/api_op_GetBucketIntelligentTieringConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Gets the S3 Intelligent-Tiering configuration from the specified bucket. // diff --git a/service/s3/api_op_GetBucketInventoryConfiguration.go b/service/s3/api_op_GetBucketInventoryConfiguration.go index 3acc99a3508..8d61953c252 100644 --- a/service/s3/api_op_GetBucketInventoryConfiguration.go +++ b/service/s3/api_op_GetBucketInventoryConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns an inventory configuration (identified by the inventory configuration // ID) from the bucket. diff --git a/service/s3/api_op_GetBucketLifecycleConfiguration.go b/service/s3/api_op_GetBucketLifecycleConfiguration.go index d717617e847..4e1570a2954 100644 --- a/service/s3/api_op_GetBucketLifecycleConfiguration.go +++ b/service/s3/api_op_GetBucketLifecycleConfiguration.go @@ -14,26 +14,52 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// Returns the lifecycle configuration information set on the bucket. For +// information about lifecycle configuration, see [Object Lifecycle Management]. // // Bucket lifecycle configuration now supports specifying a lifecycle rule using // an object key name prefix, one or more object tags, object size, or any -// combination of these. Accordingly, this section describes the latest API. The -// previous version of the API supported filtering based only on an object key name -// prefix, which is supported for backward compatibility. For the related API -// description, see [GetBucketLifecycle]. Accordingly, this section describes the latest API. The -// response describes the new filter element that you can use to specify a filter -// to select a subset of objects to which the rule applies. If you are using a -// previous version of the lifecycle configuration, it still works. For the earlier -// action, +// combination of these. Accordingly, this section describes the latest API, which +// is compatible with the new functionality. The previous version of the API +// supported filtering based only on an object key name prefix, which is supported +// for general purpose buckets for backward compatibility. For the related API +// description, see [GetBucketLifecycle]. // -// Returns the lifecycle configuration information set on the bucket. For -// information about lifecycle configuration, see [Object Lifecycle Management]. +// Lifecyle configurations for directory buckets only support expiring objects and +// cancelling multipart uploads. Expiring of versioned objects, transitions and tag +// filters are not supported. +// +// Permissions +// - General purpose bucket permissions - By default, all Amazon S3 resources +// are private, including buckets, objects, and related subresources (for example, +// lifecycle configuration and website configuration). Only the resource owner +// (that is, the Amazon Web Services account that created it) can access the +// resource. The resource owner can optionally grant access permissions to others +// by writing an access policy. For this operation, a user must have the +// s3:GetLifecycleConfiguration permission. +// +// For more information about permissions, see [Managing Access Permissions to Your Amazon S3 Resources]. +// +// - Directory bucket permissions - You must have the +// s3express:GetLifecycleConfiguration permission in an IAM identity-based policy +// to use this operation. Cross-account access to this API operation isn't +// supported. The resource owner can optionally grant access permissions to others +// by creating a role or user for them as long as they are within the same account +// as the owner and resource. // -// To use this operation, you must have permission to perform the -// s3:GetLifecycleConfiguration action. The bucket owner has this permission, by -// default. The bucket owner can grant this permission to others. For more -// information about permissions, see [Permissions Related to Bucket Subresource Operations]and [Managing Access Permissions to Your Amazon S3 Resources]. +// For more information about directory bucket policies and permissions, see [Authorizing Regional endpoint APIs with IAM]in +// +// the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API +// +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region_code.amazonaws.com/bucket-name +// . Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints] +// in the Amazon S3 User Guide. +// +// HTTP Host header syntax Directory buckets - The HTTP Host header syntax is +// s3express-control.region.amazonaws.com . // // GetBucketLifecycleConfiguration has the following special error: // @@ -55,10 +81,12 @@ import ( // // [GetBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycle.html // [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html -// [Permissions Related to Bucket Subresource Operations]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/using-with-s3-actions.html#using-with-s3-actions-related-to-bucket-subresources +// [Authorizing Regional endpoint APIs with IAM]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html // [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html // [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html // [DeleteBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html +// +// [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html func (c *Client) GetBucketLifecycleConfiguration(ctx context.Context, params *GetBucketLifecycleConfigurationInput, optFns ...func(*Options)) (*GetBucketLifecycleConfigurationOutput, error) { if params == nil { params = &GetBucketLifecycleConfigurationInput{} @@ -84,6 +112,9 @@ type GetBucketLifecycleConfigurationInput struct { // The account ID of the expected bucket owner. If the account ID that you provide // does not match the actual owner of the bucket, the request fails with the HTTP // status code 403 Forbidden (access denied). + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. ExpectedBucketOwner *string noSmithyDocumentSerde @@ -103,6 +134,9 @@ type GetBucketLifecycleConfigurationOutput struct { // Indicates which default minimum object size behavior is applied to the // lifecycle configuration. // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // // - all_storage_classes_128K - Objects smaller than 128 KB will not transition // to any storage class by default. // diff --git a/service/s3/api_op_GetBucketLocation.go b/service/s3/api_op_GetBucketLocation.go index 2fe54dd04f7..973f3959895 100644 --- a/service/s3/api_op_GetBucketLocation.go +++ b/service/s3/api_op_GetBucketLocation.go @@ -20,7 +20,7 @@ import ( "io" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the Region the bucket resides in. You set the bucket's Region using the // LocationConstraint request parameter in a CreateBucket request. For more diff --git a/service/s3/api_op_GetBucketLogging.go b/service/s3/api_op_GetBucketLogging.go index a5030140a64..b774266d32a 100644 --- a/service/s3/api_op_GetBucketLogging.go +++ b/service/s3/api_op_GetBucketLogging.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the logging status of a bucket and the permissions users have to view // and modify that status. diff --git a/service/s3/api_op_GetBucketMetricsConfiguration.go b/service/s3/api_op_GetBucketMetricsConfiguration.go index fa83bd270ca..a83b72620fa 100644 --- a/service/s3/api_op_GetBucketMetricsConfiguration.go +++ b/service/s3/api_op_GetBucketMetricsConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Gets a metrics configuration (specified by the metrics configuration ID) from // the bucket. Note that this doesn't include the daily storage metrics. diff --git a/service/s3/api_op_GetBucketNotificationConfiguration.go b/service/s3/api_op_GetBucketNotificationConfiguration.go index 822da223c83..8f744ba3087 100644 --- a/service/s3/api_op_GetBucketNotificationConfiguration.go +++ b/service/s3/api_op_GetBucketNotificationConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the notification configuration of a bucket. // diff --git a/service/s3/api_op_GetBucketOwnershipControls.go b/service/s3/api_op_GetBucketOwnershipControls.go index f97d7a45370..ac69a473433 100644 --- a/service/s3/api_op_GetBucketOwnershipControls.go +++ b/service/s3/api_op_GetBucketOwnershipControls.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Retrieves OwnershipControls for an Amazon S3 bucket. To use this operation, you // must have the s3:GetBucketOwnershipControls permission. For more information diff --git a/service/s3/api_op_GetBucketPolicyStatus.go b/service/s3/api_op_GetBucketPolicyStatus.go index c8ed794ec93..a5cac1be1c5 100644 --- a/service/s3/api_op_GetBucketPolicyStatus.go +++ b/service/s3/api_op_GetBucketPolicyStatus.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Retrieves the policy status for an Amazon S3 bucket, indicating whether the // bucket is public. In order to use this operation, you must have the diff --git a/service/s3/api_op_GetBucketReplication.go b/service/s3/api_op_GetBucketReplication.go index 65877d11326..fac6ec2d98c 100644 --- a/service/s3/api_op_GetBucketReplication.go +++ b/service/s3/api_op_GetBucketReplication.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the replication configuration of a bucket. // diff --git a/service/s3/api_op_GetBucketRequestPayment.go b/service/s3/api_op_GetBucketRequestPayment.go index daddf29b0a8..3398dfc5ff2 100644 --- a/service/s3/api_op_GetBucketRequestPayment.go +++ b/service/s3/api_op_GetBucketRequestPayment.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the request payment configuration of a bucket. To use this version of // the operation, you must be the bucket owner. For more information, see [Requester Pays Buckets]. diff --git a/service/s3/api_op_GetBucketTagging.go b/service/s3/api_op_GetBucketTagging.go index f4020a99ce2..6ff16896e01 100644 --- a/service/s3/api_op_GetBucketTagging.go +++ b/service/s3/api_op_GetBucketTagging.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the tag set associated with the bucket. // diff --git a/service/s3/api_op_GetBucketVersioning.go b/service/s3/api_op_GetBucketVersioning.go index 98ddae58ea1..919cf688c5e 100644 --- a/service/s3/api_op_GetBucketVersioning.go +++ b/service/s3/api_op_GetBucketVersioning.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the versioning state of a bucket. // diff --git a/service/s3/api_op_GetBucketWebsite.go b/service/s3/api_op_GetBucketWebsite.go index d4cb0fe4903..3758b87895f 100644 --- a/service/s3/api_op_GetBucketWebsite.go +++ b/service/s3/api_op_GetBucketWebsite.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the website configuration for a bucket. To host website on Amazon S3, // you can configure a bucket as website by adding a website configuration. For diff --git a/service/s3/api_op_GetObjectAcl.go b/service/s3/api_op_GetObjectAcl.go index 8b1c8e3b747..fde39a96962 100644 --- a/service/s3/api_op_GetObjectAcl.go +++ b/service/s3/api_op_GetObjectAcl.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the access control list (ACL) of an object. To use this operation, you // must have s3:GetObjectAcl permissions or READ_ACP access to the object. For diff --git a/service/s3/api_op_GetObjectAttributes.go b/service/s3/api_op_GetObjectAttributes.go index 17a17b0d12d..c01fa99f345 100644 --- a/service/s3/api_op_GetObjectAttributes.go +++ b/service/s3/api_op_GetObjectAttributes.go @@ -303,7 +303,7 @@ type GetObjectAttributesOutput struct { // of a resource found at a URL. ETag *string - // The creation date of the object. + // Date and time when the object was last modified. LastModified *time.Time // A collection of parts associated with a multipart upload. diff --git a/service/s3/api_op_GetObjectLegalHold.go b/service/s3/api_op_GetObjectLegalHold.go index 5d31b314de1..f341d2adb77 100644 --- a/service/s3/api_op_GetObjectLegalHold.go +++ b/service/s3/api_op_GetObjectLegalHold.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Gets an object's current legal hold status. For more information, see [Locking Objects]. // diff --git a/service/s3/api_op_GetObjectLockConfiguration.go b/service/s3/api_op_GetObjectLockConfiguration.go index 685bc2e6998..7b34287c81c 100644 --- a/service/s3/api_op_GetObjectLockConfiguration.go +++ b/service/s3/api_op_GetObjectLockConfiguration.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Gets the Object Lock configuration for a bucket. The rule specified in the // Object Lock configuration will be applied by default to every new object placed diff --git a/service/s3/api_op_GetObjectRetention.go b/service/s3/api_op_GetObjectRetention.go index d7aa3633a80..7a72820ec20 100644 --- a/service/s3/api_op_GetObjectRetention.go +++ b/service/s3/api_op_GetObjectRetention.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Retrieves an object's retention settings. For more information, see [Locking Objects]. // diff --git a/service/s3/api_op_GetObjectTagging.go b/service/s3/api_op_GetObjectTagging.go index 485861e68f2..805d16c22a4 100644 --- a/service/s3/api_op_GetObjectTagging.go +++ b/service/s3/api_op_GetObjectTagging.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns the tag-set of an object. You send the GET request against the tagging // subresource associated with the object. diff --git a/service/s3/api_op_GetObjectTorrent.go b/service/s3/api_op_GetObjectTorrent.go index 608e0eefd8c..dc314d663ca 100644 --- a/service/s3/api_op_GetObjectTorrent.go +++ b/service/s3/api_op_GetObjectTorrent.go @@ -14,7 +14,7 @@ import ( "io" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns torrent files from a bucket. BitTorrent can save you bandwidth when // you're distributing large files. diff --git a/service/s3/api_op_GetPublicAccessBlock.go b/service/s3/api_op_GetPublicAccessBlock.go index d80905d5af7..bd760d74c05 100644 --- a/service/s3/api_op_GetPublicAccessBlock.go +++ b/service/s3/api_op_GetPublicAccessBlock.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Retrieves the PublicAccessBlock configuration for an Amazon S3 bucket. To use // this operation, you must have the s3:GetBucketPublicAccessBlock permission. For diff --git a/service/s3/api_op_HeadObject.go b/service/s3/api_op_HeadObject.go index 198d05f1773..19ef63e5c40 100644 --- a/service/s3/api_op_HeadObject.go +++ b/service/s3/api_op_HeadObject.go @@ -105,7 +105,7 @@ import ( // - If the specified version is a delete marker, the response returns a 405 // Method Not Allowed error and the Last-Modified: timestamp response header. // -// - Directory buckets - Delete marker is not supported by directory buckets. +// - Directory buckets - Delete marker is not supported for directory buckets. // // - Directory buckets - S3 Versioning isn't enabled and supported for directory // buckets. For this API operation, only the null value of the version ID is diff --git a/service/s3/api_op_ListBucketAnalyticsConfigurations.go b/service/s3/api_op_ListBucketAnalyticsConfigurations.go index c78d9e4934e..dd35f119c6b 100644 --- a/service/s3/api_op_ListBucketAnalyticsConfigurations.go +++ b/service/s3/api_op_ListBucketAnalyticsConfigurations.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Lists the analytics configurations for the bucket. You can have up to 1,000 // analytics configurations per bucket. diff --git a/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go b/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go index f139a43db77..3f6d19a34a4 100644 --- a/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go +++ b/service/s3/api_op_ListBucketIntelligentTieringConfigurations.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Lists the S3 Intelligent-Tiering configuration from the specified bucket. // diff --git a/service/s3/api_op_ListBucketInventoryConfigurations.go b/service/s3/api_op_ListBucketInventoryConfigurations.go index 449bae064a7..5a675d2a9a9 100644 --- a/service/s3/api_op_ListBucketInventoryConfigurations.go +++ b/service/s3/api_op_ListBucketInventoryConfigurations.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns a list of inventory configurations for the bucket. You can have up to // 1,000 analytics configurations per bucket. diff --git a/service/s3/api_op_ListBucketMetricsConfigurations.go b/service/s3/api_op_ListBucketMetricsConfigurations.go index 4d34f6e9486..e6484f4b01c 100644 --- a/service/s3/api_op_ListBucketMetricsConfigurations.go +++ b/service/s3/api_op_ListBucketMetricsConfigurations.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Lists the metrics configurations for the bucket. The metrics configurations are // only for the request metrics of the bucket and do not provide information on diff --git a/service/s3/api_op_ListBuckets.go b/service/s3/api_op_ListBuckets.go index 97732372c56..d87540829a4 100644 --- a/service/s3/api_op_ListBuckets.go +++ b/service/s3/api_op_ListBuckets.go @@ -13,19 +13,21 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns a list of all buckets owned by the authenticated sender of the request. -// To use this operation, you must have the s3:ListAllMyBuckets permission. +// To grant IAM permission to use this operation, you must add the +// s3:ListAllMyBuckets policy action. // // For information about Amazon S3 buckets, see [Creating, configuring, and working with Amazon S3 buckets]. // -// We strongly recommend using only paginated requests. Unpaginated requests are -// only supported for Amazon Web Services accounts set to the default general -// purpose bucket quota of 10,000. If you have an approved general purpose bucket -// quota above 10,000, you must send paginated requests to list your account’s -// buckets. All unpaginated ListBuckets requests will be rejected for Amazon Web -// Services accounts with a general purpose bucket quota greater than 10,000. +// We strongly recommend using only paginated ListBuckets requests. Unpaginated +// ListBuckets requests are only supported for Amazon Web Services accounts set to +// the default general purpose bucket quota of 10,000. If you have an approved +// general purpose bucket quota above 10,000, you must send paginated ListBuckets +// requests to list your account’s buckets. All unpaginated ListBuckets requests +// will be rejected for Amazon Web Services accounts with a general purpose bucket +// quota greater than 10,000. // // [Creating, configuring, and working with Amazon S3 buckets]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/creating-buckets-s3.html func (c *Client) ListBuckets(ctx context.Context, params *ListBucketsInput, optFns ...func(*Options)) (*ListBucketsOutput, error) { diff --git a/service/s3/api_op_ListObjectVersions.go b/service/s3/api_op_ListObjectVersions.go index 72324c49b4d..32898706e06 100644 --- a/service/s3/api_op_ListObjectVersions.go +++ b/service/s3/api_op_ListObjectVersions.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns metadata about all versions of the objects in a bucket. You can also // use request parameters as selection criteria to return metadata about a subset diff --git a/service/s3/api_op_ListObjects.go b/service/s3/api_op_ListObjects.go index 3aba10edaba..b584b6a8e19 100644 --- a/service/s3/api_op_ListObjects.go +++ b/service/s3/api_op_ListObjects.go @@ -13,7 +13,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Returns some or all (up to 1,000) of the objects in a bucket. You can use the // request parameters as selection criteria to return a subset of the objects in a diff --git a/service/s3/api_op_ListObjectsV2.go b/service/s3/api_op_ListObjectsV2.go index fa5a2eefeb3..d5ef22fd9bd 100644 --- a/service/s3/api_op_ListObjectsV2.go +++ b/service/s3/api_op_ListObjectsV2.go @@ -17,10 +17,8 @@ import ( // You can use the request parameters as selection criteria to return a subset of // the objects in a bucket. A 200 OK response can contain valid or invalid XML. // Make sure to design your application to parse the contents of the response and -// handle it appropriately. -// -// For more information about listing objects, see [Listing object keys programmatically] in the Amazon S3 User Guide. -// To get a list of your buckets, see [ListBuckets]. +// handle it appropriately. For more information about listing objects, see [Listing object keys programmatically]in the +// Amazon S3 User Guide. To get a list of your buckets, see [ListBuckets]. // // - General purpose bucket - For general purpose buckets, ListObjectsV2 doesn't // return prefixes that are related only to in-progress multipart uploads. diff --git a/service/s3/api_op_PutBucketAccelerateConfiguration.go b/service/s3/api_op_PutBucketAccelerateConfiguration.go index c400607c8ac..737f8bfde92 100644 --- a/service/s3/api_op_PutBucketAccelerateConfiguration.go +++ b/service/s3/api_op_PutBucketAccelerateConfiguration.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets the accelerate configuration of an existing bucket. Amazon S3 Transfer // Acceleration is a bucket-level feature that enables you to perform faster data diff --git a/service/s3/api_op_PutBucketAcl.go b/service/s3/api_op_PutBucketAcl.go index 9562fafb5a5..eeac549e338 100644 --- a/service/s3/api_op_PutBucketAcl.go +++ b/service/s3/api_op_PutBucketAcl.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets the permissions on an existing bucket using access control lists (ACL). // For more information, see [Using ACLs]. To set the ACL of a bucket, you must have the diff --git a/service/s3/api_op_PutBucketAnalyticsConfiguration.go b/service/s3/api_op_PutBucketAnalyticsConfiguration.go index 99846ef4d43..ff457d603f5 100644 --- a/service/s3/api_op_PutBucketAnalyticsConfiguration.go +++ b/service/s3/api_op_PutBucketAnalyticsConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets an analytics configuration for the bucket (specified by the analytics // configuration ID). You can have up to 1,000 analytics configurations per bucket. diff --git a/service/s3/api_op_PutBucketCors.go b/service/s3/api_op_PutBucketCors.go index a08c41c1bc4..9eaa35fe83a 100644 --- a/service/s3/api_op_PutBucketCors.go +++ b/service/s3/api_op_PutBucketCors.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets the cors configuration for your bucket. If the configuration exists, // Amazon S3 replaces it. diff --git a/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go b/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go index b061daac1e5..6a11a0946b2 100644 --- a/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go +++ b/service/s3/api_op_PutBucketIntelligentTieringConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Puts a S3 Intelligent-Tiering configuration to the specified bucket. You can // have up to 1,000 S3 Intelligent-Tiering configurations per bucket. diff --git a/service/s3/api_op_PutBucketInventoryConfiguration.go b/service/s3/api_op_PutBucketInventoryConfiguration.go index 87ec6030aeb..d4ea335a48d 100644 --- a/service/s3/api_op_PutBucketInventoryConfiguration.go +++ b/service/s3/api_op_PutBucketInventoryConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // This implementation of the PUT action adds an inventory configuration // (identified by the inventory ID) to the bucket. You can have up to 1,000 diff --git a/service/s3/api_op_PutBucketLifecycleConfiguration.go b/service/s3/api_op_PutBucketLifecycleConfiguration.go index 4ab7b63b01e..58ff2947652 100644 --- a/service/s3/api_op_PutBucketLifecycleConfiguration.go +++ b/service/s3/api_op_PutBucketLifecycleConfiguration.go @@ -15,25 +15,27 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. -// // Creates a new lifecycle configuration for the bucket or replaces an existing // lifecycle configuration. Keep in mind that this will overwrite an existing // lifecycle configuration, so if you want to retain any configuration details, // they must be included in the new lifecycle configuration. For information about // lifecycle configuration, see [Managing your storage lifecycle]. // -// Rules You specify the lifecycle configuration in your request body. The -// lifecycle configuration is specified as XML consisting of one or more rules. An -// Amazon S3 Lifecycle configuration can have up to 1,000 rules. This limit is not -// adjustable. +// Rules Permissions HTTP Host header syntax You specify the lifecycle +// configuration in your request body. The lifecycle configuration is specified as +// XML consisting of one or more rules. An Amazon S3 Lifecycle configuration can +// have up to 1,000 rules. This limit is not adjustable. // // Bucket lifecycle configuration supports specifying a lifecycle rule using an // object key name prefix, one or more object tags, object size, or any combination // of these. Accordingly, this section describes the latest API. The previous // version of the API supported filtering based only on an object key name prefix, -// which is supported for backward compatibility. For the related API description, -// see [PutBucketLifecycle]. +// which is supported for backward compatibility for general purpose buckets. For +// the related API description, see [PutBucketLifecycle]. +// +// Lifecyle configurations for directory buckets only support expiring objects and +// cancelling multipart uploads. Expiring of versioned objects,transitions and tag +// filters are not supported. // // A lifecycle rule consists of the following: // @@ -52,42 +54,65 @@ import ( // // For more information, see [Object Lifecycle Management] and [Lifecycle Configuration Elements]. // -// Permissions By default, all Amazon S3 resources are private, including buckets, -// objects, and related subresources (for example, lifecycle configuration and -// website configuration). Only the resource owner (that is, the Amazon Web -// Services account that created it) can access the resource. The resource owner -// can optionally grant access permissions to others by writing an access policy. -// For this operation, a user must get the s3:PutLifecycleConfiguration permission. +// - General purpose bucket permissions - By default, all Amazon S3 resources +// are private, including buckets, objects, and related subresources (for example, +// lifecycle configuration and website configuration). Only the resource owner +// (that is, the Amazon Web Services account that created it) can access the +// resource. The resource owner can optionally grant access permissions to others +// by writing an access policy. For this operation, a user must have the +// s3:PutLifecycleConfiguration permission. // // You can also explicitly deny permissions. An explicit deny also supersedes any -// other permissions. If you want to block users or accounts from removing or -// deleting objects from your bucket, you must deny them permissions for the -// following actions: // -// - s3:DeleteObject +// other permissions. If you want to block users or accounts from removing or +// deleting objects from your bucket, you must deny them permissions for the +// following actions: // -// - s3:DeleteObjectVersion +// - s3:DeleteObject // -// - s3:PutLifecycleConfiguration +// - s3:DeleteObjectVersion +// +// - s3:PutLifecycleConfiguration // // For more information about permissions, see [Managing Access Permissions to Your Amazon S3 Resources]. // -// The following operations are related to PutBucketLifecycleConfiguration : +// - Directory bucket permissions - You must have the +// s3express:PutLifecycleConfiguration permission in an IAM identity-based policy +// to use this operation. Cross-account access to this API operation isn't +// supported. The resource owner can optionally grant access permissions to others +// by creating a role or user for them as long as they are within the same account +// as the owner and resource. +// +// For more information about directory bucket policies and permissions, see [Authorizing Regional endpoint APIs with IAM]in +// +// the Amazon S3 User Guide. +// +// Directory buckets - For directory buckets, you must make requests for this API // -// [Examples of Lifecycle Configuration] +// operation to the Regional endpoint. These endpoints support path-style requests +// in the format https://s3express-control.region_code.amazonaws.com/bucket-name +// . Virtual-hosted-style requests aren't supported. For more information, see [Regional and Zonal endpoints] +// in the Amazon S3 User Guide. +// +// Directory buckets - The HTTP Host header syntax is +// s3express-control.region.amazonaws.com . +// +// The following operations are related to PutBucketLifecycleConfiguration : // // [GetBucketLifecycleConfiguration] // // [DeleteBucketLifecycle] // -// [Examples of Lifecycle Configuration]: https://docs.aws.amazon.com/AmazonS3/latest/dev/lifecycle-configuration-examples.html // [Object Lifecycle Management]: https://docs.aws.amazon.com/AmazonS3/latest/dev/object-lifecycle-mgmt.html // [Lifecycle Configuration Elements]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html // [GetBucketLifecycleConfiguration]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_GetBucketLifecycleConfiguration.html +// [Authorizing Regional endpoint APIs with IAM]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam.html // [PutBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_PutBucketLifecycle.html // [Managing Access Permissions to Your Amazon S3 Resources]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-access-control.html // [DeleteBucketLifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_DeleteBucketLifecycle.html // [Managing your storage lifecycle]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/object-lifecycle-mgmt.html +// +// [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html func (c *Client) PutBucketLifecycleConfiguration(ctx context.Context, params *PutBucketLifecycleConfigurationInput, optFns ...func(*Options)) (*PutBucketLifecycleConfigurationOutput, error) { if params == nil { params = &PutBucketLifecycleConfigurationInput{} @@ -126,6 +151,9 @@ type PutBucketLifecycleConfigurationInput struct { // The account ID of the expected bucket owner. If the account ID that you provide // does not match the actual owner of the bucket, the request fails with the HTTP // status code 403 Forbidden (access denied). + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. ExpectedBucketOwner *string // Container for lifecycle rules. You can add as many as 1,000 rules. @@ -134,6 +162,9 @@ type PutBucketLifecycleConfigurationInput struct { // Indicates which default minimum object size behavior is applied to the // lifecycle configuration. // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // // - all_storage_classes_128K - Objects smaller than 128 KB will not transition // to any storage class by default. // @@ -161,6 +192,9 @@ type PutBucketLifecycleConfigurationOutput struct { // Indicates which default minimum object size behavior is applied to the // lifecycle configuration. // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // // - all_storage_classes_128K - Objects smaller than 128 KB will not transition // to any storage class by default. // diff --git a/service/s3/api_op_PutBucketLogging.go b/service/s3/api_op_PutBucketLogging.go index 10e04be1ddb..01380c4bac8 100644 --- a/service/s3/api_op_PutBucketLogging.go +++ b/service/s3/api_op_PutBucketLogging.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Set the logging parameters for a bucket and to specify permissions for who can // view and modify the logging parameters. All logs are saved to buckets in the diff --git a/service/s3/api_op_PutBucketMetricsConfiguration.go b/service/s3/api_op_PutBucketMetricsConfiguration.go index fcf7930a34b..0cd04f456b4 100644 --- a/service/s3/api_op_PutBucketMetricsConfiguration.go +++ b/service/s3/api_op_PutBucketMetricsConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets a metrics configuration (specified by the metrics configuration ID) for // the bucket. You can have up to 1,000 metrics configurations per bucket. If diff --git a/service/s3/api_op_PutBucketNotificationConfiguration.go b/service/s3/api_op_PutBucketNotificationConfiguration.go index 6c08e313a1f..cbc39609f9f 100644 --- a/service/s3/api_op_PutBucketNotificationConfiguration.go +++ b/service/s3/api_op_PutBucketNotificationConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Enables notifications of specified events for a bucket. For more information // about event notifications, see [Configuring Event Notifications]. diff --git a/service/s3/api_op_PutBucketOwnershipControls.go b/service/s3/api_op_PutBucketOwnershipControls.go index 6d5517e83cb..7eeb45dac42 100644 --- a/service/s3/api_op_PutBucketOwnershipControls.go +++ b/service/s3/api_op_PutBucketOwnershipControls.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Creates or modifies OwnershipControls for an Amazon S3 bucket. To use this // operation, you must have the s3:PutBucketOwnershipControls permission. For more diff --git a/service/s3/api_op_PutBucketReplication.go b/service/s3/api_op_PutBucketReplication.go index 1b67f7ec331..2655ff24709 100644 --- a/service/s3/api_op_PutBucketReplication.go +++ b/service/s3/api_op_PutBucketReplication.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Creates a replication configuration or replaces an existing one. For more // information, see [Replication]in the Amazon S3 User Guide. diff --git a/service/s3/api_op_PutBucketRequestPayment.go b/service/s3/api_op_PutBucketRequestPayment.go index fb9ffd47560..14b2a5b6940 100644 --- a/service/s3/api_op_PutBucketRequestPayment.go +++ b/service/s3/api_op_PutBucketRequestPayment.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets the request payment configuration for a bucket. By default, the bucket // owner pays for downloads from the bucket. This configuration parameter enables diff --git a/service/s3/api_op_PutBucketTagging.go b/service/s3/api_op_PutBucketTagging.go index 7bd67f9bf98..5d9761c0062 100644 --- a/service/s3/api_op_PutBucketTagging.go +++ b/service/s3/api_op_PutBucketTagging.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets the tags for a bucket. // diff --git a/service/s3/api_op_PutBucketVersioning.go b/service/s3/api_op_PutBucketVersioning.go index 04cbcf08dc4..cdb199cfaf3 100644 --- a/service/s3/api_op_PutBucketVersioning.go +++ b/service/s3/api_op_PutBucketVersioning.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // When you enable versioning on a bucket for the first time, it might take a // short amount of time for the change to be fully propagated. We recommend that diff --git a/service/s3/api_op_PutBucketWebsite.go b/service/s3/api_op_PutBucketWebsite.go index ebcb87f4fa3..be78f71af5c 100644 --- a/service/s3/api_op_PutBucketWebsite.go +++ b/service/s3/api_op_PutBucketWebsite.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets the configuration of the website that is specified in the website // subresource. To configure a bucket as a website, you can add this subresource on diff --git a/service/s3/api_op_PutObject.go b/service/s3/api_op_PutObject.go index 60e0e419b63..c47c8729560 100644 --- a/service/s3/api_op_PutObject.go +++ b/service/s3/api_op_PutObject.go @@ -593,6 +593,14 @@ type PutObjectInput struct { // [Object Key and Metadata]: https://docs.aws.amazon.com/AmazonS3/latest/dev/UsingMetadata.html WebsiteRedirectLocation *string + // Specifies the offset for appending data to existing objects in bytes. The + // offset must be equal to the size of the existing object being appended to. If no + // object exists, setting this header to 0 will create a new object. + // + // This functionality is only supported for objects in the Amazon S3 Express One + // Zone storage class in directory buckets. + WriteOffsetBytes *int64 + noSmithyDocumentSerde } @@ -708,6 +716,13 @@ type PutObjectOutput struct { // S3. ServerSideEncryption types.ServerSideEncryption + // The size of the object in bytes. This will only be present if you append to an + // object. + // + // This functionality is only supported for objects in the Amazon S3 Express One + // Zone storage class in directory buckets. + Size *int64 + // Version ID of the object. // // If you enable versioning for a bucket, Amazon S3 automatically generates a diff --git a/service/s3/api_op_PutObjectAcl.go b/service/s3/api_op_PutObjectAcl.go index 481384026de..6c13ee838b0 100644 --- a/service/s3/api_op_PutObjectAcl.go +++ b/service/s3/api_op_PutObjectAcl.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Uses the acl subresource to set the access control list (ACL) permissions for a // new or existing object in an S3 bucket. You must have the WRITE_ACP permission diff --git a/service/s3/api_op_PutObjectLegalHold.go b/service/s3/api_op_PutObjectLegalHold.go index 22737391d50..be713b88c94 100644 --- a/service/s3/api_op_PutObjectLegalHold.go +++ b/service/s3/api_op_PutObjectLegalHold.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Applies a legal hold configuration to the specified object. For more // information, see [Locking Objects]. diff --git a/service/s3/api_op_PutObjectLockConfiguration.go b/service/s3/api_op_PutObjectLockConfiguration.go index 3b0501d83bf..e1f7930f2ee 100644 --- a/service/s3/api_op_PutObjectLockConfiguration.go +++ b/service/s3/api_op_PutObjectLockConfiguration.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Places an Object Lock configuration on the specified bucket. The rule specified // in the Object Lock configuration will be applied by default to every new object diff --git a/service/s3/api_op_PutObjectRetention.go b/service/s3/api_op_PutObjectRetention.go index 6bb5682fca8..7c5a611a245 100644 --- a/service/s3/api_op_PutObjectRetention.go +++ b/service/s3/api_op_PutObjectRetention.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Places an Object Retention configuration on an object. For more information, // see [Locking Objects]. Users or accounts require the s3:PutObjectRetention permission in order diff --git a/service/s3/api_op_PutObjectTagging.go b/service/s3/api_op_PutObjectTagging.go index 1f637c939b0..2703eef4eee 100644 --- a/service/s3/api_op_PutObjectTagging.go +++ b/service/s3/api_op_PutObjectTagging.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Sets the supplied tag-set to an object that already exists in a bucket. A tag // is a key-value pair. For more information, see [Object Tagging]. diff --git a/service/s3/api_op_PutPublicAccessBlock.go b/service/s3/api_op_PutPublicAccessBlock.go index 7878fb783d9..d1d05a6f447 100644 --- a/service/s3/api_op_PutPublicAccessBlock.go +++ b/service/s3/api_op_PutPublicAccessBlock.go @@ -15,7 +15,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Creates or modifies the PublicAccessBlock configuration for an Amazon S3 // bucket. To use this operation, you must have the s3:PutBucketPublicAccessBlock diff --git a/service/s3/api_op_RestoreObject.go b/service/s3/api_op_RestoreObject.go index cadb89ac2a1..022dad38eec 100644 --- a/service/s3/api_op_RestoreObject.go +++ b/service/s3/api_op_RestoreObject.go @@ -14,7 +14,7 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // # Restores an archived copy of an object back into Amazon S3 // diff --git a/service/s3/api_op_SelectObjectContent.go b/service/s3/api_op_SelectObjectContent.go index 8497b4685a8..1b292e21b76 100644 --- a/service/s3/api_op_SelectObjectContent.go +++ b/service/s3/api_op_SelectObjectContent.go @@ -14,7 +14,7 @@ import ( "sync" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // This action filters the contents of an Amazon S3 object based on a simple // structured query language (SQL) statement. In the request, along with the SQL diff --git a/service/s3/api_op_UploadPartCopy.go b/service/s3/api_op_UploadPartCopy.go index a0b4e5eff69..598845a6498 100644 --- a/service/s3/api_op_UploadPartCopy.go +++ b/service/s3/api_op_UploadPartCopy.go @@ -100,33 +100,28 @@ import ( // For example policies, see [Example bucket policies for S3 Express One Zone]and [Amazon Web Services Identity and Access Management (IAM) identity-based policies for S3 Express One Zone]in the Amazon S3 User Guide. // // Encryption -// - General purpose buckets - // -// For information about using server-side encryption with customer-provided +// - General purpose buckets - For information about using server-side +// encryption with customer-provided encryption keys with the UploadPartCopy +// operation, see [CopyObject]and [UploadPart]. // -// encryption keys with the UploadPartCopy operation, see [CopyObject]and [UploadPart]. -// -// - Directory buckets - For directory buckets, there are only two supported -// options for server-side encryption: server-side encryption with Amazon S3 -// managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys -// (SSE-KMS) ( aws:kms ). For more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. +// - Directory buckets - For directory buckets, there are only two supported +// options for server-side encryption: server-side encryption with Amazon S3 +// managed keys (SSE-S3) ( AES256 ) and server-side encryption with KMS keys +// (SSE-KMS) ( aws:kms ). For more information, see [Protecting data with server-side encryption]in the Amazon S3 User Guide. // // For directory buckets, when you perform a CreateMultipartUpload operation and an // -// UploadPartCopy operation, -// -// the request headers you provide in the CreateMultipartUpload request must match -// -// the default encryption configuration of the destination bucket. +// UploadPartCopy operation, the request headers you provide in the +// CreateMultipartUpload request must match the default encryption configuration +// of the destination bucket. // // S3 Bucket Keys aren't supported, when you copy SSE-KMS encrypted objects from // -// general purpose buckets -// -// to directory buckets, from directory buckets to general purpose buckets, or -// -// between directory buckets, through [UploadPartCopy]. In this case, Amazon S3 makes a call to -// KMS every time a copy request is made for a KMS-encrypted object. +// general purpose buckets to directory buckets, from directory buckets to general +// purpose buckets, or between directory buckets, through [UploadPartCopy]. In this case, Amazon +// S3 makes a call to KMS every time a copy request is made for a KMS-encrypted +// object. // // Special errors // @@ -166,6 +161,7 @@ import ( // [UploadPart]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPart.html // [Regional and Zonal endpoints]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-Regions-and-Zones.html // [Protecting data using server-side encryption with KMS]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/UsingKMSEncryption.html +// [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html // [Multipart upload and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/dev/mpuAndPermissions.html // [Multipart upload API and permissions]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/mpuoverview.html#mpuAndPermissions // [CompleteMultipartUpload]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CompleteMultipartUpload.html @@ -176,11 +172,10 @@ import ( // [REST Authentication]: https://docs.aws.amazon.com/AmazonS3/latest/dev/RESTAuthentication.html // [Example bucket policies for S3 Express One Zone]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-security-iam-example-bucket-policies.html // [Operations on Objects]: https://docs.aws.amazon.com/AmazonS3/latest/dev/ObjectOperations.html +// [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html // [ListMultipartUploads]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_ListMultipartUploads.html // -// [CopyObject]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_CopyObject.html // [UploadPartCopy]: https://docs.aws.amazon.com/AmazonS3/latest/API/API_UploadPartCopy.html -// [Protecting data with server-side encryption]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/s3-express-serv-side-encryption.html func (c *Client) UploadPartCopy(ctx context.Context, params *UploadPartCopyInput, optFns ...func(*Options)) (*UploadPartCopyOutput, error) { if params == nil { params = &UploadPartCopyInput{} diff --git a/service/s3/api_op_WriteGetObjectResponse.go b/service/s3/api_op_WriteGetObjectResponse.go index a72c98bfba6..83c91bafa34 100644 --- a/service/s3/api_op_WriteGetObjectResponse.go +++ b/service/s3/api_op_WriteGetObjectResponse.go @@ -18,7 +18,7 @@ import ( "time" ) -// This operation is not supported by directory buckets. +// This operation is not supported for directory buckets. // // Passes transformed objects to a GetObject operation when using Object Lambda // access points. For information about Object Lambda access points, see [Transforming objects with Object Lambda access points]in the diff --git a/service/s3/deserializers.go b/service/s3/deserializers.go index 47db0f339cc..48ead3039af 100644 --- a/service/s3/deserializers.go +++ b/service/s3/deserializers.go @@ -11703,6 +11703,18 @@ func awsRestxml_deserializeOpErrorPutObject(response *smithyhttp.Response, metad } errorBody.Seek(0, io.SeekStart) switch { + case strings.EqualFold("EncryptionTypeMismatch", errorCode): + return awsRestxml_deserializeErrorEncryptionTypeMismatch(response, errorBody) + + case strings.EqualFold("InvalidRequest", errorCode): + return awsRestxml_deserializeErrorInvalidRequest(response, errorBody) + + case strings.EqualFold("InvalidWriteOffset", errorCode): + return awsRestxml_deserializeErrorInvalidWriteOffset(response, errorBody) + + case strings.EqualFold("TooManyParts", errorCode): + return awsRestxml_deserializeErrorTooManyParts(response, errorBody) + default: genericError := &smithy.GenericAPIError{ Code: errorCode, @@ -11767,6 +11779,15 @@ func awsRestxml_deserializeOpHttpBindingsPutObjectOutput(v *PutObjectOutput, res v.ServerSideEncryption = types.ServerSideEncryption(headerValues[0]) } + if headerValues := response.Header.Values("x-amz-object-size"); len(headerValues) != 0 { + headerValues[0] = strings.TrimSpace(headerValues[0]) + vv, err := strconv.ParseInt(headerValues[0], 0, 64) + if err != nil { + return err + } + v.Size = ptr.Int64(vv) + } + if headerValues := response.Header.Values("x-amz-server-side-encryption-customer-algorithm"); len(headerValues) != 0 { headerValues[0] = strings.TrimSpace(headerValues[0]) v.SSECustomerAlgorithm = ptr.String(headerValues[0]) @@ -13451,6 +13472,11 @@ func awsRestxml_deserializeErrorBucketAlreadyOwnedByYou(response *smithyhttp.Res return output } +func awsRestxml_deserializeErrorEncryptionTypeMismatch(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.EncryptionTypeMismatch{} + return output +} + func awsRestxml_deserializeErrorInvalidObjectState(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.InvalidObjectState{} var buff [1024]byte @@ -13484,6 +13510,16 @@ func awsRestxml_deserializeErrorInvalidObjectState(response *smithyhttp.Response return output } +func awsRestxml_deserializeErrorInvalidRequest(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidRequest{} + return output +} + +func awsRestxml_deserializeErrorInvalidWriteOffset(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.InvalidWriteOffset{} + return output +} + func awsRestxml_deserializeErrorNoSuchBucket(response *smithyhttp.Response, errorBody *bytes.Reader) error { output := &types.NoSuchBucket{} return output @@ -13514,6 +13550,11 @@ func awsRestxml_deserializeErrorObjectNotInActiveTierError(response *smithyhttp. return output } +func awsRestxml_deserializeErrorTooManyParts(response *smithyhttp.Response, errorBody *bytes.Reader) error { + output := &types.TooManyParts{} + return output +} + func awsRestxml_deserializeDocumentAbortIncompleteMultipartUpload(v **types.AbortIncompleteMultipartUpload, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -15809,6 +15850,42 @@ func awsRestxml_deserializeDocumentEncryptionConfiguration(v **types.EncryptionC return nil } +func awsRestxml_deserializeDocumentEncryptionTypeMismatch(v **types.EncryptionTypeMismatch, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.EncryptionTypeMismatch + if *v == nil { + sv = &types.EncryptionTypeMismatch{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // 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_deserializeDocumentError(v **types.Error, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -17164,6 +17241,78 @@ func awsRestxml_deserializeDocumentInvalidObjectState(v **types.InvalidObjectSta return nil } +func awsRestxml_deserializeDocumentInvalidRequest(v **types.InvalidRequest, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidRequest + if *v == nil { + sv = &types.InvalidRequest{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // 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_deserializeDocumentInvalidWriteOffset(v **types.InvalidWriteOffset, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.InvalidWriteOffset + if *v == nil { + sv = &types.InvalidWriteOffset{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // 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_deserializeDocumentInventoryConfiguration(v **types.InventoryConfiguration, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -22943,6 +23092,42 @@ func awsRestxml_deserializeDocumentTieringListUnwrapped(v *[]types.Tiering, deco *v = sv return nil } +func awsRestxml_deserializeDocumentTooManyParts(v **types.TooManyParts, decoder smithyxml.NodeDecoder) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + var sv *types.TooManyParts + if *v == nil { + sv = &types.TooManyParts{} + } else { + sv = *v + } + + for { + t, done, err := decoder.Token() + if err != nil { + return err + } + if done { + break + } + originalDecoder := decoder + decoder = smithyxml.WrapNodeDecoder(originalDecoder.Decoder, t) + switch { + default: + // 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_deserializeDocumentTopicConfiguration(v **types.TopicConfiguration, decoder smithyxml.NodeDecoder) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/s3/serializers.go b/service/s3/serializers.go index a55233c5bac..eecad22df8d 100644 --- a/service/s3/serializers.go +++ b/service/s3/serializers.go @@ -83,6 +83,11 @@ func awsRestxml_serializeOpHttpBindingsAbortMultipartUploadInput(v *AbortMultipa encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } + if v.IfMatchInitiatedTime != nil { + locationName := "X-Amz-If-Match-Initiated-Time" + encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfMatchInitiatedTime)) + } + if v.Key == nil || len(*v.Key) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} } @@ -1898,6 +1903,21 @@ func awsRestxml_serializeOpHttpBindingsDeleteObjectInput(v *DeleteObjectInput, e encoder.SetHeader(locationName).String(*v.ExpectedBucketOwner) } + if v.IfMatch != nil { + locationName := "If-Match" + encoder.SetHeader(locationName).String(*v.IfMatch) + } + + if v.IfMatchLastModifiedTime != nil { + locationName := "X-Amz-If-Match-Last-Modified-Time" + encoder.SetHeader(locationName).String(smithytime.FormatHTTPDate(*v.IfMatchLastModifiedTime)) + } + + if v.IfMatchSize != nil { + locationName := "X-Amz-If-Match-Size" + encoder.SetHeader(locationName).Long(*v.IfMatchSize) + } + if v.Key == nil || len(*v.Key) == 0 { return &smithy.SerializationError{Err: fmt.Errorf("input member Key must not be empty")} } @@ -7637,6 +7657,11 @@ func awsRestxml_serializeOpHttpBindingsPutObjectInput(v *PutObjectInput, encoder encoder.SetHeader(locationName).String(*v.WebsiteRedirectLocation) } + if v.WriteOffsetBytes != nil { + locationName := "X-Amz-Write-Offset-Bytes" + encoder.SetHeader(locationName).Long(*v.WriteOffsetBytes) + } + return nil } @@ -11740,6 +11765,17 @@ func awsRestxml_serializeDocumentNotificationConfigurationFilter(v *types.Notifi func awsRestxml_serializeDocumentObjectIdentifier(v *types.ObjectIdentifier, value smithyxml.Value) error { defer value.Close() + if v.ETag != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "ETag", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(*v.ETag) + } if v.Key != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ @@ -11751,6 +11787,28 @@ func awsRestxml_serializeDocumentObjectIdentifier(v *types.ObjectIdentifier, val el := value.MemberElement(root) el.String(*v.Key) } + if v.LastModifiedTime != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "LastModifiedTime", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.String(smithytime.FormatHTTPDate(*v.LastModifiedTime)) + } + if v.Size != nil { + rootAttr := []smithyxml.Attr{} + root := smithyxml.StartElement{ + Name: smithyxml.Name{ + Local: "Size", + }, + Attr: rootAttr, + } + el := value.MemberElement(root) + el.Long(*v.Size) + } if v.VersionId != nil { rootAttr := []smithyxml.Attr{} root := smithyxml.StartElement{ diff --git a/service/s3/types/errors.go b/service/s3/types/errors.go index a01b922f73a..1070573a5a8 100644 --- a/service/s3/types/errors.go +++ b/service/s3/types/errors.go @@ -64,6 +64,35 @@ func (e *BucketAlreadyOwnedByYou) ErrorCode() string { } func (e *BucketAlreadyOwnedByYou) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// The existing object was created with a different encryption type. Subsequent +// +// write requests must include the appropriate encryption parameters in the request +// or while creating the session. +type EncryptionTypeMismatch struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *EncryptionTypeMismatch) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *EncryptionTypeMismatch) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *EncryptionTypeMismatch) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "EncryptionTypeMismatch" + } + return *e.ErrorCodeOverride +} +func (e *EncryptionTypeMismatch) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // Object is archived and inaccessible until restored. // // If the object you are retrieving is stored in the S3 Glacier Flexible Retrieval @@ -103,6 +132,69 @@ func (e *InvalidObjectState) ErrorCode() string { } func (e *InvalidObjectState) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// You may receive this error in multiple cases. Depending on the reason for the +// error, you may receive one of the messages below: +// +// - Cannot specify both a write offset value and user-defined object metadata +// for existing objects. +// +// - Checksum Type mismatch occurred, expected checksum Type: sha1, actual +// checksum Type: crc32c. +// +// - Request body cannot be empty when 'write offset' is specified. +type InvalidRequest struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidRequest) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidRequest) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidRequest) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidRequest" + } + return *e.ErrorCodeOverride +} +func (e *InvalidRequest) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The write offset value that you specified does not match the current object +// +// size. +type InvalidWriteOffset struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *InvalidWriteOffset) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *InvalidWriteOffset) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *InvalidWriteOffset) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "InvalidWriteOffset" + } + return *e.ErrorCodeOverride +} +func (e *InvalidWriteOffset) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The specified bucket does not exist. type NoSuchBucket struct { Message *string @@ -259,3 +351,32 @@ func (e *ObjectNotInActiveTierError) ErrorCode() string { return *e.ErrorCodeOverride } func (e *ObjectNotInActiveTierError) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// You have attempted to add more parts than the maximum of 10000 that are +// +// allowed for this object. You can use the CopyObject operation to copy this +// object to another and then add more data to the newly copied object. +type TooManyParts struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *TooManyParts) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *TooManyParts) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *TooManyParts) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "TooManyParts" + } + return *e.ErrorCodeOverride +} +func (e *TooManyParts) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/s3/types/types.go b/service/s3/types/types.go index dec61a6f520..04018a34149 100644 --- a/service/s3/types/types.go +++ b/service/s3/types/types.go @@ -2168,6 +2168,9 @@ type LifecycleExpiration struct { // Indicates at what date the object is to be moved or deleted. The date value // must conform to the ISO 8601 format. The time is always midnight UTC. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. Date *time.Time // Indicates the lifetime, in days, of the objects that are subject to the rule. @@ -2178,6 +2181,9 @@ type LifecycleExpiration struct { // versions. If set to true, the delete marker will be expired; if set to false the // policy takes no action. This cannot be specified with Days or Date in a // Lifecycle Expiration Policy. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. ExpiredObjectDeleteMarker *bool noSmithyDocumentSerde @@ -2210,6 +2216,8 @@ type LifecycleRule struct { // The Filter is used to identify objects that a Lifecycle Rule applies to. A // Filter must have exactly one of Prefix , Tag , or And specified. Filter is // required if the LifecycleRule does not contain a Prefix element. + // + // Tag filters are not supported for directory buckets. Filter *LifecycleRuleFilter // Unique identifier for the rule. The value cannot be longer than 255 characters. @@ -2220,13 +2228,19 @@ type LifecycleRule struct { // configuration action on a bucket that has versioning enabled (or suspended) to // request that Amazon S3 delete noncurrent object versions at a specific period in // the object's lifetime. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. NoncurrentVersionExpiration *NoncurrentVersionExpiration - // Specifies the transition rule for the lifecycle rule that describes when + // Specifies the transition rule for the lifecycle rule that describes when // noncurrent objects transition to a specific storage class. If your bucket is // versioning-enabled (or versioning is suspended), you can set this action to // request that Amazon S3 transition noncurrent object versions to a specific // storage class at a set period in the object's lifetime. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. NoncurrentVersionTransitions []NoncurrentVersionTransition // Prefix identifying one or more objects to which the rule applies. This is no @@ -2241,6 +2255,9 @@ type LifecycleRule struct { Prefix *string // Specifies when an Amazon S3 object transitions to a specified storage class. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. Transitions []Transition noSmithyDocumentSerde @@ -2293,6 +2310,9 @@ type LifecycleRuleFilter struct { Prefix *string // This tag must exist in the object's tag set in order for the rule to apply. + // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. Tag *Tag noSmithyDocumentSerde @@ -2521,6 +2541,9 @@ type MultipartUpload struct { // configuration action on a bucket that has versioning enabled (or suspended) to // request that Amazon S3 delete noncurrent object versions at a specific period in // the object's lifetime. +// +// This parameter applies to general purpose buckets only. It is not supported for +// directory bucket lifecycle configurations. type NoncurrentVersionExpiration struct { // Specifies how many noncurrent versions Amazon S3 will retain. You can specify @@ -2528,6 +2551,9 @@ type NoncurrentVersionExpiration struct { // additional noncurrent versions beyond the specified number to retain. For more // information about noncurrent versions, see [Lifecycle configuration elements]in the Amazon S3 User Guide. // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // // [Lifecycle configuration elements]: https://docs.aws.amazon.com/AmazonS3/latest/userguide/intro-lifecycle-rules.html NewerNoncurrentVersions *int32 @@ -2536,6 +2562,9 @@ type NoncurrentVersionExpiration struct { // For information about the noncurrent days calculations, see [How Amazon S3 Calculates When an Object Became Noncurrent]in the Amazon S3 // User Guide. // + // This parameter applies to general purpose buckets only. It is not supported for + // directory bucket lifecycle configurations. + // // [How Amazon S3 Calculates When an Object Became Noncurrent]: https://docs.aws.amazon.com/AmazonS3/latest/dev/intro-lifecycle-rules.html#non-current-days-calculations NoncurrentDays *int32 @@ -2683,6 +2712,26 @@ type ObjectIdentifier struct { // This member is required. Key *string + // An entity tag (ETag) is an identifier assigned by a web server to a specific + // version of a resource found at a URL. This header field makes the request method + // conditional on ETags . + // + // Entity tags (ETags) for S3 Express One Zone are random alphanumeric strings + // unique to the object. + ETag *string + + // If present, the objects are deleted only if its modification times matches the + // provided Timestamp . + // + // This functionality is only supported for directory buckets. + LastModifiedTime *time.Time + + // If present, the objects are deleted only if its size matches the provided size + // in bytes. + // + // This functionality is only supported for directory buckets. + Size *int64 + // Version ID for the specific version of the object to delete. // // This functionality is not supported for directory buckets. diff --git a/service/ssm/api_op_CreatePatchBaseline.go b/service/ssm/api_op_CreatePatchBaseline.go index f2f8b510b20..30e80df34c3 100644 --- a/service/ssm/api_op_CreatePatchBaseline.go +++ b/service/ssm/api_op_CreatePatchBaseline.go @@ -65,6 +65,10 @@ type CreatePatchBaselineInput struct { Description *string // A set of global filters used to include patches in the baseline. + // + // The GlobalFilters parameter can be configured only by using the CLI or an + // Amazon Web Services SDK. It can't be configured from the Patch Manager console, + // and its value isn't displayed in the console. GlobalFilters *types.PatchFilterGroup // Defines the operating system the patch baseline applies to. The default value diff --git a/service/ssm/api_op_CreateResourceDataSync.go b/service/ssm/api_op_CreateResourceDataSync.go index 24cbc5d9711..984b480762d 100644 --- a/service/ssm/api_op_CreateResourceDataSync.go +++ b/service/ssm/api_op_CreateResourceDataSync.go @@ -18,7 +18,7 @@ import ( // You can configure Systems Manager Inventory to use the SyncToDestination type // to synchronize Inventory data from multiple Amazon Web Services Regions to a // single Amazon Simple Storage Service (Amazon S3) bucket. For more information, -// see [Creatinga a resource data sync for Inventory]in the Amazon Web Services Systems Manager User Guide. +// see [Creating a resource data sync for Inventory]in the Amazon Web Services Systems Manager User Guide. // // You can configure Systems Manager Explorer to use the SyncFromSource type to // synchronize operational work items (OpsItems) and operational data (OpsData) @@ -38,7 +38,7 @@ import ( // policy. // // [Setting up Systems Manager Explorer to display data from multiple accounts and Regions]: https://docs.aws.amazon.com/systems-manager/latest/userguide/Explorer-resource-data-sync.html -// [Creatinga a resource data sync for Inventory]: https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-create-resource-data-sync.html +// [Creating a resource data sync for Inventory]: https://docs.aws.amazon.com/systems-manager/latest/userguide/inventory-create-resource-data-sync.html func (c *Client) CreateResourceDataSync(ctx context.Context, params *CreateResourceDataSyncInput, optFns ...func(*Options)) (*CreateResourceDataSyncOutput, error) { if params == nil { params = &CreateResourceDataSyncInput{} diff --git a/service/ssm/api_op_GetExecutionPreview.go b/service/ssm/api_op_GetExecutionPreview.go new file mode 100644 index 00000000000..f1cdcf624e6 --- /dev/null +++ b/service/ssm/api_op_GetExecutionPreview.go @@ -0,0 +1,172 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Initiates the process of retrieving an existing preview that shows the effects +// that running a specified Automation runbook would have on the targeted +// resources. +func (c *Client) GetExecutionPreview(ctx context.Context, params *GetExecutionPreviewInput, optFns ...func(*Options)) (*GetExecutionPreviewOutput, error) { + if params == nil { + params = &GetExecutionPreviewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetExecutionPreview", params, optFns, c.addOperationGetExecutionPreviewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetExecutionPreviewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetExecutionPreviewInput struct { + + // The ID of the existing execution preview. + // + // This member is required. + ExecutionPreviewId *string + + noSmithyDocumentSerde +} + +type GetExecutionPreviewOutput struct { + + // A UTC timestamp indicating when the execution preview operation ended. + EndedAt *time.Time + + // Information about the changes that would be made if an execution were run. + ExecutionPreview types.ExecutionPreview + + // The generated ID for the existing execution preview. + ExecutionPreviewId *string + + // The current status of the execution preview operation. + Status types.ExecutionPreviewStatus + + // Supplemental information about the current status of the execution preview. + StatusMessage *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetExecutionPreviewMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpGetExecutionPreview{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpGetExecutionPreview{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetExecutionPreview"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetExecutionPreviewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetExecutionPreview(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetExecutionPreview(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetExecutionPreview", + } +} diff --git a/service/ssm/api_op_GetServiceSetting.go b/service/ssm/api_op_GetServiceSetting.go index 990d3667a35..508ef374568 100644 --- a/service/ssm/api_op_GetServiceSetting.go +++ b/service/ssm/api_op_GetServiceSetting.go @@ -48,16 +48,20 @@ type GetServiceSettingInput struct { // The ID of the service setting to get. The setting ID can be one of the // following. // - // - /ssm/managed-instance/default-ec2-instance-management-role + // - /ssm/appmanager/appmanager-enabled // // - /ssm/automation/customer-script-log-destination // // - /ssm/automation/customer-script-log-group-name // + // - /ssm/automation/enable-adaptive-concurrency + // // - /ssm/documents/console/public-sharing-permission // // - /ssm/managed-instance/activation-tier // + // - /ssm/managed-instance/default-ec2-instance-management-role + // // - /ssm/opsinsights/opscenter // // - /ssm/parameter-store/default-parameter-tier diff --git a/service/ssm/api_op_ListNodes.go b/service/ssm/api_op_ListNodes.go new file mode 100644 index 00000000000..c281a7ce7ff --- /dev/null +++ b/service/ssm/api_op_ListNodes.go @@ -0,0 +1,267 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Takes in filters and returns a list of managed nodes matching the filter +// criteria. +func (c *Client) ListNodes(ctx context.Context, params *ListNodesInput, optFns ...func(*Options)) (*ListNodesOutput, error) { + if params == nil { + params = &ListNodesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListNodes", params, optFns, c.addOperationListNodesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListNodesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListNodesInput struct { + + // One or more filters. Use a filter to return a more specific list of managed + // nodes. + Filters []types.NodeFilter + + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + MaxResults *int32 + + // The token for the next set of items to return. (You received this token from a + // previous call.) + NextToken *string + + // The name of the resource data sync to retrieve information about. Required for + // cross-account/cross-Region configurations. Optional for single + // account/single-Region configurations. + SyncName *string + + noSmithyDocumentSerde +} + +type ListNodesOutput struct { + + // The token to use when requesting the next set of items. If there are no + // additional items to return, the string is empty. + NextToken *string + + // A list of managed nodes that match the specified filter criteria. + Nodes []types.Node + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListNodesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListNodes{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListNodes{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListNodes"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListNodesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListNodes(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListNodesPaginatorOptions is the paginator options for ListNodes +type ListNodesPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListNodesPaginator is a paginator for ListNodes +type ListNodesPaginator struct { + options ListNodesPaginatorOptions + client ListNodesAPIClient + params *ListNodesInput + nextToken *string + firstPage bool +} + +// NewListNodesPaginator returns a new ListNodesPaginator +func NewListNodesPaginator(client ListNodesAPIClient, params *ListNodesInput, optFns ...func(*ListNodesPaginatorOptions)) *ListNodesPaginator { + if params == nil { + params = &ListNodesInput{} + } + + options := ListNodesPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListNodesPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNodesPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListNodes page. +func (p *ListNodesPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodesOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListNodes(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 +} + +// ListNodesAPIClient is a client that implements the ListNodes operation. +type ListNodesAPIClient interface { + ListNodes(context.Context, *ListNodesInput, ...func(*Options)) (*ListNodesOutput, error) +} + +var _ ListNodesAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListNodes(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListNodes", + } +} diff --git a/service/ssm/api_op_ListNodesSummary.go b/service/ssm/api_op_ListNodesSummary.go new file mode 100644 index 00000000000..594b7480158 --- /dev/null +++ b/service/ssm/api_op_ListNodesSummary.go @@ -0,0 +1,277 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Generates a summary of managed instance/node metadata based on the filters and +// aggregators you specify. Results are grouped by the input aggregator you +// specify. +func (c *Client) ListNodesSummary(ctx context.Context, params *ListNodesSummaryInput, optFns ...func(*Options)) (*ListNodesSummaryOutput, error) { + if params == nil { + params = &ListNodesSummaryInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListNodesSummary", params, optFns, c.addOperationListNodesSummaryMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListNodesSummaryOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListNodesSummaryInput struct { + + // Specify one or more aggregators to return a count of managed nodes that match + // that expression. For example, a count of managed nodes by operating system. + // + // This member is required. + Aggregators []types.NodeAggregator + + // One or more filters. Use a filter to generate a summary that matches your + // specified filter criteria. + Filters []types.NodeFilter + + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + MaxResults *int32 + + // The token for the next set of items to return. (You received this token from a + // previous call.) The call also returns a token that you can specify in a + // subsequent call to get the next set of results. + NextToken *string + + // The name of the resource data sync to retrieve information about. Required for + // cross-account/cross-Region configuration. Optional for single + // account/single-Region configurations. + SyncName *string + + noSmithyDocumentSerde +} + +type ListNodesSummaryOutput struct { + + // The token to use when requesting the next set of items. If there are no + // additional items to return, the string is empty. + NextToken *string + + // A collection of objects reporting information about your managed nodes, such as + // the count of nodes by operating system. + Summary []map[string]string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListNodesSummaryMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpListNodesSummary{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpListNodesSummary{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListNodesSummary"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListNodesSummaryValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListNodesSummary(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListNodesSummaryPaginatorOptions is the paginator options for ListNodesSummary +type ListNodesSummaryPaginatorOptions struct { + // The maximum number of items to return for this call. The call also returns a + // token that you can specify in a subsequent call to get the next set of results. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListNodesSummaryPaginator is a paginator for ListNodesSummary +type ListNodesSummaryPaginator struct { + options ListNodesSummaryPaginatorOptions + client ListNodesSummaryAPIClient + params *ListNodesSummaryInput + nextToken *string + firstPage bool +} + +// NewListNodesSummaryPaginator returns a new ListNodesSummaryPaginator +func NewListNodesSummaryPaginator(client ListNodesSummaryAPIClient, params *ListNodesSummaryInput, optFns ...func(*ListNodesSummaryPaginatorOptions)) *ListNodesSummaryPaginator { + if params == nil { + params = &ListNodesSummaryInput{} + } + + options := ListNodesSummaryPaginatorOptions{} + if params.MaxResults != nil { + options.Limit = *params.MaxResults + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListNodesSummaryPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.NextToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListNodesSummaryPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListNodesSummary page. +func (p *ListNodesSummaryPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListNodesSummaryOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.NextToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxResults = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListNodesSummary(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 +} + +// ListNodesSummaryAPIClient is a client that implements the ListNodesSummary +// operation. +type ListNodesSummaryAPIClient interface { + ListNodesSummary(context.Context, *ListNodesSummaryInput, ...func(*Options)) (*ListNodesSummaryOutput, error) +} + +var _ ListNodesSummaryAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListNodesSummary(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListNodesSummary", + } +} diff --git a/service/ssm/api_op_ResetServiceSetting.go b/service/ssm/api_op_ResetServiceSetting.go index eefc0c1fea2..1fb93549a49 100644 --- a/service/ssm/api_op_ResetServiceSetting.go +++ b/service/ssm/api_op_ResetServiceSetting.go @@ -48,16 +48,20 @@ type ResetServiceSettingInput struct { // The Amazon Resource Name (ARN) of the service setting to reset. The setting ID // can be one of the following. // - // - /ssm/managed-instance/default-ec2-instance-management-role + // - /ssm/appmanager/appmanager-enabled // // - /ssm/automation/customer-script-log-destination // // - /ssm/automation/customer-script-log-group-name // + // - /ssm/automation/enable-adaptive-concurrency + // // - /ssm/documents/console/public-sharing-permission // // - /ssm/managed-instance/activation-tier // + // - /ssm/managed-instance/default-ec2-instance-management-role + // // - /ssm/opsinsights/opscenter // // - /ssm/parameter-store/default-parameter-tier diff --git a/service/ssm/api_op_StartExecutionPreview.go b/service/ssm/api_op_StartExecutionPreview.go new file mode 100644 index 00000000000..7f91ee74d78 --- /dev/null +++ b/service/ssm/api_op_StartExecutionPreview.go @@ -0,0 +1,165 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssm + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssm/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Initiates the process of creating a preview showing the effects that running a +// specified Automation runbook would have on the targeted resources. +func (c *Client) StartExecutionPreview(ctx context.Context, params *StartExecutionPreviewInput, optFns ...func(*Options)) (*StartExecutionPreviewOutput, error) { + if params == nil { + params = &StartExecutionPreviewInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartExecutionPreview", params, optFns, c.addOperationStartExecutionPreviewMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartExecutionPreviewOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartExecutionPreviewInput struct { + + // The name of the Automation runbook to run. The result of the execution preview + // indicates what the impact would be of running this runbook. + // + // This member is required. + DocumentName *string + + // The version of the Automation runbook to run. The default value is $DEFAULT . + DocumentVersion *string + + // Information about the inputs that can be specified for the preview operation. + ExecutionInputs types.ExecutionInputs + + noSmithyDocumentSerde +} + +type StartExecutionPreviewOutput struct { + + // The ID of the execution preview generated by the system. + ExecutionPreviewId *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartExecutionPreviewMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsAwsjson11_serializeOpStartExecutionPreview{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsAwsjson11_deserializeOpStartExecutionPreview{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartExecutionPreview"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartExecutionPreviewValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartExecutionPreview(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartExecutionPreview(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartExecutionPreview", + } +} diff --git a/service/ssm/api_op_UpdatePatchBaseline.go b/service/ssm/api_op_UpdatePatchBaseline.go index b6aa83590e4..c8009d931f8 100644 --- a/service/ssm/api_op_UpdatePatchBaseline.go +++ b/service/ssm/api_op_UpdatePatchBaseline.go @@ -62,6 +62,10 @@ type UpdatePatchBaselineInput struct { Description *string // A set of global filters used to include patches in the baseline. + // + // The GlobalFilters parameter can be configured only by using the CLI or an + // Amazon Web Services SDK. It can't be configured from the Patch Manager console, + // and its value isn't displayed in the console. GlobalFilters *types.PatchFilterGroup // The name of the patch baseline. diff --git a/service/ssm/api_op_UpdateServiceSetting.go b/service/ssm/api_op_UpdateServiceSetting.go index 80cc9f9cca2..4f32ae0f6da 100644 --- a/service/ssm/api_op_UpdateServiceSetting.go +++ b/service/ssm/api_op_UpdateServiceSetting.go @@ -48,16 +48,20 @@ type UpdateServiceSettingInput struct { // arn:aws:ssm:us-east-1:111122223333:servicesetting/ssm/parameter-store/high-throughput-enabled // . The setting ID can be one of the following. // - // - /ssm/managed-instance/default-ec2-instance-management-role + // - /ssm/appmanager/appmanager-enabled // // - /ssm/automation/customer-script-log-destination // // - /ssm/automation/customer-script-log-group-name // + // - /ssm/automation/enable-adaptive-concurrency + // // - /ssm/documents/console/public-sharing-permission // // - /ssm/managed-instance/activation-tier // + // - /ssm/managed-instance/default-ec2-instance-management-role + // // - /ssm/opsinsights/opscenter // // - /ssm/parameter-store/default-parameter-tier @@ -75,8 +79,7 @@ type UpdateServiceSettingInput struct { // The new value to specify for the service setting. The following list specifies // the available values for each setting. // - // - For /ssm/managed-instance/default-ec2-instance-management-role , enter the - // name of an IAM role. + // - For /ssm/appmanager/appmanager-enabled , enter True or False . // // - For /ssm/automation/customer-script-log-destination , enter CloudWatch . // @@ -88,6 +91,9 @@ type UpdateServiceSettingInput struct { // // - For /ssm/managed-instance/activation-tier , enter standard or advanced . // + // - For /ssm/managed-instance/default-ec2-instance-management-role , enter the + // name of an IAM role. + // // - For /ssm/opsinsights/opscenter , enter Enabled or Disabled . // // - For /ssm/parameter-store/default-parameter-tier , enter Standard , Advanced diff --git a/service/ssm/deserializers.go b/service/ssm/deserializers.go index 33b33e32f9b..20ef3c4142f 100644 --- a/service/ssm/deserializers.go +++ b/service/ssm/deserializers.go @@ -8295,6 +8295,120 @@ func awsAwsjson11_deserializeOpErrorGetDocument(response *smithyhttp.Response, m } } +type awsAwsjson11_deserializeOpGetExecutionPreview struct { +} + +func (*awsAwsjson11_deserializeOpGetExecutionPreview) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpGetExecutionPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorGetExecutionPreview(response, &metadata) + } + output := &GetExecutionPreviewOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentGetExecutionPreviewOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorGetExecutionPreview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpGetInventory struct { } @@ -11727,14 +11841,14 @@ func awsAwsjson11_deserializeOpErrorListInventoryEntries(response *smithyhttp.Re } } -type awsAwsjson11_deserializeOpListOpsItemEvents struct { +type awsAwsjson11_deserializeOpListNodes struct { } -func (*awsAwsjson11_deserializeOpListOpsItemEvents) ID() string { +func (*awsAwsjson11_deserializeOpListNodes) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListOpsItemEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListNodes) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11752,9 +11866,9 @@ func (m *awsAwsjson11_deserializeOpListOpsItemEvents) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOpsItemEvents(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListNodes(response, &metadata) } - output := &ListOpsItemEventsOutput{} + output := &ListNodesOutput{} out.Result = output var buff [1024]byte @@ -11774,7 +11888,7 @@ func (m *awsAwsjson11_deserializeOpListOpsItemEvents) HandleDeserialize(ctx cont return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListOpsItemEventsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListNodesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11788,7 +11902,7 @@ func (m *awsAwsjson11_deserializeOpListOpsItemEvents) HandleDeserialize(ctx cont return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListNodes(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -11828,14 +11942,17 @@ func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Respo case strings.EqualFold("InternalServerError", errorCode): return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) - case strings.EqualFold("OpsItemInvalidParameterException", errorCode): - return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) + case strings.EqualFold("InvalidFilter", errorCode): + return awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody) - case strings.EqualFold("OpsItemLimitExceededException", errorCode): - return awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody) + case strings.EqualFold("InvalidNextToken", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) - case strings.EqualFold("OpsItemNotFoundException", errorCode): - return awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody) + case strings.EqualFold("ResourceDataSyncNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceDataSyncNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -11847,14 +11964,14 @@ func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Respo } } -type awsAwsjson11_deserializeOpListOpsItemRelatedItems struct { +type awsAwsjson11_deserializeOpListNodesSummary struct { } -func (*awsAwsjson11_deserializeOpListOpsItemRelatedItems) ID() string { +func (*awsAwsjson11_deserializeOpListNodesSummary) ID() string { return "OperationDeserializer" } -func (m *awsAwsjson11_deserializeOpListOpsItemRelatedItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsAwsjson11_deserializeOpListNodesSummary) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -11872,9 +11989,9 @@ func (m *awsAwsjson11_deserializeOpListOpsItemRelatedItems) HandleDeserialize(ct } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsAwsjson11_deserializeOpErrorListOpsItemRelatedItems(response, &metadata) + return out, metadata, awsAwsjson11_deserializeOpErrorListNodesSummary(response, &metadata) } - output := &ListOpsItemRelatedItemsOutput{} + output := &ListNodesSummaryOutput{} out.Result = output var buff [1024]byte @@ -11894,7 +12011,7 @@ func (m *awsAwsjson11_deserializeOpListOpsItemRelatedItems) HandleDeserialize(ct return out, metadata, err } - err = awsAwsjson11_deserializeOpDocumentListOpsItemRelatedItemsOutput(&output, shape) + err = awsAwsjson11_deserializeOpDocumentListNodesSummaryOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -11908,7 +12025,253 @@ func (m *awsAwsjson11_deserializeOpListOpsItemRelatedItems) HandleDeserialize(ct return out, metadata, err } -func awsAwsjson11_deserializeOpErrorListOpsItemRelatedItems(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsAwsjson11_deserializeOpErrorListNodesSummary(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("InvalidAggregatorException", errorCode): + return awsAwsjson11_deserializeErrorInvalidAggregatorException(response, errorBody) + + case strings.EqualFold("InvalidFilter", errorCode): + return awsAwsjson11_deserializeErrorInvalidFilter(response, errorBody) + + case strings.EqualFold("InvalidNextToken", errorCode): + return awsAwsjson11_deserializeErrorInvalidNextToken(response, errorBody) + + case strings.EqualFold("ResourceDataSyncNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorResourceDataSyncNotFoundException(response, errorBody) + + case strings.EqualFold("UnsupportedOperationException", errorCode): + return awsAwsjson11_deserializeErrorUnsupportedOperationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListOpsItemEvents struct { +} + +func (*awsAwsjson11_deserializeOpListOpsItemEvents) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListOpsItemEvents) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListOpsItemEvents(response, &metadata) + } + output := &ListOpsItemEventsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListOpsItemEventsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListOpsItemEvents(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("OpsItemInvalidParameterException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemInvalidParameterException(response, errorBody) + + case strings.EqualFold("OpsItemLimitExceededException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemLimitExceededException(response, errorBody) + + case strings.EqualFold("OpsItemNotFoundException", errorCode): + return awsAwsjson11_deserializeErrorOpsItemNotFoundException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsAwsjson11_deserializeOpListOpsItemRelatedItems struct { +} + +func (*awsAwsjson11_deserializeOpListOpsItemRelatedItems) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpListOpsItemRelatedItems) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorListOpsItemRelatedItems(response, &metadata) + } + output := &ListOpsItemRelatedItemsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentListOpsItemRelatedItemsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorListOpsItemRelatedItems(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -14571,6 +14934,120 @@ func awsAwsjson11_deserializeOpErrorStartChangeRequestExecution(response *smithy } } +type awsAwsjson11_deserializeOpStartExecutionPreview struct { +} + +func (*awsAwsjson11_deserializeOpStartExecutionPreview) ID() string { + return "OperationDeserializer" +} + +func (m *awsAwsjson11_deserializeOpStartExecutionPreview) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsAwsjson11_deserializeOpErrorStartExecutionPreview(response, &metadata) + } + output := &StartExecutionPreviewOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsAwsjson11_deserializeOpDocumentStartExecutionPreviewOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + return out, metadata, err +} + +func awsAwsjson11_deserializeOpErrorStartExecutionPreview(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + bodyInfo, err := getProtocolErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, 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 typ, ok := resolveProtocolErrorType(headerCode, bodyInfo); ok { + errorCode = restjson.SanitizeErrorCode(typ) + } + if len(bodyInfo.Message) != 0 { + errorMessage = bodyInfo.Message + } + switch { + case strings.EqualFold("InternalServerError", errorCode): + return awsAwsjson11_deserializeErrorInternalServerError(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsAwsjson11_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsAwsjson11_deserializeOpStartSession struct { } @@ -21331,6 +21808,41 @@ func awsAwsjson11_deserializeErrorUnsupportedOperatingSystem(response *smithyhtt return output } +func awsAwsjson11_deserializeErrorUnsupportedOperationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.UnsupportedOperationException{} + err := awsAwsjson11_deserializeDocumentUnsupportedOperationException(&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 awsAwsjson11_deserializeErrorUnsupportedParameterType(response *smithyhttp.Response, errorBody *bytes.Reader) error { var buff [1024]byte ringBuffer := smithyio.NewRingBuffer(buff[:]) @@ -21401,6 +21913,41 @@ func awsAwsjson11_deserializeErrorUnsupportedPlatformType(response *smithyhttp.R return output } +func awsAwsjson11_deserializeErrorValidationException(response *smithyhttp.Response, errorBody *bytes.Reader) error { + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + output := &types.ValidationException{} + err := awsAwsjson11_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 awsAwsjson11_deserializeDocumentAccountIdList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -24449,6 +24996,65 @@ func awsAwsjson11_deserializeDocumentAutomationExecutionNotFoundException(v **ty return nil } +func awsAwsjson11_deserializeDocumentAutomationExecutionPreview(v **types.AutomationExecutionPreview, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.AutomationExecutionPreview + if *v == nil { + sv = &types.AutomationExecutionPreview{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Regions": + if err := awsAwsjson11_deserializeDocumentRegionList(&sv.Regions, value); err != nil { + return err + } + + case "StepPreviews": + if err := awsAwsjson11_deserializeDocumentStepPreviewMap(&sv.StepPreviews, value); err != nil { + return err + } + + case "TargetPreviews": + if err := awsAwsjson11_deserializeDocumentTargetPreviewList(&sv.TargetPreviews, value); err != nil { + return err + } + + case "TotalAccounts": + 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.TotalAccounts = int32(i64) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentAutomationParameterMap(v *map[string][]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -27613,6 +28219,46 @@ func awsAwsjson11_deserializeDocumentExcludeAccounts(v *[]string, value interfac return nil } +func awsAwsjson11_deserializeDocumentExecutionPreview(v *types.ExecutionPreview, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.ExecutionPreview +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "Automation": + var mv types.AutomationExecutionPreview + destAddr := &mv + if err := awsAwsjson11_deserializeDocumentAutomationExecutionPreview(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.ExecutionPreviewMemberAutomation{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + func awsAwsjson11_deserializeDocumentFailedCreateAssociation(v **types.FailedCreateAssociation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -28517,6 +29163,127 @@ func awsAwsjson11_deserializeDocumentInstanceIdList(v *[]string, value interface return nil } +func awsAwsjson11_deserializeDocumentInstanceInfo(v **types.InstanceInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.InstanceInfo + if *v == nil { + sv = &types.InstanceInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AgentType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentType to be of type string, got %T instead", value) + } + sv.AgentType = ptr.String(jtv) + } + + case "AgentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected AgentVersion to be of type string, got %T instead", value) + } + sv.AgentVersion = ptr.String(jtv) + } + + case "ComputerName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ComputerName to be of type string, got %T instead", value) + } + sv.ComputerName = ptr.String(jtv) + } + + case "InstanceStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected InstanceStatus to be of type string, got %T instead", value) + } + sv.InstanceStatus = ptr.String(jtv) + } + + case "IpAddress": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected IPAddress to be of type string, got %T instead", value) + } + sv.IpAddress = ptr.String(jtv) + } + + case "ManagedStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ManagedStatus to be of type string, got %T instead", value) + } + sv.ManagedStatus = types.ManagedStatus(jtv) + } + + case "PlatformName": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlatformName to be of type string, got %T instead", value) + } + sv.PlatformName = ptr.String(jtv) + } + + case "PlatformType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlatformType to be of type string, got %T instead", value) + } + sv.PlatformType = types.PlatformType(jtv) + } + + case "PlatformVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected PlatformVersion to be of type string, got %T instead", value) + } + sv.PlatformVersion = ptr.String(jtv) + } + + case "ResourceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ResourceType to be of type string, got %T instead", value) + } + sv.ResourceType = types.ResourceType(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentInstanceInformation(v **types.InstanceInformation, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -34114,6 +34881,281 @@ func awsAwsjson11_deserializeDocumentMetadataValue(v **types.MetadataValue, valu return nil } +func awsAwsjson11_deserializeDocumentNode(v **types.Node, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Node + if *v == nil { + sv = &types.Node{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "CaptureTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.CaptureTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected NodeCaptureTime to be a JSON Number, got %T instead", value) + + } + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodeId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "NodeType": + if err := awsAwsjson11_deserializeDocumentNodeType(&sv.NodeType, value); err != nil { + return err + } + + case "Owner": + if err := awsAwsjson11_deserializeDocumentNodeOwnerInfo(&sv.Owner, value); err != nil { + return err + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodeRegion to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentNodeList(v *[]types.Node, 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.Node + if *v == nil { + cv = []types.Node{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Node + destAddr := &col + if err := awsAwsjson11_deserializeDocumentNode(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentNodeOwnerInfo(v **types.NodeOwnerInfo, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.NodeOwnerInfo + if *v == nil { + sv = &types.NodeOwnerInfo{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodeAccountId to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "OrganizationalUnitId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodeOrganizationalUnitId to be of type string, got %T instead", value) + } + sv.OrganizationalUnitId = ptr.String(jtv) + } + + case "OrganizationalUnitPath": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NodeOrganizationalUnitPath to be of type string, got %T instead", value) + } + sv.OrganizationalUnitPath = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentNodeSummary(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 AttributeValue to be of type string, got %T instead", value) + } + parsedVal = jtv + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + +func awsAwsjson11_deserializeDocumentNodeSummaryList(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.([]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var cv []map[string]string + if *v == nil { + cv = []map[string]string{} + } else { + cv = *v + } + + for _, value := range shape { + var col map[string]string + if err := awsAwsjson11_deserializeDocumentNodeSummary(&col, value); err != nil { + return err + } + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsAwsjson11_deserializeDocumentNodeType(v *types.NodeType, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.NodeType +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "Instance": + var mv types.InstanceInfo + destAddr := &mv + if err := awsAwsjson11_deserializeDocumentInstanceInfo(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.NodeTypeMemberInstance{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + func awsAwsjson11_deserializeDocumentNonCompliantSummary(v **types.NonCompliantSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -38965,6 +40007,42 @@ func awsAwsjson11_deserializeDocumentProgressCounters(v **types.ProgressCounters return nil } +func awsAwsjson11_deserializeDocumentRegionList(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 Region to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentRegions(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -41515,6 +42593,46 @@ func awsAwsjson11_deserializeDocumentStepExecutionList(v *[]types.StepExecution, return nil } +func awsAwsjson11_deserializeDocumentStepPreviewMap(v *map[string]int32, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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]int32 + if *v == nil { + mv = map[string]int32{} + } else { + mv = *v + } + + for key, value := range shape { + var parsedVal int32 + 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 + } + parsedVal = int32(i64) + } + mv[key] = parsedVal + + } + *v = mv + return nil +} + func awsAwsjson11_deserializeDocumentSubTypeCountLimitExceededException(v **types.SubTypeCountLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -42045,6 +43163,93 @@ func awsAwsjson11_deserializeDocumentTargetParameterList(v *[]string, value inte return nil } +func awsAwsjson11_deserializeDocumentTargetPreview(v **types.TargetPreview, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.TargetPreview + if *v == nil { + sv = &types.TargetPreview{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Count": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected Integer to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.Count = int32(i64) + } + + case "TargetType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TargetType = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeDocumentTargetPreviewList(v *[]types.TargetPreview, 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.TargetPreview + if *v == nil { + cv = []types.TargetPreview{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.TargetPreview + destAddr := &col + if err := awsAwsjson11_deserializeDocumentTargetPreview(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsAwsjson11_deserializeDocumentTargets(v *[]types.Target, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -42435,6 +43640,46 @@ func awsAwsjson11_deserializeDocumentUnsupportedOperatingSystem(v **types.Unsupp return nil } +func awsAwsjson11_deserializeDocumentUnsupportedOperationException(v **types.UnsupportedOperationException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.UnsupportedOperationException + if *v == nil { + sv = &types.UnsupportedOperationException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentUnsupportedParameterType(v **types.UnsupportedParameterType, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -42515,6 +43760,55 @@ func awsAwsjson11_deserializeDocumentUnsupportedPlatformType(v **types.Unsupport return nil } +func awsAwsjson11_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", "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 "ReasonCode": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReasonCode = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeDocumentValidNextStepList(v *[]string, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -45891,6 +47185,85 @@ func awsAwsjson11_deserializeOpDocumentGetDocumentOutput(v **GetDocumentOutput, return nil } +func awsAwsjson11_deserializeOpDocumentGetExecutionPreviewOutput(v **GetExecutionPreviewOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetExecutionPreviewOutput + if *v == nil { + sv = &GetExecutionPreviewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EndedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.EndedAt = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected DateTime to be a JSON Number, got %T instead", value) + + } + } + + case "ExecutionPreview": + if err := awsAwsjson11_deserializeDocumentExecutionPreview(&sv.ExecutionPreview, value); err != nil { + return err + } + + case "ExecutionPreviewId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExecutionPreviewId to be of type string, got %T instead", value) + } + sv.ExecutionPreviewId = ptr.String(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExecutionPreviewStatus to be of type string, got %T instead", value) + } + sv.Status = types.ExecutionPreviewStatus(jtv) + } + + case "StatusMessage": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.StatusMessage = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentGetInventoryOutput(v **GetInventoryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -47533,7 +48906,259 @@ func awsAwsjson11_deserializeOpDocumentListCommandInvocationsOutput(v **ListComm return nil } -func awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListCommandsOutput + if *v == nil { + sv = &ListCommandsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Commands": + if err := awsAwsjson11_deserializeDocumentCommandList(&sv.Commands, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListComplianceItemsOutput(v **ListComplianceItemsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListComplianceItemsOutput + if *v == nil { + sv = &ListComplianceItemsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComplianceItems": + if err := awsAwsjson11_deserializeDocumentComplianceItemList(&sv.ComplianceItems, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListComplianceSummariesOutput(v **ListComplianceSummariesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListComplianceSummariesOutput + if *v == nil { + sv = &ListComplianceSummariesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ComplianceSummaryItems": + if err := awsAwsjson11_deserializeDocumentComplianceSummaryItemList(&sv.ComplianceSummaryItems, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListDocumentMetadataHistoryOutput(v **ListDocumentMetadataHistoryOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDocumentMetadataHistoryOutput + if *v == nil { + sv = &ListDocumentMetadataHistoryOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Author": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentAuthor to be of type string, got %T instead", value) + } + sv.Author = ptr.String(jtv) + } + + case "DocumentVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) + } + sv.DocumentVersion = ptr.String(jtv) + } + + case "Metadata": + if err := awsAwsjson11_deserializeDocumentDocumentMetadataResponseInfo(&sv.Metadata, value); err != nil { + return err + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected DocumentName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListDocumentsOutput(v **ListDocumentsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *ListDocumentsOutput + if *v == nil { + sv = &ListDocumentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DocumentIdentifiers": + if err := awsAwsjson11_deserializeDocumentDocumentIdentifierList(&sv.DocumentIdentifiers, value); err != nil { + return err + } + + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(v **ListDocumentVersionsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -47546,17 +49171,17 @@ func awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListCommandsOutput + var sv *ListDocumentVersionsOutput if *v == nil { - sv = &ListCommandsOutput{} + sv = &ListDocumentVersionsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Commands": - if err := awsAwsjson11_deserializeDocumentCommandList(&sv.Commands, value); err != nil { + case "DocumentVersions": + if err := awsAwsjson11_deserializeDocumentDocumentVersionList(&sv.DocumentVersions, value); err != nil { return err } @@ -47578,7 +49203,7 @@ func awsAwsjson11_deserializeOpDocumentListCommandsOutput(v **ListCommandsOutput return nil } -func awsAwsjson11_deserializeOpDocumentListComplianceItemsOutput(v **ListComplianceItemsOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(v **ListInventoryEntriesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -47591,144 +49216,63 @@ func awsAwsjson11_deserializeOpDocumentListComplianceItemsOutput(v **ListComplia return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListComplianceItemsOutput + var sv *ListInventoryEntriesOutput if *v == nil { - sv = &ListComplianceItemsOutput{} + sv = &ListInventoryEntriesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ComplianceItems": - if err := awsAwsjson11_deserializeDocumentComplianceItemList(&sv.ComplianceItems, value); err != nil { - return err - } - - case "NextToken": + case "CaptureTime": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected InventoryItemCaptureTime to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.CaptureTime = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListComplianceSummariesOutput(v **ListComplianceSummariesOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListComplianceSummariesOutput - if *v == nil { - sv = &ListComplianceSummariesOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "ComplianceSummaryItems": - if err := awsAwsjson11_deserializeDocumentComplianceSummaryItemList(&sv.ComplianceSummaryItems, value); err != nil { + case "Entries": + if err := awsAwsjson11_deserializeDocumentInventoryItemEntryList(&sv.Entries, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListDocumentMetadataHistoryOutput(v **ListDocumentMetadataHistoryOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListDocumentMetadataHistoryOutput - if *v == nil { - sv = &ListDocumentMetadataHistoryOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "Author": + case "InstanceId": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DocumentAuthor to be of type string, got %T instead", value) + return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) } - sv.Author = ptr.String(jtv) + sv.InstanceId = ptr.String(jtv) } - case "DocumentVersion": + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DocumentVersion to be of type string, got %T instead", value) + return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) } - sv.DocumentVersion = ptr.String(jtv) - } - - case "Metadata": - if err := awsAwsjson11_deserializeDocumentDocumentMetadataResponseInfo(&sv.Metadata, value); err != nil { - return err + sv.NextToken = ptr.String(jtv) } - case "Name": + case "SchemaVersion": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected DocumentName to be of type string, got %T instead", value) + return fmt.Errorf("expected InventoryItemSchemaVersion to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.SchemaVersion = ptr.String(jtv) } - case "NextToken": + case "TypeName": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected InventoryItemTypeName to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.TypeName = ptr.String(jtv) } default: @@ -47740,7 +49284,7 @@ func awsAwsjson11_deserializeOpDocumentListDocumentMetadataHistoryOutput(v **Lis return nil } -func awsAwsjson11_deserializeOpDocumentListDocumentsOutput(v **ListDocumentsOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentListNodesOutput(v **ListNodesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -47753,20 +49297,15 @@ func awsAwsjson11_deserializeOpDocumentListDocumentsOutput(v **ListDocumentsOutp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListDocumentsOutput + var sv *ListNodesOutput if *v == nil { - sv = &ListDocumentsOutput{} + sv = &ListNodesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "DocumentIdentifiers": - if err := awsAwsjson11_deserializeDocumentDocumentIdentifierList(&sv.DocumentIdentifiers, value); err != nil { - return err - } - case "NextToken": if value != nil { jtv, ok := value.(string) @@ -47776,51 +49315,11 @@ func awsAwsjson11_deserializeOpDocumentListDocumentsOutput(v **ListDocumentsOutp sv.NextToken = ptr.String(jtv) } - default: - _, _ = key, value - - } - } - *v = sv - return nil -} - -func awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(v **ListDocumentVersionsOutput, value interface{}) error { - if v == nil { - return fmt.Errorf("unexpected nil of type %T", v) - } - if value == nil { - return nil - } - - shape, ok := value.(map[string]interface{}) - if !ok { - return fmt.Errorf("unexpected JSON type %v", value) - } - - var sv *ListDocumentVersionsOutput - if *v == nil { - sv = &ListDocumentVersionsOutput{} - } else { - sv = *v - } - - for key, value := range shape { - switch key { - case "DocumentVersions": - if err := awsAwsjson11_deserializeDocumentDocumentVersionList(&sv.DocumentVersions, value); err != nil { + case "Nodes": + if err := awsAwsjson11_deserializeDocumentNodeList(&sv.Nodes, value); err != nil { return err } - case "NextToken": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected NextToken to be of type string, got %T instead", value) - } - sv.NextToken = ptr.String(jtv) - } - default: _, _ = key, value @@ -47830,7 +49329,7 @@ func awsAwsjson11_deserializeOpDocumentListDocumentVersionsOutput(v **ListDocume return nil } -func awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(v **ListInventoryEntriesOutput, value interface{}) error { +func awsAwsjson11_deserializeOpDocumentListNodesSummaryOutput(v **ListNodesSummaryOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -47843,38 +49342,15 @@ func awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(v **ListInvent return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListInventoryEntriesOutput + var sv *ListNodesSummaryOutput if *v == nil { - sv = &ListInventoryEntriesOutput{} + sv = &ListNodesSummaryOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "CaptureTime": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InventoryItemCaptureTime to be of type string, got %T instead", value) - } - sv.CaptureTime = ptr.String(jtv) - } - - case "Entries": - if err := awsAwsjson11_deserializeDocumentInventoryItemEntryList(&sv.Entries, value); err != nil { - return err - } - - case "InstanceId": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InstanceId to be of type string, got %T instead", value) - } - sv.InstanceId = ptr.String(jtv) - } - case "NextToken": if value != nil { jtv, ok := value.(string) @@ -47884,22 +49360,9 @@ func awsAwsjson11_deserializeOpDocumentListInventoryEntriesOutput(v **ListInvent sv.NextToken = ptr.String(jtv) } - case "SchemaVersion": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InventoryItemSchemaVersion to be of type string, got %T instead", value) - } - sv.SchemaVersion = ptr.String(jtv) - } - - case "TypeName": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected InventoryItemTypeName to be of type string, got %T instead", value) - } - sv.TypeName = ptr.String(jtv) + case "Summary": + if err := awsAwsjson11_deserializeDocumentNodeSummaryList(&sv.Summary, value); err != nil { + return err } default: @@ -48848,6 +50311,46 @@ func awsAwsjson11_deserializeOpDocumentStartChangeRequestExecutionOutput(v **Sta return nil } +func awsAwsjson11_deserializeOpDocumentStartExecutionPreviewOutput(v **StartExecutionPreviewOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartExecutionPreviewOutput + if *v == nil { + sv = &StartExecutionPreviewOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ExecutionPreviewId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ExecutionPreviewId to be of type string, got %T instead", value) + } + sv.ExecutionPreviewId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsAwsjson11_deserializeOpDocumentStartSessionOutput(v **StartSessionOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ssm/generated.json b/service/ssm/generated.json index 4bf32482c3a..f8082370860 100644 --- a/service/ssm/generated.json +++ b/service/ssm/generated.json @@ -79,6 +79,7 @@ "api_op_GetDefaultPatchBaseline.go", "api_op_GetDeployablePatchSnapshotForInstance.go", "api_op_GetDocument.go", + "api_op_GetExecutionPreview.go", "api_op_GetInventory.go", "api_op_GetInventorySchema.go", "api_op_GetMaintenanceWindow.go", @@ -108,6 +109,8 @@ "api_op_ListDocumentVersions.go", "api_op_ListDocuments.go", "api_op_ListInventoryEntries.go", + "api_op_ListNodes.go", + "api_op_ListNodesSummary.go", "api_op_ListOpsItemEvents.go", "api_op_ListOpsItemRelatedItems.go", "api_op_ListOpsMetadata.go", @@ -131,6 +134,7 @@ "api_op_StartAssociationsOnce.go", "api_op_StartAutomationExecution.go", "api_op_StartChangeRequestExecution.go", + "api_op_StartExecutionPreview.go", "api_op_StartSession.go", "api_op_StopAutomationExecution.go", "api_op_TerminateSession.go", @@ -165,6 +169,7 @@ "types/enums.go", "types/errors.go", "types/types.go", + "types/types_exported_test.go", "validators.go" ], "go": "1.15", diff --git a/service/ssm/serializers.go b/service/ssm/serializers.go index eef889df512..cf428bdb1c5 100644 --- a/service/ssm/serializers.go +++ b/service/ssm/serializers.go @@ -4287,6 +4287,67 @@ func (m *awsAwsjson11_serializeOpGetDocument) HandleSerialize(ctx context.Contex return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpGetExecutionPreview struct { +} + +func (*awsAwsjson11_serializeOpGetExecutionPreview) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpGetExecutionPreview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetExecutionPreviewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.GetExecutionPreview") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentGetExecutionPreviewInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpGetInventory struct { } @@ -6056,6 +6117,128 @@ func (m *awsAwsjson11_serializeOpListInventoryEntries) HandleSerialize(ctx conte return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpListNodes struct { +} + +func (*awsAwsjson11_serializeOpListNodes) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListNodes) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListNodesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.ListNodes") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListNodesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + +type awsAwsjson11_serializeOpListNodesSummary struct { +} + +func (*awsAwsjson11_serializeOpListNodesSummary) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpListNodesSummary) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListNodesSummaryInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.ListNodesSummary") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentListNodesSummaryInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpListOpsItemEvents struct { } @@ -7459,6 +7642,67 @@ func (m *awsAwsjson11_serializeOpStartChangeRequestExecution) HandleSerialize(ct return next.HandleSerialize(ctx, in) } +type awsAwsjson11_serializeOpStartExecutionPreview struct { +} + +func (*awsAwsjson11_serializeOpStartExecutionPreview) ID() string { + return "OperationSerializer" +} + +func (m *awsAwsjson11_serializeOpStartExecutionPreview) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartExecutionPreviewInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + operationPath := "/" + if len(request.Request.URL.Path) == 0 { + request.Request.URL.Path = operationPath + } else { + request.Request.URL.Path = path.Join(request.Request.URL.Path, operationPath) + if request.Request.URL.Path != "/" && operationPath[len(operationPath)-1] == '/' { + request.Request.URL.Path += "/" + } + } + request.Request.Method = "POST" + httpBindingEncoder, err := httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + httpBindingEncoder.SetHeader("Content-Type").String("application/x-amz-json-1.1") + httpBindingEncoder.SetHeader("X-Amz-Target").String("AmazonSSM.StartExecutionPreview") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsAwsjson11_serializeOpDocumentStartExecutionPreviewInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = httpBindingEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} + type awsAwsjson11_serializeOpStartSession struct { } @@ -8846,6 +9090,51 @@ func awsAwsjson11_serializeDocumentAutomationExecutionFilterValueList(v []string return nil } +func awsAwsjson11_serializeDocumentAutomationExecutionInputs(v *types.AutomationExecutionInputs, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Parameters != nil { + ok := object.Key("Parameters") + if err := awsAwsjson11_serializeDocumentAutomationParameterMap(v.Parameters, ok); err != nil { + return err + } + } + + if v.TargetLocations != nil { + ok := object.Key("TargetLocations") + if err := awsAwsjson11_serializeDocumentTargetLocations(v.TargetLocations, ok); err != nil { + return err + } + } + + if v.TargetLocationsURL != nil { + ok := object.Key("TargetLocationsURL") + ok.String(*v.TargetLocationsURL) + } + + if v.TargetMaps != nil { + ok := object.Key("TargetMaps") + if err := awsAwsjson11_serializeDocumentTargetMaps(v.TargetMaps, ok); err != nil { + return err + } + } + + if v.TargetParameterName != nil { + ok := object.Key("TargetParameterName") + ok.String(*v.TargetParameterName) + } + + if v.Targets != nil { + ok := object.Key("Targets") + if err := awsAwsjson11_serializeDocumentTargets(v.Targets, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeDocumentAutomationParameterMap(v map[string][]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -9482,6 +9771,24 @@ func awsAwsjson11_serializeDocumentExcludeAccounts(v []string, value smithyjson. return nil } +func awsAwsjson11_serializeDocumentExecutionInputs(v types.ExecutionInputs, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.ExecutionInputsMemberAutomation: + av := object.Key("Automation") + if err := awsAwsjson11_serializeDocumentAutomationExecutionInputs(&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 awsAwsjson11_serializeDocumentInstanceAssociationOutputLocation(v *types.InstanceAssociationOutputLocation, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -10234,6 +10541,96 @@ func awsAwsjson11_serializeDocumentMetadataValue(v *types.MetadataValue, value s return nil } +func awsAwsjson11_serializeDocumentNodeAggregator(v *types.NodeAggregator, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Aggregators != nil { + ok := object.Key("Aggregators") + if err := awsAwsjson11_serializeDocumentNodeAggregatorList(v.Aggregators, ok); err != nil { + return err + } + } + + if len(v.AggregatorType) > 0 { + ok := object.Key("AggregatorType") + ok.String(string(v.AggregatorType)) + } + + if len(v.AttributeName) > 0 { + ok := object.Key("AttributeName") + ok.String(string(v.AttributeName)) + } + + if len(v.TypeName) > 0 { + ok := object.Key("TypeName") + ok.String(string(v.TypeName)) + } + + return nil +} + +func awsAwsjson11_serializeDocumentNodeAggregatorList(v []types.NodeAggregator, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentNodeAggregator(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentNodeFilter(v *types.NodeFilter, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Key) > 0 { + ok := object.Key("Key") + ok.String(string(v.Key)) + } + + if len(v.Type) > 0 { + ok := object.Key("Type") + ok.String(string(v.Type)) + } + + if v.Values != nil { + ok := object.Key("Values") + if err := awsAwsjson11_serializeDocumentNodeFilterValueList(v.Values, ok); err != nil { + return err + } + } + + return nil +} + +func awsAwsjson11_serializeDocumentNodeFilterList(v []types.NodeFilter, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + if err := awsAwsjson11_serializeDocumentNodeFilter(&v[i], av); err != nil { + return err + } + } + return nil +} + +func awsAwsjson11_serializeDocumentNodeFilterValueList(v []string, value smithyjson.Value) error { + array := value.Array() + defer array.Close() + + for i := range v { + av := array.Value() + av.String(v[i]) + } + return nil +} + func awsAwsjson11_serializeDocumentNotificationConfig(v *types.NotificationConfig, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -13617,6 +14014,18 @@ func awsAwsjson11_serializeOpDocumentGetDocumentInput(v *GetDocumentInput, value return nil } +func awsAwsjson11_serializeOpDocumentGetExecutionPreviewInput(v *GetExecutionPreviewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ExecutionPreviewId != nil { + ok := object.Key("ExecutionPreviewId") + ok.String(*v.ExecutionPreviewId) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentGetInventoryInput(v *GetInventoryInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -14338,6 +14747,71 @@ func awsAwsjson11_serializeOpDocumentListInventoryEntriesInput(v *ListInventoryE return nil } +func awsAwsjson11_serializeOpDocumentListNodesInput(v *ListNodesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentNodeFilterList(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) + } + + if v.SyncName != nil { + ok := object.Key("SyncName") + ok.String(*v.SyncName) + } + + return nil +} + +func awsAwsjson11_serializeOpDocumentListNodesSummaryInput(v *ListNodesSummaryInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Aggregators != nil { + ok := object.Key("Aggregators") + if err := awsAwsjson11_serializeDocumentNodeAggregatorList(v.Aggregators, ok); err != nil { + return err + } + } + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsAwsjson11_serializeDocumentNodeFilterList(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) + } + + if v.SyncName != nil { + ok := object.Key("SyncName") + ok.String(*v.SyncName) + } + + return nil +} + func awsAwsjson11_serializeOpDocumentListOpsItemEventsInput(v *ListOpsItemEventsInput, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -15192,6 +15666,30 @@ func awsAwsjson11_serializeOpDocumentStartChangeRequestExecutionInput(v *StartCh return nil } +func awsAwsjson11_serializeOpDocumentStartExecutionPreviewInput(v *StartExecutionPreviewInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DocumentName != nil { + ok := object.Key("DocumentName") + ok.String(*v.DocumentName) + } + + if v.DocumentVersion != nil { + ok := object.Key("DocumentVersion") + ok.String(*v.DocumentVersion) + } + + if v.ExecutionInputs != nil { + ok := object.Key("ExecutionInputs") + if err := awsAwsjson11_serializeDocumentExecutionInputs(v.ExecutionInputs, ok); err != nil { + return err + } + } + + return nil +} + func awsAwsjson11_serializeOpDocumentStartSessionInput(v *StartSessionInput, value smithyjson.Value) error { object := value.Object() defer object.Close() diff --git a/service/ssm/snapshot/api_op_GetExecutionPreview.go.snap b/service/ssm/snapshot/api_op_GetExecutionPreview.go.snap new file mode 100644 index 00000000000..d06647b5e98 --- /dev/null +++ b/service/ssm/snapshot/api_op_GetExecutionPreview.go.snap @@ -0,0 +1,41 @@ +GetExecutionPreview + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssm/snapshot/api_op_ListNodes.go.snap b/service/ssm/snapshot/api_op_ListNodes.go.snap new file mode 100644 index 00000000000..13058c7ca81 --- /dev/null +++ b/service/ssm/snapshot/api_op_ListNodes.go.snap @@ -0,0 +1,41 @@ +ListNodes + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssm/snapshot/api_op_ListNodesSummary.go.snap b/service/ssm/snapshot/api_op_ListNodesSummary.go.snap new file mode 100644 index 00000000000..d24ed64c015 --- /dev/null +++ b/service/ssm/snapshot/api_op_ListNodesSummary.go.snap @@ -0,0 +1,41 @@ +ListNodesSummary + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssm/snapshot/api_op_StartExecutionPreview.go.snap b/service/ssm/snapshot/api_op_StartExecutionPreview.go.snap new file mode 100644 index 00000000000..0f6a8bb0102 --- /dev/null +++ b/service/ssm/snapshot/api_op_StartExecutionPreview.go.snap @@ -0,0 +1,41 @@ +StartExecutionPreview + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssm/snapshot_test.go b/service/ssm/snapshot_test.go index 8eef1a0cc4e..32a5ae98b84 100644 --- a/service/ssm/snapshot_test.go +++ b/service/ssm/snapshot_test.go @@ -902,6 +902,18 @@ func TestCheckSnapshot_GetDocument(t *testing.T) { } } +func TestCheckSnapshot_GetExecutionPreview(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetExecutionPreview(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetExecutionPreview") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetInventory(t *testing.T) { svc := New(Options{}) _, err := svc.GetInventory(context.Background(), nil, func(o *Options) { @@ -1250,6 +1262,30 @@ func TestCheckSnapshot_ListInventoryEntries(t *testing.T) { } } +func TestCheckSnapshot_ListNodes(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNodes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListNodes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestCheckSnapshot_ListNodesSummary(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNodesSummary(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListNodesSummary") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListOpsItemEvents(t *testing.T) { svc := New(Options{}) _, err := svc.ListOpsItemEvents(context.Background(), nil, func(o *Options) { @@ -1526,6 +1562,18 @@ func TestCheckSnapshot_StartChangeRequestExecution(t *testing.T) { } } +func TestCheckSnapshot_StartExecutionPreview(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartExecutionPreview(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartExecutionPreview") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_StartSession(t *testing.T) { svc := New(Options{}) _, err := svc.StartSession(context.Background(), nil, func(o *Options) { @@ -2581,6 +2629,18 @@ func TestUpdateSnapshot_GetDocument(t *testing.T) { } } +func TestUpdateSnapshot_GetExecutionPreview(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetExecutionPreview(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetExecutionPreview") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetInventory(t *testing.T) { svc := New(Options{}) _, err := svc.GetInventory(context.Background(), nil, func(o *Options) { @@ -2929,6 +2989,30 @@ func TestUpdateSnapshot_ListInventoryEntries(t *testing.T) { } } +func TestUpdateSnapshot_ListNodes(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNodes(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListNodes") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + +func TestUpdateSnapshot_ListNodesSummary(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListNodesSummary(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListNodesSummary") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListOpsItemEvents(t *testing.T) { svc := New(Options{}) _, err := svc.ListOpsItemEvents(context.Background(), nil, func(o *Options) { @@ -3205,6 +3289,18 @@ func TestUpdateSnapshot_StartChangeRequestExecution(t *testing.T) { } } +func TestUpdateSnapshot_StartExecutionPreview(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartExecutionPreview(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartExecutionPreview") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_StartSession(t *testing.T) { svc := New(Options{}) _, err := svc.StartSession(context.Background(), nil, func(o *Options) { diff --git a/service/ssm/types/enums.go b/service/ssm/types/enums.go index 50f86176097..d17ae4b9631 100644 --- a/service/ssm/types/enums.go +++ b/service/ssm/types/enums.go @@ -839,6 +839,29 @@ func (ExecutionMode) Values() []ExecutionMode { } } +type ExecutionPreviewStatus string + +// Enum values for ExecutionPreviewStatus +const ( + ExecutionPreviewStatusPending ExecutionPreviewStatus = "Pending" + ExecutionPreviewStatusInProgress ExecutionPreviewStatus = "InProgress" + ExecutionPreviewStatusSuccess ExecutionPreviewStatus = "Success" + ExecutionPreviewStatusFailed ExecutionPreviewStatus = "Failed" +) + +// Values returns all known values for ExecutionPreviewStatus. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ExecutionPreviewStatus) Values() []ExecutionPreviewStatus { + return []ExecutionPreviewStatus{ + "Pending", + "InProgress", + "Success", + "Failed", + } +} + type ExternalAlarmState string // Enum values for ExternalAlarmState @@ -879,6 +902,27 @@ func (Fault) Values() []Fault { } } +type ImpactType string + +// Enum values for ImpactType +const ( + ImpactTypeMutating ImpactType = "Mutating" + ImpactTypeNonMutating ImpactType = "NonMutating" + ImpactTypeUndetermined ImpactType = "Undetermined" +) + +// Values returns all known values for ImpactType. Note that this can be expanded +// in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ImpactType) Values() []ImpactType { + return []ImpactType{ + "Mutating", + "NonMutating", + "Undetermined", + } +} + type InstanceInformationFilterKey string // Enum values for InstanceInformationFilterKey @@ -1194,6 +1238,154 @@ func (MaintenanceWindowTaskType) Values() []MaintenanceWindowTaskType { } } +type ManagedStatus string + +// Enum values for ManagedStatus +const ( + ManagedStatusAll ManagedStatus = "All" + ManagedStatusManaged ManagedStatus = "Managed" + ManagedStatusUnmanaged ManagedStatus = "Unmanaged" +) + +// Values returns all known values for ManagedStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (ManagedStatus) Values() []ManagedStatus { + return []ManagedStatus{ + "All", + "Managed", + "Unmanaged", + } +} + +type NodeAggregatorType string + +// Enum values for NodeAggregatorType +const ( + NodeAggregatorTypeCount NodeAggregatorType = "Count" +) + +// Values returns all known values for NodeAggregatorType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NodeAggregatorType) Values() []NodeAggregatorType { + return []NodeAggregatorType{ + "Count", + } +} + +type NodeAttributeName string + +// Enum values for NodeAttributeName +const ( + NodeAttributeNameAgentVersion NodeAttributeName = "AgentVersion" + NodeAttributeNamePlatformName NodeAttributeName = "PlatformName" + NodeAttributeNamePlatformType NodeAttributeName = "PlatformType" + NodeAttributeNamePlatformVersion NodeAttributeName = "PlatformVersion" + NodeAttributeNameRegion NodeAttributeName = "Region" + NodeAttributeNameResourceType NodeAttributeName = "ResourceType" +) + +// Values returns all known values for NodeAttributeName. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NodeAttributeName) Values() []NodeAttributeName { + return []NodeAttributeName{ + "AgentVersion", + "PlatformName", + "PlatformType", + "PlatformVersion", + "Region", + "ResourceType", + } +} + +type NodeFilterKey string + +// Enum values for NodeFilterKey +const ( + NodeFilterKeyAgentType NodeFilterKey = "AgentType" + NodeFilterKeyAgentVersion NodeFilterKey = "AgentVersion" + NodeFilterKeyComputerName NodeFilterKey = "ComputerName" + NodeFilterKeyInstanceId NodeFilterKey = "InstanceId" + NodeFilterKeyInstanceStatus NodeFilterKey = "InstanceStatus" + NodeFilterKeyIpAddress NodeFilterKey = "IpAddress" + NodeFilterKeyManagedStatus NodeFilterKey = "ManagedStatus" + NodeFilterKeyPlatformName NodeFilterKey = "PlatformName" + NodeFilterKeyPlatformType NodeFilterKey = "PlatformType" + NodeFilterKeyPlatformVersion NodeFilterKey = "PlatformVersion" + NodeFilterKeyResourceType NodeFilterKey = "ResourceType" + NodeFilterKeyOrganizationalUnitId NodeFilterKey = "OrganizationalUnitId" + NodeFilterKeyOrganizationalUnitPath NodeFilterKey = "OrganizationalUnitPath" + NodeFilterKeyRegion NodeFilterKey = "Region" + NodeFilterKeyAccountId NodeFilterKey = "AccountId" +) + +// Values returns all known values for NodeFilterKey. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NodeFilterKey) Values() []NodeFilterKey { + return []NodeFilterKey{ + "AgentType", + "AgentVersion", + "ComputerName", + "InstanceId", + "InstanceStatus", + "IpAddress", + "ManagedStatus", + "PlatformName", + "PlatformType", + "PlatformVersion", + "ResourceType", + "OrganizationalUnitId", + "OrganizationalUnitPath", + "Region", + "AccountId", + } +} + +type NodeFilterOperatorType string + +// Enum values for NodeFilterOperatorType +const ( + NodeFilterOperatorTypeEqual NodeFilterOperatorType = "Equal" + NodeFilterOperatorTypeNotEqual NodeFilterOperatorType = "NotEqual" + NodeFilterOperatorTypeBeginWith NodeFilterOperatorType = "BeginWith" +) + +// Values returns all known values for NodeFilterOperatorType. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NodeFilterOperatorType) Values() []NodeFilterOperatorType { + return []NodeFilterOperatorType{ + "Equal", + "NotEqual", + "BeginWith", + } +} + +type NodeTypeName string + +// Enum values for NodeTypeName +const ( + NodeTypeNameInstance NodeTypeName = "Instance" +) + +// Values returns all known values for NodeTypeName. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (NodeTypeName) Values() []NodeTypeName { + return []NodeTypeName{ + "Instance", + } +} + type NotificationEvent string // Enum values for NotificationEvent diff --git a/service/ssm/types/errors.go b/service/ssm/types/errors.go index 77c2c19424d..7087b2a8936 100644 --- a/service/ssm/types/errors.go +++ b/service/ssm/types/errors.go @@ -838,7 +838,7 @@ func (e *InvalidActivation) ErrorCode() string { } func (e *InvalidActivation) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The activation ID isn't valid. Verify the you entered the correct ActivationId +// The activation ID isn't valid. Verify that you entered the correct ActivationId // or ActivationCode and try again. type InvalidActivationId struct { Message *string @@ -865,9 +865,8 @@ func (e *InvalidActivationId) ErrorCode() string { } func (e *InvalidActivationId) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The specified aggregator isn't valid for inventory groups. Verify that the -// aggregator uses a valid inventory type such as AWS:Application or -// AWS:InstanceInformation . +// The specified aggregator isn't valid for the group type. Verify that the +// aggregator you provided is supported. type InvalidAggregatorException struct { Message *string @@ -1297,7 +1296,7 @@ func (e *InvalidDocumentVersion) ErrorCode() string { } func (e *InvalidDocumentVersion) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } -// The filter name isn't valid. Verify the you entered the correct name and try +// The filter name isn't valid. Verify that you entered the correct name and try // again. type InvalidFilter struct { Message *string @@ -3640,6 +3639,33 @@ func (e *UnsupportedOperatingSystem) ErrorCode() string { } func (e *UnsupportedOperatingSystem) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } +// This operation is not supported for the current account. You must first enable +// the Systems Manager integrated experience in your account. +type UnsupportedOperationException struct { + Message *string + + ErrorCodeOverride *string + + noSmithyDocumentSerde +} + +func (e *UnsupportedOperationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *UnsupportedOperationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *UnsupportedOperationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "UnsupportedOperationException" + } + return *e.ErrorCodeOverride +} +func (e *UnsupportedOperationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + // The parameter type isn't supported. type UnsupportedParameterType struct { Message *string @@ -3692,3 +3718,32 @@ func (e *UnsupportedPlatformType) ErrorCode() string { return *e.ErrorCodeOverride } func (e *UnsupportedPlatformType) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } + +// The request isn't valid. Verify that you entered valid contents for the command +// and try again. +type ValidationException struct { + Message *string + + ErrorCodeOverride *string + + ReasonCode *string + + noSmithyDocumentSerde +} + +func (e *ValidationException) Error() string { + return fmt.Sprintf("%s: %s", e.ErrorCode(), e.ErrorMessage()) +} +func (e *ValidationException) ErrorMessage() string { + if e.Message == nil { + return "" + } + return *e.Message +} +func (e *ValidationException) ErrorCode() string { + if e == nil || e.ErrorCodeOverride == nil { + return "ValidationException" + } + return *e.ErrorCodeOverride +} +func (e *ValidationException) ErrorFault() smithy.ErrorFault { return smithy.FaultClient } diff --git a/service/ssm/types/types.go b/service/ssm/types/types.go index bec5f3e186c..1c948f63c31 100644 --- a/service/ssm/types/types.go +++ b/service/ssm/types/types.go @@ -803,6 +803,37 @@ type AutomationExecutionFilter struct { noSmithyDocumentSerde } +// Information about the optional inputs that can be specified for an automation +// execution preview. +type AutomationExecutionInputs struct { + + // Information about parameters that can be specified for the preview operation. + Parameters map[string][]string + + // Information about the Amazon Web Services Regions and Amazon Web Services + // accounts targeted by the Automation execution preview operation. + TargetLocations []TargetLocation + + // A publicly accessible URL for a file that contains the TargetLocations body. + // Currently, only files in presigned Amazon S3 buckets are supported. + TargetLocationsURL *string + + // A key-value mapping of document parameters to target resources. Both Targets + // and TargetMaps can't be specified together. + TargetMaps []map[string][]string + + // The name of the parameter used as the target resource for the rate-controlled + // execution. Required if you specify targets. + TargetParameterName *string + + // Information about the resources that would be included in the actual runbook + // execution, if it were to be run. Both Targets and TargetMaps can't be specified + // together. + Targets []Target + + noSmithyDocumentSerde +} + // Details about a specific Automation execution. type AutomationExecutionMetadata struct { @@ -915,6 +946,41 @@ type AutomationExecutionMetadata struct { noSmithyDocumentSerde } +// Information about the results of the execution preview. +type AutomationExecutionPreview struct { + + // Information about the Amazon Web Services Regions targeted by the execution + // preview. + Regions []string + + // Information about the type of impact a runbook step would have on a resource. + // + // - Mutating : The runbook step would make changes to the targets through + // actions that create, modify, or delete resources. + // + // - Non_Mutating : The runbook step would retrieve data about resources but not + // make changes to them. This category generally includes Describe* , List* , + // Get* , and similar read-only API actions. + // + // - Undetermined : An undetermined step invokes executions performed by another + // orchestration service like Lambda, Step Functions, or Amazon Web Services + // Systems Manager Run Command. An undetermined step might also call a third-party + // API. Systems Manager Automation doesn't know the outcome of the orchestration + // processes or third-party API executions, so the results of the steps are + // undetermined. + StepPreviews map[string]int32 + + // Information that provides a preview of what the impact of running the specified + // Automation runbook would be. + TargetPreviews []TargetPreview + + // Information about the Amazon Web Services accounts that were included in the + // execution preview. + TotalAccounts int32 + + noSmithyDocumentSerde +} + // Defines the basic information about a patch baseline override. type BaselineOverride struct { @@ -2230,6 +2296,44 @@ type EffectivePatch struct { noSmithyDocumentSerde } +// Information about the inputs for an execution preview. +// +// The following types satisfy this interface: +// +// ExecutionInputsMemberAutomation +type ExecutionInputs interface { + isExecutionInputs() +} + +// Information about the optional inputs that can be specified for an automation +// execution preview. +type ExecutionInputsMemberAutomation struct { + Value AutomationExecutionInputs + + noSmithyDocumentSerde +} + +func (*ExecutionInputsMemberAutomation) isExecutionInputs() {} + +// Information about the changes that would be made if an execution were run. +// +// The following types satisfy this interface: +// +// ExecutionPreviewMemberAutomation +type ExecutionPreview interface { + isExecutionPreview() +} + +// Information about the changes that would be made if an Automation workflow were +// run. +type ExecutionPreviewMemberAutomation struct { + Value AutomationExecutionPreview + + noSmithyDocumentSerde +} + +func (*ExecutionPreviewMemberAutomation) isExecutionPreview() {} + // Describes a failed association. type FailedCreateAssociation struct { @@ -2383,6 +2487,43 @@ type InstanceAssociationStatusInfo struct { noSmithyDocumentSerde } +// Details about a specific managed node. +type InstanceInfo struct { + + // The type of agent installed on the node. + AgentType *string + + // The version number of the agent installed on the node. + AgentVersion *string + + // The fully qualified host name of the managed node. + ComputerName *string + + // The current status of the managed node. + InstanceStatus *string + + // The IP address of the managed node. + IpAddress *string + + // Indicates whether the node is managed by Systems Manager. + ManagedStatus ManagedStatus + + // The name of the operating system platform running on your managed node. + PlatformName *string + + // The operating system platform type of the managed node. + PlatformType PlatformType + + // The version of the OS platform running on your managed node. + PlatformVersion *string + + // The type of instance, either an EC2 instance or another supported machine type + // in a hybrid fleet. + ResourceType ResourceType + + noSmithyDocumentSerde +} + // Describes a filter for a specific list of managed nodes. type InstanceInformation struct { @@ -2794,7 +2935,8 @@ type InstanceProperty struct { // The name of the operating system platform running on your managed node. PlatformName *string - // The operating system platform type of the managed node. For example, Windows. + // The operating system platform type of the managed node. For example, Windows + // Server or Amazon Linux 2. PlatformType PlatformType // The version of the OS platform running on your managed node. @@ -3673,6 +3815,111 @@ type MetadataValue struct { noSmithyDocumentSerde } +// Details about an individual managed node. +type Node struct { + + // The UTC timestamp for when the managed node data was last captured. + CaptureTime *time.Time + + // The ID of the managed node. + Id *string + + // Information about the type of node. + NodeType NodeType + + // Information about the ownership of the managed node. + Owner *NodeOwnerInfo + + // The Amazon Web Services Region that a managed node was created in or assigned + // to. + Region *string + + noSmithyDocumentSerde +} + +// One or more aggregators for viewing counts of nodes using different dimensions. +type NodeAggregator struct { + + // The aggregator type for limiting a node summary. Currently, only Count is + // supported. + // + // This member is required. + AggregatorType NodeAggregatorType + + // The name of a node attribute on which to limit the count of nodes. + // + // This member is required. + AttributeName NodeAttributeName + + // The data type name to use for viewing counts of nodes. Currently, only Instance + // is supported. + // + // This member is required. + TypeName NodeTypeName + + // Information about aggregators used to refine a node summary. + Aggregators []NodeAggregator + + noSmithyDocumentSerde +} + +// The filters for the operation. +type NodeFilter struct { + + // The name of the filter. + // + // This member is required. + Key NodeFilterKey + + // A filter value supported by the specified key. For example, for the key + // PlatformType , supported values include Linux and Windows . + // + // This member is required. + Values []string + + // The type of filter operator. + Type NodeFilterOperatorType + + noSmithyDocumentSerde +} + +// Information about ownership of a managed node. +type NodeOwnerInfo struct { + + // The ID of the Amazon Web Services account that owns the managed node. + AccountId *string + + // The ID of the organization unit (OU) that the account is part of. + OrganizationalUnitId *string + + // The path for the organizational unit (OU) that owns the managed node. The path + // for the OU is built using the IDs of the organization, root, and all OUs in the + // path down to and including the OU. For example: + // + // o-a1b2c3d4e5/r-f6g7h8i9j0example/ou-ghi0-awsccccc/ou-jkl0-awsddddd/ + OrganizationalUnitPath *string + + noSmithyDocumentSerde +} + +// Information about a managed node's type. +// +// The following types satisfy this interface: +// +// NodeTypeMemberInstance +type NodeType interface { + isNodeType() +} + +// Information about a specific managed node. +type NodeTypeMemberInstance struct { + Value InstanceInfo + + noSmithyDocumentSerde +} + +func (*NodeTypeMemberInstance) isNodeType() {} + // A summary of resources that aren't compliant. The summary is organized // according to resource type. type NonCompliantSummary struct { @@ -4345,7 +4592,7 @@ type ParameterInlinePolicy struct { // user to update the parameter and the date and time the parameter was last used. type ParameterMetadata struct { - // The (ARN) of the last user to update the parameter. + // The Amazon Resource Name (ARN) of the parameter. ARN *string // A parameter name can include only the following letters and symbols. @@ -5699,4 +5946,30 @@ type TargetLocation struct { noSmithyDocumentSerde } +// Information about the resources that would be included in the actual runbook +// execution, if it were to be run. +type TargetPreview struct { + + // The number of resources of a certain type included in an execution preview. + Count int32 + + // A type of resource that was included in the execution preview. + TargetType *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) isExecutionInputs() {} +func (*UnknownUnionMember) isExecutionPreview() {} +func (*UnknownUnionMember) isNodeType() {} diff --git a/service/ssm/types/types_exported_test.go b/service/ssm/types/types_exported_test.go new file mode 100644 index 00000000000..4168aa2919f --- /dev/null +++ b/service/ssm/types/types_exported_test.go @@ -0,0 +1,62 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package types_test + +import ( + "fmt" + "github.com/aws/aws-sdk-go-v2/service/ssm/types" +) + +func ExampleExecutionInputs_outputUsage() { + var union types.ExecutionInputs + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ExecutionInputsMemberAutomation: + _ = v.Value // Value is types.AutomationExecutionInputs + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.AutomationExecutionInputs + +func ExampleExecutionPreview_outputUsage() { + var union types.ExecutionPreview + // type switches can be used to check the union value + switch v := union.(type) { + case *types.ExecutionPreviewMemberAutomation: + _ = v.Value // Value is types.AutomationExecutionPreview + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.AutomationExecutionPreview + +func ExampleNodeType_outputUsage() { + var union types.NodeType + // type switches can be used to check the union value + switch v := union.(type) { + case *types.NodeTypeMemberInstance: + _ = v.Value // Value is types.InstanceInfo + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.InstanceInfo diff --git a/service/ssm/validators.go b/service/ssm/validators.go index 9b6e1ff36ee..cf0d3128dc7 100644 --- a/service/ssm/validators.go +++ b/service/ssm/validators.go @@ -1210,6 +1210,26 @@ func (m *validateOpGetDocument) HandleInitialize(ctx context.Context, in middlew return next.HandleInitialize(ctx, in) } +type validateOpGetExecutionPreview struct { +} + +func (*validateOpGetExecutionPreview) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetExecutionPreview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetExecutionPreviewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetExecutionPreviewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetInventory struct { } @@ -1730,6 +1750,46 @@ func (m *validateOpListInventoryEntries) HandleInitialize(ctx context.Context, i return next.HandleInitialize(ctx, in) } +type validateOpListNodes struct { +} + +func (*validateOpListNodes) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListNodes) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListNodesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListNodesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + +type validateOpListNodesSummary struct { +} + +func (*validateOpListNodesSummary) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListNodesSummary) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListNodesSummaryInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListNodesSummaryInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListOpsItemEvents struct { } @@ -2150,6 +2210,26 @@ func (m *validateOpStartChangeRequestExecution) HandleInitialize(ctx context.Con return next.HandleInitialize(ctx, in) } +type validateOpStartExecutionPreview struct { +} + +func (*validateOpStartExecutionPreview) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartExecutionPreview) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartExecutionPreviewInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartExecutionPreviewInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpStartSession struct { } @@ -2750,6 +2830,10 @@ func addOpGetDocumentValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetDocument{}, middleware.After) } +func addOpGetExecutionPreviewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetExecutionPreview{}, middleware.After) +} + func addOpGetInventoryValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetInventory{}, middleware.After) } @@ -2854,6 +2938,14 @@ func addOpListInventoryEntriesValidationMiddleware(stack *middleware.Stack) erro return stack.Initialize.Add(&validateOpListInventoryEntries{}, middleware.After) } +func addOpListNodesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListNodes{}, middleware.After) +} + +func addOpListNodesSummaryValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListNodesSummary{}, middleware.After) +} + func addOpListOpsItemEventsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListOpsItemEvents{}, middleware.After) } @@ -2938,6 +3030,10 @@ func addOpStartChangeRequestExecutionValidationMiddleware(stack *middleware.Stac return stack.Initialize.Add(&validateOpStartChangeRequestExecution{}, middleware.After) } +func addOpStartExecutionPreviewValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartExecutionPreview{}, middleware.After) +} + func addOpStartSessionValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpStartSession{}, middleware.After) } @@ -3225,6 +3321,23 @@ func validateAutomationExecutionFilterList(v []types.AutomationExecutionFilter) } } +func validateAutomationExecutionInputs(v *types.AutomationExecutionInputs) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "AutomationExecutionInputs"} + if v.TargetLocations != nil { + if err := validateTargetLocations(v.TargetLocations); err != nil { + invalidParams.AddNested("TargetLocations", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateBaselineOverride(v *types.BaselineOverride) error { if v == nil { return nil @@ -3461,6 +3574,25 @@ func validateDocumentReviews(v *types.DocumentReviews) error { } } +func validateExecutionInputs(v types.ExecutionInputs) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ExecutionInputs"} + switch uv := v.(type) { + case *types.ExecutionInputsMemberAutomation: + if err := validateAutomationExecutionInputs(&uv.Value); err != nil { + invalidParams.AddNested("[Automation]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateInstanceInformationFilter(v *types.InstanceInformationFilter) error { if v == nil { return nil @@ -3808,6 +3940,84 @@ func validateLoggingInfo(v *types.LoggingInfo) error { } } +func validateNodeAggregator(v *types.NodeAggregator) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NodeAggregator"} + if len(v.AggregatorType) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AggregatorType")) + } + if len(v.TypeName) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("TypeName")) + } + if len(v.AttributeName) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("AttributeName")) + } + if v.Aggregators != nil { + if err := validateNodeAggregatorList(v.Aggregators); err != nil { + invalidParams.AddNested("Aggregators", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateNodeAggregatorList(v []types.NodeAggregator) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NodeAggregatorList"} + for i := range v { + if err := validateNodeAggregator(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateNodeFilter(v *types.NodeFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NodeFilter"} + if len(v.Key) == 0 { + invalidParams.Add(smithy.NewErrParamRequired("Key")) + } + if v.Values == nil { + invalidParams.Add(smithy.NewErrParamRequired("Values")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateNodeFilterList(v []types.NodeFilter) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "NodeFilterList"} + for i := range v { + if err := validateNodeFilter(&v[i]); err != nil { + invalidParams.AddNested(fmt.Sprintf("[%d]", i), err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpsAggregator(v *types.OpsAggregator) error { if v == nil { return nil @@ -5728,6 +5938,21 @@ func validateOpGetDocumentInput(v *GetDocumentInput) error { } } +func validateOpGetExecutionPreviewInput(v *GetExecutionPreviewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetExecutionPreviewInput"} + if v.ExecutionPreviewId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ExecutionPreviewId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetInventoryInput(v *GetInventoryInput) error { if v == nil { return nil @@ -6181,6 +6406,47 @@ func validateOpListInventoryEntriesInput(v *ListInventoryEntriesInput) error { } } +func validateOpListNodesInput(v *ListNodesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListNodesInput"} + if v.Filters != nil { + if err := validateNodeFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateOpListNodesSummaryInput(v *ListNodesSummaryInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListNodesSummaryInput"} + if v.Filters != nil { + if err := validateNodeFilterList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if v.Aggregators == nil { + invalidParams.Add(smithy.NewErrParamRequired("Aggregators")) + } else if v.Aggregators != nil { + if err := validateNodeAggregatorList(v.Aggregators); err != nil { + invalidParams.AddNested("Aggregators", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListOpsItemEventsInput(v *ListOpsItemEventsInput) error { if v == nil { return nil @@ -6612,6 +6878,26 @@ func validateOpStartChangeRequestExecutionInput(v *StartChangeRequestExecutionIn } } +func validateOpStartExecutionPreviewInput(v *StartExecutionPreviewInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartExecutionPreviewInput"} + if v.DocumentName == nil { + invalidParams.Add(smithy.NewErrParamRequired("DocumentName")) + } + if v.ExecutionInputs != nil { + if err := validateExecutionInputs(v.ExecutionInputs); err != nil { + invalidParams.AddNested("ExecutionInputs", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpStartSessionInput(v *StartSessionInput) error { if v == nil { return nil diff --git a/service/ssmquicksetup/api_op_GetConfiguration.go b/service/ssmquicksetup/api_op_GetConfiguration.go new file mode 100644 index 00000000000..c485dc908ca --- /dev/null +++ b/service/ssmquicksetup/api_op_GetConfiguration.go @@ -0,0 +1,189 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Returns details about the specified configuration. +func (c *Client) GetConfiguration(ctx context.Context, params *GetConfigurationInput, optFns ...func(*Options)) (*GetConfigurationOutput, error) { + if params == nil { + params = &GetConfigurationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetConfiguration", params, optFns, c.addOperationGetConfigurationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetConfigurationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetConfigurationInput struct { + + // A service generated identifier for the configuration. + // + // This member is required. + ConfigurationId *string + + noSmithyDocumentSerde +} + +type GetConfigurationOutput struct { + + // The ID of the Amazon Web Services account where the configuration was deployed. + Account *string + + // The ID of the configuration definition. + ConfigurationDefinitionId *string + + // The datetime stamp when the configuration manager was created. + CreatedAt *time.Time + + // A service generated identifier for the configuration. + Id *string + + // The datetime stamp when the configuration manager was last updated. + LastModifiedAt *time.Time + + // The ARN of the configuration manager. + ManagerArn *string + + // The parameters for the configuration definition type. + Parameters map[string]string + + // The Amazon Web Services Region where the configuration was deployed. + Region *string + + // A summary of the state of the configuration manager. This includes deployment + // statuses, association statuses, drift statuses, health checks, and more. + StatusSummaries []types.StatusSummary + + // The type of the Quick Setup configuration. + Type *string + + // The version of the Quick Setup type used. + TypeVersion *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetConfigurationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetConfiguration{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetConfiguration{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetConfiguration"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetConfigurationValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetConfiguration(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetConfiguration(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetConfiguration", + } +} diff --git a/service/ssmquicksetup/api_op_ListConfigurations.go b/service/ssmquicksetup/api_op_ListConfigurations.go new file mode 100644 index 00000000000..e2e44fe00b6 --- /dev/null +++ b/service/ssmquicksetup/api_op_ListConfigurations.go @@ -0,0 +1,266 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package ssmquicksetup + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/ssmquicksetup/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Returns configurations deployed by Quick Setup in the requesting Amazon Web +// Services account and Amazon Web Services Region. +func (c *Client) ListConfigurations(ctx context.Context, params *ListConfigurationsInput, optFns ...func(*Options)) (*ListConfigurationsOutput, error) { + if params == nil { + params = &ListConfigurationsInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListConfigurations", params, optFns, c.addOperationListConfigurationsMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListConfigurationsOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListConfigurationsInput struct { + + // The ID of the configuration definition. + ConfigurationDefinitionId *string + + // Filters the results returned by the request. + Filters []types.Filter + + // The ARN of the configuration manager. + ManagerArn *string + + // Specifies the maximum number of configurations that are returned by the request. + MaxItems *int32 + + // The token to use when requesting a specific set of items from a list. + StartingToken *string + + noSmithyDocumentSerde +} + +type ListConfigurationsOutput struct { + + // An array of configurations. + ConfigurationsList []types.ConfigurationSummary + + // The token to use when requesting the next set of items. If there are no + // additional items to return, the string is empty. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListConfigurationsMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListConfigurations{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListConfigurations{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListConfigurations"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListConfigurationsValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListConfigurations(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +// ListConfigurationsPaginatorOptions is the paginator options for +// ListConfigurations +type ListConfigurationsPaginatorOptions struct { + // Specifies the maximum number of configurations that are returned by the request. + Limit int32 + + // Set to true if pagination should stop if the service returns a pagination token + // that matches the most recent token provided to the service. + StopOnDuplicateToken bool +} + +// ListConfigurationsPaginator is a paginator for ListConfigurations +type ListConfigurationsPaginator struct { + options ListConfigurationsPaginatorOptions + client ListConfigurationsAPIClient + params *ListConfigurationsInput + nextToken *string + firstPage bool +} + +// NewListConfigurationsPaginator returns a new ListConfigurationsPaginator +func NewListConfigurationsPaginator(client ListConfigurationsAPIClient, params *ListConfigurationsInput, optFns ...func(*ListConfigurationsPaginatorOptions)) *ListConfigurationsPaginator { + if params == nil { + params = &ListConfigurationsInput{} + } + + options := ListConfigurationsPaginatorOptions{} + if params.MaxItems != nil { + options.Limit = *params.MaxItems + } + + for _, fn := range optFns { + fn(&options) + } + + return &ListConfigurationsPaginator{ + options: options, + client: client, + params: params, + firstPage: true, + nextToken: params.StartingToken, + } +} + +// HasMorePages returns a boolean indicating whether more pages are available +func (p *ListConfigurationsPaginator) HasMorePages() bool { + return p.firstPage || (p.nextToken != nil && len(*p.nextToken) != 0) +} + +// NextPage retrieves the next ListConfigurations page. +func (p *ListConfigurationsPaginator) NextPage(ctx context.Context, optFns ...func(*Options)) (*ListConfigurationsOutput, error) { + if !p.HasMorePages() { + return nil, fmt.Errorf("no more pages available") + } + + params := *p.params + params.StartingToken = p.nextToken + + var limit *int32 + if p.options.Limit > 0 { + limit = &p.options.Limit + } + params.MaxItems = limit + + optFns = append([]func(*Options){ + addIsPaginatorUserAgent, + }, optFns...) + result, err := p.client.ListConfigurations(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 +} + +// ListConfigurationsAPIClient is a client that implements the ListConfigurations +// operation. +type ListConfigurationsAPIClient interface { + ListConfigurations(context.Context, *ListConfigurationsInput, ...func(*Options)) (*ListConfigurationsOutput, error) +} + +var _ ListConfigurationsAPIClient = (*Client)(nil) + +func newServiceMetadataMiddleware_opListConfigurations(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListConfigurations", + } +} diff --git a/service/ssmquicksetup/deserializers.go b/service/ssmquicksetup/deserializers.go index 3211933fdd3..865850e6946 100644 --- a/service/ssmquicksetup/deserializers.go +++ b/service/ssmquicksetup/deserializers.go @@ -307,6 +307,267 @@ func awsRestjson1_deserializeOpErrorDeleteConfigurationManager(response *smithyh } } +type awsRestjson1_deserializeOpGetConfiguration struct { +} + +func (*awsRestjson1_deserializeOpGetConfiguration) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetConfiguration) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetConfiguration(response, &metadata) + } + output := &GetConfigurationOutput{} + 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_deserializeOpDocumentGetConfigurationOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetConfiguration(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + case strings.EqualFold("ValidationException", errorCode): + return awsRestjson1_deserializeErrorValidationException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetConfigurationOutput(v **GetConfigurationOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetConfigurationOutput + if *v == nil { + sv = &GetConfigurationOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Account": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Account = ptr.String(jtv) + } + + case "ConfigurationDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ConfigurationDefinitionId = ptr.String(jtv) + } + + case "CreatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "LastModifiedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModifiedAt = ptr.Time(t) + } + + case "ManagerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagerArn = ptr.String(jtv) + } + + case "Parameters": + if err := awsRestjson1_deserializeDocumentConfigurationParametersMap(&sv.Parameters, value); err != nil { + return err + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "StatusSummaries": + if err := awsRestjson1_deserializeDocumentStatusSummariesList(&sv.StatusSummaries, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "TypeVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TypeVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + type awsRestjson1_deserializeOpGetConfigurationManager struct { } @@ -487,44 +748,205 @@ func awsRestjson1_deserializeOpDocumentGetConfigurationManagerOutput(v **GetConf sv.Description = ptr.String(jtv) } - case "LastModifiedAt": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) - } - t, err := smithytime.ParseDateTime(jtv) - if err != nil { - return err - } - sv.LastModifiedAt = ptr.Time(t) - } + case "LastModifiedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.LastModifiedAt = ptr.Time(t) + } + + case "ManagerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagerArn = ptr.String(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "StatusSummaries": + if err := awsRestjson1_deserializeDocumentStatusSummariesList(&sv.StatusSummaries, value); err != nil { + return err + } + + case "Tags": + if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetServiceSettings struct { +} + +func (*awsRestjson1_deserializeOpGetServiceSettings) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorGetServiceSettings(response, &metadata) + } + output := &GetServiceSettingsOutput{} + out.Result = output + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(response.Body, ringBuffer) + + decoder := json.NewDecoder(body) + decoder.UseNumber() + var shape interface{} + if err := decoder.Decode(&shape); err != nil && err != io.EOF { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return out, metadata, err + } + + err = awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("AccessDeniedException", errorCode): + return awsRestjson1_deserializeErrorAccessDeniedException(response, errorBody) + + case strings.EqualFold("ConflictException", errorCode): + return awsRestjson1_deserializeErrorConflictException(response, errorBody) + + case strings.EqualFold("InternalServerException", errorCode): + return awsRestjson1_deserializeErrorInternalServerException(response, errorBody) + + case strings.EqualFold("ThrottlingException", errorCode): + return awsRestjson1_deserializeErrorThrottlingException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError - case "ManagerArn": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.ManagerArn = ptr.String(jtv) - } + } +} - case "Name": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Name = ptr.String(jtv) - } +func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSettingsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } - case "StatusSummaries": - if err := awsRestjson1_deserializeDocumentStatusSummariesList(&sv.StatusSummaries, value); err != nil { - return err - } + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } - case "Tags": - if err := awsRestjson1_deserializeDocumentTagsMap(&sv.Tags, value); err != nil { + var sv *GetServiceSettingsOutput + if *v == nil { + sv = &GetServiceSettingsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ServiceSettings": + if err := awsRestjson1_deserializeDocumentServiceSettings(&sv.ServiceSettings, value); err != nil { return err } @@ -537,14 +959,14 @@ func awsRestjson1_deserializeOpDocumentGetConfigurationManagerOutput(v **GetConf return nil } -type awsRestjson1_deserializeOpGetServiceSettings struct { +type awsRestjson1_deserializeOpListConfigurationManagers struct { } -func (*awsRestjson1_deserializeOpGetServiceSettings) ID() string { +func (*awsRestjson1_deserializeOpListConfigurationManagers) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListConfigurationManagers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -562,9 +984,9 @@ func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetServiceSettings(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListConfigurationManagers(response, &metadata) } - output := &GetServiceSettingsOutput{} + output := &ListConfigurationManagersOutput{} out.Result = output var buff [1024]byte @@ -585,7 +1007,7 @@ func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListConfigurationManagersOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -599,7 +1021,7 @@ func (m *awsRestjson1_deserializeOpGetServiceSettings) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListConfigurationManagers(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -652,6 +1074,9 @@ func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Resp 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, @@ -662,7 +1087,7 @@ func awsRestjson1_deserializeOpErrorGetServiceSettings(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSettingsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListConfigurationManagersOutput(v **ListConfigurationManagersOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -675,20 +1100,29 @@ func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSe return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetServiceSettingsOutput + var sv *ListConfigurationManagersOutput if *v == nil { - sv = &GetServiceSettingsOutput{} + sv = &ListConfigurationManagersOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ServiceSettings": - if err := awsRestjson1_deserializeDocumentServiceSettings(&sv.ServiceSettings, value); err != nil { + case "ConfigurationManagersList": + if err := awsRestjson1_deserializeDocumentConfigurationManagerList(&sv.ConfigurationManagersList, value); err != nil { return err } + case "NextToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.NextToken = ptr.String(jtv) + } + default: _, _ = key, value @@ -698,14 +1132,14 @@ func awsRestjson1_deserializeOpDocumentGetServiceSettingsOutput(v **GetServiceSe return nil } -type awsRestjson1_deserializeOpListConfigurationManagers struct { +type awsRestjson1_deserializeOpListConfigurations struct { } -func (*awsRestjson1_deserializeOpListConfigurationManagers) ID() string { +func (*awsRestjson1_deserializeOpListConfigurations) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListConfigurationManagers) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListConfigurations) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -723,9 +1157,9 @@ func (m *awsRestjson1_deserializeOpListConfigurationManagers) HandleDeserialize( } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListConfigurationManagers(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListConfigurations(response, &metadata) } - output := &ListConfigurationManagersOutput{} + output := &ListConfigurationsOutput{} out.Result = output var buff [1024]byte @@ -746,7 +1180,7 @@ func (m *awsRestjson1_deserializeOpListConfigurationManagers) HandleDeserialize( return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListConfigurationManagersOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListConfigurationsOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -760,7 +1194,7 @@ func (m *awsRestjson1_deserializeOpListConfigurationManagers) HandleDeserialize( return out, metadata, err } -func awsRestjson1_deserializeOpErrorListConfigurationManagers(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListConfigurations(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -804,12 +1238,12 @@ func awsRestjson1_deserializeOpErrorListConfigurationManagers(response *smithyht 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) @@ -826,7 +1260,7 @@ func awsRestjson1_deserializeOpErrorListConfigurationManagers(response *smithyht } } -func awsRestjson1_deserializeOpDocumentListConfigurationManagersOutput(v **ListConfigurationManagersOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListConfigurationsOutput(v **ListConfigurationsOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -839,17 +1273,17 @@ func awsRestjson1_deserializeOpDocumentListConfigurationManagersOutput(v **ListC return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListConfigurationManagersOutput + var sv *ListConfigurationsOutput if *v == nil { - sv = &ListConfigurationManagersOutput{} + sv = &ListConfigurationsOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ConfigurationManagersList": - if err := awsRestjson1_deserializeDocumentConfigurationManagerList(&sv.ConfigurationManagersList, value); err != nil { + case "ConfigurationsList": + if err := awsRestjson1_deserializeDocumentConfigurationsList(&sv.ConfigurationsList, value); err != nil { return err } @@ -2347,6 +2781,157 @@ func awsRestjson1_deserializeDocumentConfigurationParametersMap(v *map[string]st return nil } +func awsRestjson1_deserializeDocumentConfigurationsList(v *[]types.ConfigurationSummary, 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.ConfigurationSummary + if *v == nil { + cv = []types.ConfigurationSummary{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ConfigurationSummary + destAddr := &col + if err := awsRestjson1_deserializeDocumentConfigurationSummary(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentConfigurationSummary(v **types.ConfigurationSummary, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ConfigurationSummary + if *v == nil { + sv = &types.ConfigurationSummary{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Account": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Account = ptr.String(jtv) + } + + case "ConfigurationDefinitionId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ConfigurationDefinitionId = ptr.String(jtv) + } + + case "CreatedAt": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected Timestamp to be of type string, got %T instead", value) + } + t, err := smithytime.ParseDateTime(jtv) + if err != nil { + return err + } + sv.CreatedAt = ptr.Time(t) + } + + case "FirstClassParameters": + if err := awsRestjson1_deserializeDocumentConfigurationParametersMap(&sv.FirstClassParameters, value); err != nil { + return err + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + case "ManagerArn": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ManagerArn = ptr.String(jtv) + } + + case "Region": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Region = ptr.String(jtv) + } + + case "StatusSummaries": + if err := awsRestjson1_deserializeDocumentStatusSummariesList(&sv.StatusSummaries, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + case "TypeVersion": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.TypeVersion = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentConflictException(v **types.ConflictException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/ssmquicksetup/generated.json b/service/ssmquicksetup/generated.json index 66961a82454..ea0b95f1867 100644 --- a/service/ssmquicksetup/generated.json +++ b/service/ssmquicksetup/generated.json @@ -10,9 +10,11 @@ "api_client_test.go", "api_op_CreateConfigurationManager.go", "api_op_DeleteConfigurationManager.go", + "api_op_GetConfiguration.go", "api_op_GetConfigurationManager.go", "api_op_GetServiceSettings.go", "api_op_ListConfigurationManagers.go", + "api_op_ListConfigurations.go", "api_op_ListQuickSetupTypes.go", "api_op_ListTagsForResource.go", "api_op_TagResource.go", diff --git a/service/ssmquicksetup/serializers.go b/service/ssmquicksetup/serializers.go index fe9ba2a97a4..0ee6ee52c3a 100644 --- a/service/ssmquicksetup/serializers.go +++ b/service/ssmquicksetup/serializers.go @@ -186,6 +186,77 @@ func awsRestjson1_serializeOpHttpBindingsDeleteConfigurationManagerInput(v *Dele return nil } +type awsRestjson1_serializeOpGetConfiguration struct { +} + +func (*awsRestjson1_serializeOpGetConfiguration) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetConfiguration) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetConfigurationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/getConfiguration/{ConfigurationId}") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "GET" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if err := awsRestjson1_serializeOpHttpBindingsGetConfigurationInput(input, restEncoder); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetConfigurationInput(v *GetConfigurationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + if v.ConfigurationId == nil || len(*v.ConfigurationId) == 0 { + return &smithy.SerializationError{Err: fmt.Errorf("input member ConfigurationId must not be empty")} + } + if v.ConfigurationId != nil { + if err := encoder.SetURI("ConfigurationId").String(*v.ConfigurationId); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpGetConfigurationManager struct { } @@ -408,6 +479,109 @@ func awsRestjson1_serializeOpDocumentListConfigurationManagersInput(v *ListConfi return nil } +type awsRestjson1_serializeOpListConfigurations struct { +} + +func (*awsRestjson1_serializeOpListConfigurations) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListConfigurations) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListConfigurationsInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/listConfigurations") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListConfigurationsInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListConfigurationsInput(v *ListConfigurationsInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListConfigurationsInput(v *ListConfigurationsInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.ConfigurationDefinitionId != nil { + ok := object.Key("ConfigurationDefinitionId") + ok.String(*v.ConfigurationDefinitionId) + } + + if v.Filters != nil { + ok := object.Key("Filters") + if err := awsRestjson1_serializeDocumentFiltersList(v.Filters, ok); err != nil { + return err + } + } + + if v.ManagerArn != nil { + ok := object.Key("ManagerArn") + ok.String(*v.ManagerArn) + } + + if v.MaxItems != nil { + ok := object.Key("MaxItems") + ok.Integer(*v.MaxItems) + } + + if v.StartingToken != nil { + ok := object.Key("StartingToken") + ok.String(*v.StartingToken) + } + + return nil +} + type awsRestjson1_serializeOpListQuickSetupTypes struct { } diff --git a/service/ssmquicksetup/snapshot/api_op_GetConfiguration.go.snap b/service/ssmquicksetup/snapshot/api_op_GetConfiguration.go.snap new file mode 100644 index 00000000000..e405690b4fd --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_GetConfiguration.go.snap @@ -0,0 +1,41 @@ +GetConfiguration + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot/api_op_ListConfigurations.go.snap b/service/ssmquicksetup/snapshot/api_op_ListConfigurations.go.snap new file mode 100644 index 00000000000..15cc158125f --- /dev/null +++ b/service/ssmquicksetup/snapshot/api_op_ListConfigurations.go.snap @@ -0,0 +1,41 @@ +ListConfigurations + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/ssmquicksetup/snapshot_test.go b/service/ssmquicksetup/snapshot_test.go index 410e9697c17..fb1bd12e66f 100644 --- a/service/ssmquicksetup/snapshot_test.go +++ b/service/ssmquicksetup/snapshot_test.go @@ -86,6 +86,18 @@ func TestCheckSnapshot_DeleteConfigurationManager(t *testing.T) { } } +func TestCheckSnapshot_GetConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetConfigurationManager(t *testing.T) { svc := New(Options{}) _, err := svc.GetConfigurationManager(context.Background(), nil, func(o *Options) { @@ -122,6 +134,18 @@ func TestCheckSnapshot_ListConfigurationManagers(t *testing.T) { } } +func TestCheckSnapshot_ListConfigurations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListConfigurations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListConfigurations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListQuickSetupTypes(t *testing.T) { svc := New(Options{}) _, err := svc.ListQuickSetupTypes(context.Background(), nil, func(o *Options) { @@ -229,6 +253,18 @@ func TestUpdateSnapshot_DeleteConfigurationManager(t *testing.T) { } } +func TestUpdateSnapshot_GetConfiguration(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetConfiguration(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetConfiguration") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetConfigurationManager(t *testing.T) { svc := New(Options{}) _, err := svc.GetConfigurationManager(context.Background(), nil, func(o *Options) { @@ -265,6 +301,18 @@ func TestUpdateSnapshot_ListConfigurationManagers(t *testing.T) { } } +func TestUpdateSnapshot_ListConfigurations(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListConfigurations(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListConfigurations") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListQuickSetupTypes(t *testing.T) { svc := New(Options{}) _, err := svc.ListQuickSetupTypes(context.Background(), nil, func(o *Options) { diff --git a/service/ssmquicksetup/types/types.go b/service/ssmquicksetup/types/types.go index ea7f0ab7ed4..acb16e25674 100644 --- a/service/ssmquicksetup/types/types.go +++ b/service/ssmquicksetup/types/types.go @@ -526,8 +526,8 @@ type ConfigurationDefinitionInput struct { // // - RebootOption // - // - Description: (Optional) A boolean value that determines whether instances - // are rebooted after patches are installed. The default value is " false ". + // - Description: (Optional) Determines whether instances are rebooted after + // patches are installed. Valid values are RebootIfNeeded and NoReboot . // // - IsPolicyAttachAllowed // @@ -672,6 +672,43 @@ type ConfigurationManagerSummary struct { noSmithyDocumentSerde } +// Details for a Quick Setup configuration. +type ConfigurationSummary struct { + + // The ID of the Amazon Web Services account where the configuration was deployed. + Account *string + + // The ID of the configuration definition. + ConfigurationDefinitionId *string + + // The datetime stamp when the configuration was created. + CreatedAt *time.Time + + // The common parameters and values for the configuration definition. + FirstClassParameters map[string]string + + // A service generated identifier for the configuration. + Id *string + + // The ARN of the configuration manager. + ManagerArn *string + + // The Amazon Web Services Region where the configuration was deployed. + Region *string + + // A summary of the state of the configuration manager. This includes deployment + // statuses, association statuses, drift statuses, health checks, and more. + StatusSummaries []StatusSummary + + // The type of the Quick Setup configuration. + Type *string + + // The version of the Quick Setup type used. + TypeVersion *string + + noSmithyDocumentSerde +} + // A key-value pair to filter results. type Filter struct { diff --git a/service/ssmquicksetup/validators.go b/service/ssmquicksetup/validators.go index b15aa268478..48d41423be7 100644 --- a/service/ssmquicksetup/validators.go +++ b/service/ssmquicksetup/validators.go @@ -50,6 +50,26 @@ func (m *validateOpDeleteConfigurationManager) HandleInitialize(ctx context.Cont return next.HandleInitialize(ctx, in) } +type validateOpGetConfiguration struct { +} + +func (*validateOpGetConfiguration) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetConfiguration) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetConfigurationInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetConfigurationInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetConfigurationManager struct { } @@ -90,6 +110,26 @@ func (m *validateOpListConfigurationManagers) HandleInitialize(ctx context.Conte return next.HandleInitialize(ctx, in) } +type validateOpListConfigurations struct { +} + +func (*validateOpListConfigurations) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListConfigurations) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListConfigurationsInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListConfigurationsInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -198,6 +238,10 @@ func addOpDeleteConfigurationManagerValidationMiddleware(stack *middleware.Stack return stack.Initialize.Add(&validateOpDeleteConfigurationManager{}, middleware.After) } +func addOpGetConfigurationValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetConfiguration{}, middleware.After) +} + func addOpGetConfigurationManagerValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetConfigurationManager{}, middleware.After) } @@ -206,6 +250,10 @@ func addOpListConfigurationManagersValidationMiddleware(stack *middleware.Stack) return stack.Initialize.Add(&validateOpListConfigurationManagers{}, middleware.After) } +func addOpListConfigurationsValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListConfigurations{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -330,6 +378,21 @@ func validateOpDeleteConfigurationManagerInput(v *DeleteConfigurationManagerInpu } } +func validateOpGetConfigurationInput(v *GetConfigurationInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetConfigurationInput"} + if v.ConfigurationId == nil { + invalidParams.Add(smithy.NewErrParamRequired("ConfigurationId")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetConfigurationManagerInput(v *GetConfigurationManagerInput) error { if v == nil { return nil @@ -362,6 +425,23 @@ func validateOpListConfigurationManagersInput(v *ListConfigurationManagersInput) } } +func validateOpListConfigurationsInput(v *ListConfigurationsInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListConfigurationsInput"} + if v.Filters != nil { + if err := validateFiltersList(v.Filters); err != nil { + invalidParams.AddNested("Filters", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil diff --git a/service/xray/api_op_BatchGetTraces.go b/service/xray/api_op_BatchGetTraces.go index c027d377025..b27655a87dd 100644 --- a/service/xray/api_op_BatchGetTraces.go +++ b/service/xray/api_op_BatchGetTraces.go @@ -11,6 +11,9 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) +// You cannot find traces through this API if Transaction Search is enabled since +// trace is not indexed in X-Ray. +// // Retrieves a list of traces specified by ID. Each trace is a collection of // segment documents that originates from a single request. Use GetTraceSummaries // to get a list of trace IDs. diff --git a/service/xray/api_op_CancelTraceRetrieval.go b/service/xray/api_op_CancelTraceRetrieval.go new file mode 100644 index 00000000000..fd4a3306127 --- /dev/null +++ b/service/xray/api_op_CancelTraceRetrieval.go @@ -0,0 +1,155 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Cancels an ongoing trace retrieval job initiated by StartTraceRetrieval using +// +// the provided RetrievalToken . A successful cancellation will return an HTTP 200 +// response. +func (c *Client) CancelTraceRetrieval(ctx context.Context, params *CancelTraceRetrievalInput, optFns ...func(*Options)) (*CancelTraceRetrievalOutput, error) { + if params == nil { + params = &CancelTraceRetrievalInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "CancelTraceRetrieval", params, optFns, c.addOperationCancelTraceRetrievalMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*CancelTraceRetrievalOutput) + out.ResultMetadata = metadata + return out, nil +} + +type CancelTraceRetrievalInput struct { + + // Retrieval token. + // + // This member is required. + RetrievalToken *string + + noSmithyDocumentSerde +} + +type CancelTraceRetrievalOutput struct { + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationCancelTraceRetrievalMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpCancelTraceRetrieval{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpCancelTraceRetrieval{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "CancelTraceRetrieval"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpCancelTraceRetrievalValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opCancelTraceRetrieval(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opCancelTraceRetrieval(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "CancelTraceRetrieval", + } +} diff --git a/service/xray/api_op_GetIndexingRules.go b/service/xray/api_op_GetIndexingRules.go new file mode 100644 index 00000000000..463cf12d7d0 --- /dev/null +++ b/service/xray/api_op_GetIndexingRules.go @@ -0,0 +1,163 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves all indexing rules. +// +// Indexing rules are used to determine the server-side sampling rate for spans +// ingested through the CloudWatchLogs destination and indexed by X-Ray. For more +// information, see [Transaction Search]. +// +// [Transaction Search]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Transaction-Search.html +func (c *Client) GetIndexingRules(ctx context.Context, params *GetIndexingRulesInput, optFns ...func(*Options)) (*GetIndexingRulesOutput, error) { + if params == nil { + params = &GetIndexingRulesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetIndexingRules", params, optFns, c.addOperationGetIndexingRulesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetIndexingRulesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetIndexingRulesInput struct { + + // Specify the pagination token returned by a previous request to retrieve the + // next page of indexes. + NextToken *string + + noSmithyDocumentSerde +} + +type GetIndexingRulesOutput struct { + + // Retrieves all indexing rules. + IndexingRules []types.IndexingRule + + // Specify the pagination token returned by a previous request to retrieve the + // next page of indexes. + NextToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetIndexingRulesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetIndexingRules{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetIndexingRules{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetIndexingRules"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetIndexingRules(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetIndexingRules(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetIndexingRules", + } +} diff --git a/service/xray/api_op_GetRetrievedTracesGraph.go b/service/xray/api_op_GetRetrievedTracesGraph.go new file mode 100644 index 00000000000..faa8203d93d --- /dev/null +++ b/service/xray/api_op_GetRetrievedTracesGraph.go @@ -0,0 +1,188 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a service graph for traces based on the specified RetrievalToken +// +// from the CloudWatch log group generated by Transaction Search. This API does not +// initiate a retrieval job. You must first execute StartTraceRetrieval to obtain +// the required RetrievalToken . +// +// The trace graph describes services that process incoming requests and any +// downstream services they call, which may include Amazon Web Services resources, +// external APIs, or databases. +// +// The response is empty until the RetrievalStatus is COMPLETE. Retry the request +// after the status changes from RUNNING or SCHEDULED to COMPLETE to access the +// full service graph. +// +// When CloudWatch log is the destination, this API can support cross-account +// observability and service graph retrieval across linked accounts. +// +// For retrieving graphs from X-Ray directly as opposed to the Transaction-Search +// Log group, see [GetTraceGraph]. +// +// [GetTraceGraph]: https://docs.aws.amazon.com/xray/latest/api/API_GetTraceGraph.html +func (c *Client) GetRetrievedTracesGraph(ctx context.Context, params *GetRetrievedTracesGraphInput, optFns ...func(*Options)) (*GetRetrievedTracesGraphOutput, error) { + if params == nil { + params = &GetRetrievedTracesGraphInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetRetrievedTracesGraph", params, optFns, c.addOperationGetRetrievedTracesGraphMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetRetrievedTracesGraphOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetRetrievedTracesGraphInput struct { + + // Retrieval token. + // + // This member is required. + RetrievalToken *string + + // Specify the pagination token returned by a previous request to retrieve the + // next page of indexes. + NextToken *string + + noSmithyDocumentSerde +} + +type GetRetrievedTracesGraphOutput struct { + + // Specify the pagination token returned by a previous request to retrieve the + // next page of indexes. + NextToken *string + + // Status of the retrieval. + RetrievalStatus types.RetrievalStatus + + // Retrieved services. + Services []types.RetrievedService + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetRetrievedTracesGraphMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetRetrievedTracesGraph{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetRetrievedTracesGraph{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetRetrievedTracesGraph"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpGetRetrievedTracesGraphValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetRetrievedTracesGraph(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetRetrievedTracesGraph(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetRetrievedTracesGraph", + } +} diff --git a/service/xray/api_op_GetTraceSegmentDestination.go b/service/xray/api_op_GetTraceSegmentDestination.go new file mode 100644 index 00000000000..98cd24a5fcc --- /dev/null +++ b/service/xray/api_op_GetTraceSegmentDestination.go @@ -0,0 +1,157 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves the current destination of data sent to PutTraceSegments and +// +// OpenTelemetry API. The Transaction Search feature requires a CloudWatchLogs +// destination. For more information, see [Transaction Search]and [OpenTelemetry]. +// +// [Transaction Search]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Transaction-Search.html +// [OpenTelemetry]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-OpenTelemetry-Sections.html +func (c *Client) GetTraceSegmentDestination(ctx context.Context, params *GetTraceSegmentDestinationInput, optFns ...func(*Options)) (*GetTraceSegmentDestinationOutput, error) { + if params == nil { + params = &GetTraceSegmentDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "GetTraceSegmentDestination", params, optFns, c.addOperationGetTraceSegmentDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*GetTraceSegmentDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type GetTraceSegmentDestinationInput struct { + noSmithyDocumentSerde +} + +type GetTraceSegmentDestinationOutput struct { + + // Retrieves the current destination. + Destination types.TraceSegmentDestination + + // Status of the retrieval. + Status types.TraceSegmentDestinationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationGetTraceSegmentDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpGetTraceSegmentDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpGetTraceSegmentDestination{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "GetTraceSegmentDestination"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opGetTraceSegmentDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opGetTraceSegmentDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "GetTraceSegmentDestination", + } +} diff --git a/service/xray/api_op_GetTraceSummaries.go b/service/xray/api_op_GetTraceSummaries.go index 0263b9c6ed1..8740105826d 100644 --- a/service/xray/api_op_GetTraceSummaries.go +++ b/service/xray/api_op_GetTraceSummaries.go @@ -28,9 +28,9 @@ import ( // annotation.account = "12345" // // For a full list of indexed fields and keywords that you can use in filter -// expressions, see [Using Filter Expressions]in the Amazon Web Services X-Ray Developer Guide. +// expressions, see [Use filter expressions]in the Amazon Web Services X-Ray Developer Guide. // -// [Using Filter Expressions]: https://docs.aws.amazon.com/xray/latest/devguide/xray-console-filters.html +// [Use filter expressions]: https://docs.aws.amazon.com/xray/latest/devguide/aws-xray-interface-console.html#xray-console-filters func (c *Client) GetTraceSummaries(ctx context.Context, params *GetTraceSummariesInput, optFns ...func(*Options)) (*GetTraceSummariesOutput, error) { if params == nil { params = &GetTraceSummariesInput{} @@ -73,8 +73,8 @@ type GetTraceSummariesInput struct { // parameters are Name and Value. SamplingStrategy *types.SamplingStrategy - // A parameter to indicate whether to query trace summaries by TraceId, Event - // (trace update time), or Service (segment end time). + // Query trace summaries by TraceId (trace start time), Event (trace update time), + // or Service (trace segment end time). TimeRangeType types.TimeRangeType noSmithyDocumentSerde diff --git a/service/xray/api_op_ListRetrievedTraces.go b/service/xray/api_op_ListRetrievedTraces.go new file mode 100644 index 00000000000..a1a4ee7ef99 --- /dev/null +++ b/service/xray/api_op_ListRetrievedTraces.go @@ -0,0 +1,194 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Retrieves a list of traces for a given RetrievalToken from the CloudWatch log +// +// group generated by Transaction Search. For information on what each trace +// returns, see [BatchGetTraces]. +// +// This API does not initiate a retrieval job. To start a trace retrieval, use +// StartTraceRetrieval , which generates the required RetrievalToken . +// +// When the RetrievalStatus is not COMPLETE, the API will return an empty +// response. Retry the request once the retrieval has completed to access the full +// list of traces. +// +// For cross-account observability, this API can retrieve traces from linked +// accounts when CloudWatch log is the destination across relevant accounts. For +// more details, see [CloudWatch cross-account observability]. +// +// For retrieving data from X-Ray directly as opposed to the Transaction-Search +// Log group, see [BatchGetTraces]. +// +// [BatchGetTraces]: https://docs.aws.amazon.com/xray/latest/api/API_BatchGetTraces.html +// [CloudWatch cross-account observability]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html +func (c *Client) ListRetrievedTraces(ctx context.Context, params *ListRetrievedTracesInput, optFns ...func(*Options)) (*ListRetrievedTracesOutput, error) { + if params == nil { + params = &ListRetrievedTracesInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "ListRetrievedTraces", params, optFns, c.addOperationListRetrievedTracesMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*ListRetrievedTracesOutput) + out.ResultMetadata = metadata + return out, nil +} + +type ListRetrievedTracesInput struct { + + // Retrieval token. + // + // This member is required. + RetrievalToken *string + + // Specify the pagination token returned by a previous request to retrieve the + // next page of indexes. + NextToken *string + + // Format of the requested traces. + TraceFormat types.TraceFormatType + + noSmithyDocumentSerde +} + +type ListRetrievedTracesOutput struct { + + // Specify the pagination token returned by a previous request to retrieve the + // next page of indexes. + NextToken *string + + // Status of the retrieval. + RetrievalStatus types.RetrievalStatus + + // Format of the requested traces. + TraceFormat types.TraceFormatType + + // Full traces for the specified requests. + Traces []types.RetrievedTrace + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationListRetrievedTracesMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpListRetrievedTraces{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpListRetrievedTraces{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "ListRetrievedTraces"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpListRetrievedTracesValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opListRetrievedTraces(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opListRetrievedTraces(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "ListRetrievedTraces", + } +} diff --git a/service/xray/api_op_PutTraceSegments.go b/service/xray/api_op_PutTraceSegments.go index 3c05f54c105..1be162c5e59 100644 --- a/service/xray/api_op_PutTraceSegments.go +++ b/service/xray/api_op_PutTraceSegments.go @@ -11,10 +11,8 @@ import ( smithyhttp "github.com/aws/smithy-go/transport/http" ) -// Uploads segment documents to Amazon Web Services X-Ray. The [X-Ray SDK] generates segment -// documents and sends them to the X-Ray daemon, which uploads them in batches. A -// segment document can be a completed segment, an in-progress segment, or an array -// of subsegments. +// Uploads segment documents to Amazon Web Services X-Ray. A segment document can +// be a completed segment, an in-progress segment, or an array of subsegments. // // Segments must include the following fields. For the full segment document // schema, see [Amazon Web Services X-Ray Segment Documents]in the Amazon Web Services X-Ray Developer Guide. @@ -44,7 +42,8 @@ import ( // complete segment to overwrite the in-progress segment. // // A trace_id consists of three numbers separated by hyphens. For example, -// 1-58406520-a006649127e371903a2de979. This includes: +// 1-58406520-a006649127e371903a2de979. For trace IDs created by an X-Ray SDK, or +// by Amazon Web Services services integrated with X-Ray, a trace ID includes: // // Trace ID Format // @@ -57,8 +56,15 @@ import ( // - A 96-bit identifier for the trace, globally unique, in 24 hexadecimal // digits. // -// [X-Ray SDK]: https://docs.aws.amazon.com/xray/index.html -// [Amazon Web Services X-Ray Segment Documents]: https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html +// Trace IDs created via OpenTelemetry have a different format based on the [W3C Trace Context specification]. A +// W3C trace ID must be formatted in the X-Ray trace ID format when sending to +// X-Ray. For example, a W3C trace ID 4efaaf4d1e8720b39541901950019ee5 should be +// formatted as 1-4efaaf4d-1e8720b39541901950019ee5 when sending to X-Ray. While +// X-Ray trace IDs include the original request timestamp in Unix epoch time, this +// is not required or validated. +// +// [W3C Trace Context specification]: https://www.w3.org/TR/trace-context/ +// [Amazon Web Services X-Ray Segment Documents]: https://docs.aws.amazon.com/xray/latest/devguide/aws-xray-interface-api.html#xray-api-segmentdocuments.html func (c *Client) PutTraceSegments(ctx context.Context, params *PutTraceSegmentsInput, optFns ...func(*Options)) (*PutTraceSegmentsOutput, error) { if params == nil { params = &PutTraceSegmentsInput{} diff --git a/service/xray/api_op_StartTraceRetrieval.go b/service/xray/api_op_StartTraceRetrieval.go new file mode 100644 index 00000000000..21913b6f768 --- /dev/null +++ b/service/xray/api_op_StartTraceRetrieval.go @@ -0,0 +1,190 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" + "time" +) + +// Initiates a trace retrieval process using the specified time range and for the +// +// give trace IDs on Transaction Search generated by the CloudWatch log group. For +// more information, see [Transaction Search]. +// +// API returns a RetrievalToken , which can be used with ListRetrievedTraces or +// GetRetrievedTracesGraph to fetch results. Retrievals will time out after 60 +// minutes. To execute long time ranges, consider segmenting into multiple +// retrievals. +// +// If you are using [CloudWatch cross-account observability], you can use this operation in a monitoring account to +// retrieve data from a linked source account, as long as both accounts have +// transaction search enabled. +// +// For retrieving data from X-Ray directly as opposed to the Transaction-Search +// Log group, see [BatchGetTraces]. +// +// [BatchGetTraces]: https://docs.aws.amazon.com/xray/latest/api/API_BatchGetTraces.html +// [Transaction Search]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Transaction-Search.html +// [CloudWatch cross-account observability]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Unified-Cross-Account.html +func (c *Client) StartTraceRetrieval(ctx context.Context, params *StartTraceRetrievalInput, optFns ...func(*Options)) (*StartTraceRetrievalOutput, error) { + if params == nil { + params = &StartTraceRetrievalInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "StartTraceRetrieval", params, optFns, c.addOperationStartTraceRetrievalMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*StartTraceRetrievalOutput) + out.ResultMetadata = metadata + return out, nil +} + +type StartTraceRetrievalInput struct { + + // The end of the time range to retrieve traces. The range is inclusive, so the + // specified end time is included in the query. Specified as epoch time, the number + // of seconds since January 1, 1970, 00:00:00 UTC. + // + // This member is required. + EndTime *time.Time + + // The start of the time range to retrieve traces. The range is inclusive, so the + // specified start time is included in the query. Specified as epoch time, the + // number of seconds since January 1, 1970, 00:00:00 UTC. + // + // This member is required. + StartTime *time.Time + + // Specify the trace IDs of the traces to be retrieved. + // + // This member is required. + TraceIds []string + + noSmithyDocumentSerde +} + +type StartTraceRetrievalOutput struct { + + // Retrieval token. + RetrievalToken *string + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationStartTraceRetrievalMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpStartTraceRetrieval{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpStartTraceRetrieval{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "StartTraceRetrieval"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpStartTraceRetrievalValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opStartTraceRetrieval(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opStartTraceRetrieval(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "StartTraceRetrieval", + } +} diff --git a/service/xray/api_op_UpdateIndexingRule.go b/service/xray/api_op_UpdateIndexingRule.go new file mode 100644 index 00000000000..5c685405ae6 --- /dev/null +++ b/service/xray/api_op_UpdateIndexingRule.go @@ -0,0 +1,167 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies an indexing rule’s configuration. +// +// Indexing rules are used for determining the sampling rate for spans indexed +// from CloudWatch Logs. For more information, see [Transaction Search]. +// +// [Transaction Search]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Transaction-Search.html +func (c *Client) UpdateIndexingRule(ctx context.Context, params *UpdateIndexingRuleInput, optFns ...func(*Options)) (*UpdateIndexingRuleOutput, error) { + if params == nil { + params = &UpdateIndexingRuleInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateIndexingRule", params, optFns, c.addOperationUpdateIndexingRuleMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateIndexingRuleOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateIndexingRuleInput struct { + + // Name of the indexing rule to be updated. + // + // This member is required. + Name *string + + // Rule configuration to be updated. + // + // This member is required. + Rule types.IndexingRuleValueUpdate + + noSmithyDocumentSerde +} + +type UpdateIndexingRuleOutput struct { + + // Updated indexing rule. + IndexingRule *types.IndexingRule + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateIndexingRuleMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateIndexingRule{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateIndexingRule{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateIndexingRule"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = addOpUpdateIndexingRuleValidationMiddleware(stack); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateIndexingRule(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateIndexingRule(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateIndexingRule", + } +} diff --git a/service/xray/api_op_UpdateTraceSegmentDestination.go b/service/xray/api_op_UpdateTraceSegmentDestination.go new file mode 100644 index 00000000000..13ca1a717b5 --- /dev/null +++ b/service/xray/api_op_UpdateTraceSegmentDestination.go @@ -0,0 +1,160 @@ +// Code generated by smithy-go-codegen DO NOT EDIT. + +package xray + +import ( + "context" + "fmt" + awsmiddleware "github.com/aws/aws-sdk-go-v2/aws/middleware" + "github.com/aws/aws-sdk-go-v2/service/xray/types" + "github.com/aws/smithy-go/middleware" + smithyhttp "github.com/aws/smithy-go/transport/http" +) + +// Modifies the destination of data sent to PutTraceSegments . The Transaction +// +// Search feature requires the CloudWatchLogs destination. For more information, +// see [Transaction Search]. +// +// [Transaction Search]: https://docs.aws.amazon.com/AmazonCloudWatch/latest/monitoring/CloudWatch-Transaction-Search.html +func (c *Client) UpdateTraceSegmentDestination(ctx context.Context, params *UpdateTraceSegmentDestinationInput, optFns ...func(*Options)) (*UpdateTraceSegmentDestinationOutput, error) { + if params == nil { + params = &UpdateTraceSegmentDestinationInput{} + } + + result, metadata, err := c.invokeOperation(ctx, "UpdateTraceSegmentDestination", params, optFns, c.addOperationUpdateTraceSegmentDestinationMiddlewares) + if err != nil { + return nil, err + } + + out := result.(*UpdateTraceSegmentDestinationOutput) + out.ResultMetadata = metadata + return out, nil +} + +type UpdateTraceSegmentDestinationInput struct { + + // The configured destination of trace segments. + Destination types.TraceSegmentDestination + + noSmithyDocumentSerde +} + +type UpdateTraceSegmentDestinationOutput struct { + + // The destination of the trace segments. + Destination types.TraceSegmentDestination + + // The status of the update. + Status types.TraceSegmentDestinationStatus + + // Metadata pertaining to the operation's result. + ResultMetadata middleware.Metadata + + noSmithyDocumentSerde +} + +func (c *Client) addOperationUpdateTraceSegmentDestinationMiddlewares(stack *middleware.Stack, options Options) (err error) { + if err := stack.Serialize.Add(&setOperationInputMiddleware{}, middleware.After); err != nil { + return err + } + err = stack.Serialize.Add(&awsRestjson1_serializeOpUpdateTraceSegmentDestination{}, middleware.After) + if err != nil { + return err + } + err = stack.Deserialize.Add(&awsRestjson1_deserializeOpUpdateTraceSegmentDestination{}, middleware.After) + if err != nil { + return err + } + if err := addProtocolFinalizerMiddlewares(stack, options, "UpdateTraceSegmentDestination"); err != nil { + return fmt.Errorf("add protocol finalizers: %v", err) + } + + if err = addlegacyEndpointContextSetter(stack, options); err != nil { + return err + } + if err = addSetLoggerMiddleware(stack, options); err != nil { + return err + } + if err = addClientRequestID(stack); err != nil { + return err + } + if err = addComputeContentLength(stack); err != nil { + return err + } + if err = addResolveEndpointMiddleware(stack, options); err != nil { + return err + } + if err = addComputePayloadSHA256(stack); err != nil { + return err + } + if err = addRetry(stack, options); err != nil { + return err + } + if err = addRawResponseToMetadata(stack); err != nil { + return err + } + if err = addRecordResponseTiming(stack); err != nil { + return err + } + if err = addSpanRetryLoop(stack, options); err != nil { + return err + } + if err = addClientUserAgent(stack, options); err != nil { + return err + } + if err = smithyhttp.AddErrorCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = smithyhttp.AddCloseResponseBodyMiddleware(stack); err != nil { + return err + } + if err = addSetLegacyContextSigningOptionsMiddleware(stack); err != nil { + return err + } + if err = addTimeOffsetBuild(stack, c); err != nil { + return err + } + if err = addUserAgentRetryMode(stack, options); err != nil { + return err + } + if err = stack.Initialize.Add(newServiceMetadataMiddleware_opUpdateTraceSegmentDestination(options.Region), middleware.Before); err != nil { + return err + } + if err = addRecursionDetection(stack); err != nil { + return err + } + if err = addRequestIDRetrieverMiddleware(stack); err != nil { + return err + } + if err = addResponseErrorMiddleware(stack); err != nil { + return err + } + if err = addRequestResponseLogging(stack, options); err != nil { + return err + } + if err = addDisableHTTPSMiddleware(stack, options); err != nil { + return err + } + if err = addSpanInitializeStart(stack); err != nil { + return err + } + if err = addSpanInitializeEnd(stack); err != nil { + return err + } + if err = addSpanBuildRequestStart(stack); err != nil { + return err + } + if err = addSpanBuildRequestEnd(stack); err != nil { + return err + } + return nil +} + +func newServiceMetadataMiddleware_opUpdateTraceSegmentDestination(region string) *awsmiddleware.RegisterServiceMetadata { + return &awsmiddleware.RegisterServiceMetadata{ + Region: region, + ServiceID: ServiceID, + OperationName: "UpdateTraceSegmentDestination", + } +} diff --git a/service/xray/deserializers.go b/service/xray/deserializers.go index 0201f67f544..9dd096d702e 100644 --- a/service/xray/deserializers.go +++ b/service/xray/deserializers.go @@ -199,6 +199,100 @@ func awsRestjson1_deserializeOpDocumentBatchGetTracesOutput(v **BatchGetTracesOu return nil } +type awsRestjson1_deserializeOpCancelTraceRetrieval struct { +} + +func (*awsRestjson1_deserializeOpCancelTraceRetrieval) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpCancelTraceRetrieval) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorCancelTraceRetrieval(response, &metadata) + } + output := &CancelTraceRetrievalOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorCancelTraceRetrieval(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + type awsRestjson1_deserializeOpCreateGroup struct { } @@ -1326,6 +1420,170 @@ func awsRestjson1_deserializeOpDocumentGetGroupsOutput(v **GetGroupsOutput, valu return nil } +type awsRestjson1_deserializeOpGetIndexingRules struct { +} + +func (*awsRestjson1_deserializeOpGetIndexingRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetIndexingRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetIndexingRules(response, &metadata) + } + output := &GetIndexingRulesOutput{} + 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_deserializeOpDocumentGetIndexingRulesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetIndexingRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetIndexingRulesOutput(v **GetIndexingRulesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetIndexingRulesOutput + if *v == nil { + sv = &GetIndexingRulesOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IndexingRules": + if err := awsRestjson1_deserializeDocumentIndexingRuleList(&sv.IndexingRules, 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_deserializeOpGetInsight struct { } @@ -2046,14 +2304,14 @@ func awsRestjson1_deserializeOpDocumentGetInsightSummariesOutput(v **GetInsightS return nil } -type awsRestjson1_deserializeOpGetSamplingRules struct { +type awsRestjson1_deserializeOpGetRetrievedTracesGraph struct { } -func (*awsRestjson1_deserializeOpGetSamplingRules) ID() string { +func (*awsRestjson1_deserializeOpGetRetrievedTracesGraph) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetSamplingRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetRetrievedTracesGraph) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -2071,9 +2329,9 @@ func (m *awsRestjson1_deserializeOpGetSamplingRules) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetSamplingRules(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetRetrievedTracesGraph(response, &metadata) } - output := &GetSamplingRulesOutput{} + output := &GetRetrievedTracesGraphOutput{} out.Result = output var buff [1024]byte @@ -2094,7 +2352,7 @@ func (m *awsRestjson1_deserializeOpGetSamplingRules) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetSamplingRulesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetRetrievedTracesGraphOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -2108,7 +2366,7 @@ func (m *awsRestjson1_deserializeOpGetSamplingRules) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetSamplingRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetRetrievedTracesGraph(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -2152,6 +2410,9 @@ func awsRestjson1_deserializeOpErrorGetSamplingRules(response *smithyhttp.Respon case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottledException", errorCode): return awsRestjson1_deserializeErrorThrottledException(response, errorBody) @@ -2165,7 +2426,7 @@ func awsRestjson1_deserializeOpErrorGetSamplingRules(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentGetSamplingRulesOutput(v **GetSamplingRulesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetRetrievedTracesGraphOutput(v **GetRetrievedTracesGraphOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -2178,9 +2439,9 @@ func awsRestjson1_deserializeOpDocumentGetSamplingRulesOutput(v **GetSamplingRul return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetSamplingRulesOutput + var sv *GetRetrievedTracesGraphOutput if *v == nil { - sv = &GetSamplingRulesOutput{} + sv = &GetRetrievedTracesGraphOutput{} } else { sv = *v } @@ -2196,9 +2457,182 @@ func awsRestjson1_deserializeOpDocumentGetSamplingRulesOutput(v **GetSamplingRul sv.NextToken = ptr.String(jtv) } - case "SamplingRuleRecords": - if err := awsRestjson1_deserializeDocumentSamplingRuleRecordList(&sv.SamplingRuleRecords, value); err != nil { - return err + case "RetrievalStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrievalStatus to be of type string, got %T instead", value) + } + sv.RetrievalStatus = types.RetrievalStatus(jtv) + } + + case "Services": + if err := awsRestjson1_deserializeDocumentRetrievedServicesList(&sv.Services, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpGetSamplingRules struct { +} + +func (*awsRestjson1_deserializeOpGetSamplingRules) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpGetSamplingRules) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorGetSamplingRules(response, &metadata) + } + output := &GetSamplingRulesOutput{} + 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_deserializeOpDocumentGetSamplingRulesOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorGetSamplingRules(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentGetSamplingRulesOutput(v **GetSamplingRulesOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *GetSamplingRulesOutput + if *v == nil { + sv = &GetSamplingRulesOutput{} + } 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 "SamplingRuleRecords": + if err := awsRestjson1_deserializeDocumentSamplingRuleRecordList(&sv.SamplingRuleRecords, value); err != nil { + return err } default: @@ -3092,14 +3526,14 @@ func awsRestjson1_deserializeOpDocumentGetTraceGraphOutput(v **GetTraceGraphOutp return nil } -type awsRestjson1_deserializeOpGetTraceSummaries struct { +type awsRestjson1_deserializeOpGetTraceSegmentDestination struct { } -func (*awsRestjson1_deserializeOpGetTraceSummaries) ID() string { +func (*awsRestjson1_deserializeOpGetTraceSegmentDestination) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpGetTraceSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetTraceSegmentDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3117,9 +3551,9 @@ func (m *awsRestjson1_deserializeOpGetTraceSummaries) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorGetTraceSummaries(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetTraceSegmentDestination(response, &metadata) } - output := &GetTraceSummariesOutput{} + output := &GetTraceSegmentDestinationOutput{} out.Result = output var buff [1024]byte @@ -3140,7 +3574,7 @@ func (m *awsRestjson1_deserializeOpGetTraceSummaries) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentGetTraceSummariesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetTraceSegmentDestinationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3154,7 +3588,7 @@ func (m *awsRestjson1_deserializeOpGetTraceSummaries) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorGetTraceSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetTraceSegmentDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3211,7 +3645,7 @@ func awsRestjson1_deserializeOpErrorGetTraceSummaries(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentGetTraceSummariesOutput(v **GetTraceSummariesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetTraceSegmentDestinationOutput(v **GetTraceSegmentDestinationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3224,56 +3658,31 @@ func awsRestjson1_deserializeOpDocumentGetTraceSummariesOutput(v **GetTraceSumma return fmt.Errorf("unexpected JSON type %v", value) } - var sv *GetTraceSummariesOutput + var sv *GetTraceSegmentDestinationOutput if *v == nil { - sv = &GetTraceSummariesOutput{} + sv = &GetTraceSegmentDestinationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ApproximateTime": - if value != nil { - switch jtv := value.(type) { - case json.Number: - f64, err := jtv.Float64() - if err != nil { - return err - } - sv.ApproximateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) - - default: - return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) - - } - } - - case "NextToken": + case "Destination": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected TraceSegmentDestination to be of type string, got %T instead", value) } - sv.NextToken = ptr.String(jtv) + sv.Destination = types.TraceSegmentDestination(jtv) } - case "TracesProcessedCount": + case "Status": if value != nil { - jtv, ok := value.(json.Number) + jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected NullableLong to be json.Number, got %T instead", value) - } - i64, err := jtv.Int64() - if err != nil { - return err + return fmt.Errorf("expected TraceSegmentDestinationStatus to be of type string, got %T instead", value) } - sv.TracesProcessedCount = ptr.Int64(i64) - } - - case "TraceSummaries": - if err := awsRestjson1_deserializeDocumentTraceSummaryList(&sv.TraceSummaries, value); err != nil { - return err + sv.Status = types.TraceSegmentDestinationStatus(jtv) } default: @@ -3285,14 +3694,14 @@ func awsRestjson1_deserializeOpDocumentGetTraceSummariesOutput(v **GetTraceSumma return nil } -type awsRestjson1_deserializeOpListResourcePolicies struct { +type awsRestjson1_deserializeOpGetTraceSummaries struct { } -func (*awsRestjson1_deserializeOpListResourcePolicies) ID() string { +func (*awsRestjson1_deserializeOpGetTraceSummaries) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListResourcePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpGetTraceSummaries) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3310,9 +3719,9 @@ func (m *awsRestjson1_deserializeOpListResourcePolicies) HandleDeserialize(ctx c } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListResourcePolicies(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorGetTraceSummaries(response, &metadata) } - output := &ListResourcePoliciesOutput{} + output := &GetTraceSummariesOutput{} out.Result = output var buff [1024]byte @@ -3333,7 +3742,7 @@ func (m *awsRestjson1_deserializeOpListResourcePolicies) HandleDeserialize(ctx c return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListResourcePoliciesOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentGetTraceSummariesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3347,7 +3756,7 @@ func (m *awsRestjson1_deserializeOpListResourcePolicies) HandleDeserialize(ctx c return out, metadata, err } -func awsRestjson1_deserializeOpErrorListResourcePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorGetTraceSummaries(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3404,7 +3813,7 @@ func awsRestjson1_deserializeOpErrorListResourcePolicies(response *smithyhttp.Re } } -func awsRestjson1_deserializeOpDocumentListResourcePoliciesOutput(v **ListResourcePoliciesOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentGetTraceSummariesOutput(v **GetTraceSummariesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3417,26 +3826,55 @@ func awsRestjson1_deserializeOpDocumentListResourcePoliciesOutput(v **ListResour return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListResourcePoliciesOutput + var sv *GetTraceSummariesOutput if *v == nil { - sv = &ListResourcePoliciesOutput{} + sv = &GetTraceSummariesOutput{} } else { sv = *v } for key, value := range shape { switch key { + case "ApproximateTime": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ApproximateTime = ptr.Time(smithytime.ParseEpochSeconds(f64)) + + default: + return fmt.Errorf("expected Timestamp to be a JSON Number, got %T instead", value) + + } + } + case "NextToken": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected ResourcePolicyNextToken to be of type string, got %T instead", value) + return fmt.Errorf("expected String to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "ResourcePolicies": - if err := awsRestjson1_deserializeDocumentResourcePolicyList(&sv.ResourcePolicies, value); err != nil { + case "TracesProcessedCount": + if value != nil { + jtv, ok := value.(json.Number) + if !ok { + return fmt.Errorf("expected NullableLong to be json.Number, got %T instead", value) + } + i64, err := jtv.Int64() + if err != nil { + return err + } + sv.TracesProcessedCount = ptr.Int64(i64) + } + + case "TraceSummaries": + if err := awsRestjson1_deserializeDocumentTraceSummaryList(&sv.TraceSummaries, value); err != nil { return err } @@ -3449,14 +3887,14 @@ func awsRestjson1_deserializeOpDocumentListResourcePoliciesOutput(v **ListResour return nil } -type awsRestjson1_deserializeOpListTagsForResource struct { +type awsRestjson1_deserializeOpListResourcePolicies struct { } -func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { +func (*awsRestjson1_deserializeOpListResourcePolicies) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListResourcePolicies) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3474,9 +3912,9 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListResourcePolicies(response, &metadata) } - output := &ListTagsForResourceOutput{} + output := &ListResourcePoliciesOutput{} out.Result = output var buff [1024]byte @@ -3497,7 +3935,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListResourcePoliciesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3511,7 +3949,7 @@ func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListResourcePolicies(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3555,9 +3993,6 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("ResourceNotFoundException", errorCode): - return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) - case strings.EqualFold("ThrottledException", errorCode): return awsRestjson1_deserializeErrorThrottledException(response, errorBody) @@ -3571,7 +4006,7 @@ func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListResourcePoliciesOutput(v **ListResourcePoliciesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3584,9 +4019,9 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return fmt.Errorf("unexpected JSON type %v", value) } - var sv *ListTagsForResourceOutput + var sv *ListResourcePoliciesOutput if *v == nil { - sv = &ListTagsForResourceOutput{} + sv = &ListResourcePoliciesOutput{} } else { sv = *v } @@ -3597,13 +4032,13 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected ResourcePolicyNextToken to be of type string, got %T instead", value) } sv.NextToken = ptr.String(jtv) } - case "Tags": - if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { + case "ResourcePolicies": + if err := awsRestjson1_deserializeDocumentResourcePolicyList(&sv.ResourcePolicies, value); err != nil { return err } @@ -3616,14 +4051,14 @@ func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsFor return nil } -type awsRestjson1_deserializeOpPutEncryptionConfig struct { +type awsRestjson1_deserializeOpListRetrievedTraces struct { } -func (*awsRestjson1_deserializeOpPutEncryptionConfig) ID() string { +func (*awsRestjson1_deserializeOpListRetrievedTraces) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutEncryptionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListRetrievedTraces) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3641,9 +4076,9 @@ func (m *awsRestjson1_deserializeOpPutEncryptionConfig) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutEncryptionConfig(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListRetrievedTraces(response, &metadata) } - output := &PutEncryptionConfigOutput{} + output := &ListRetrievedTracesOutput{} out.Result = output var buff [1024]byte @@ -3664,7 +4099,7 @@ func (m *awsRestjson1_deserializeOpPutEncryptionConfig) HandleDeserialize(ctx co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutEncryptionConfigOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListRetrievedTracesOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3678,7 +4113,7 @@ func (m *awsRestjson1_deserializeOpPutEncryptionConfig) HandleDeserialize(ctx co return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutEncryptionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListRetrievedTraces(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3722,6 +4157,9 @@ func awsRestjson1_deserializeOpErrorPutEncryptionConfig(response *smithyhttp.Res case strings.EqualFold("InvalidRequestException", errorCode): return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + case strings.EqualFold("ThrottledException", errorCode): return awsRestjson1_deserializeErrorThrottledException(response, errorBody) @@ -3735,7 +4173,7 @@ func awsRestjson1_deserializeOpErrorPutEncryptionConfig(response *smithyhttp.Res } } -func awsRestjson1_deserializeOpDocumentPutEncryptionConfigOutput(v **PutEncryptionConfigOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListRetrievedTracesOutput(v **ListRetrievedTracesOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3748,17 +4186,44 @@ func awsRestjson1_deserializeOpDocumentPutEncryptionConfigOutput(v **PutEncrypti return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutEncryptionConfigOutput + var sv *ListRetrievedTracesOutput if *v == nil { - sv = &PutEncryptionConfigOutput{} + sv = &ListRetrievedTracesOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "EncryptionConfig": - if err := awsRestjson1_deserializeDocumentEncryptionConfig(&sv.EncryptionConfig, value); err != nil { + 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 "RetrievalStatus": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrievalStatus to be of type string, got %T instead", value) + } + sv.RetrievalStatus = types.RetrievalStatus(jtv) + } + + case "TraceFormat": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TraceFormatType to be of type string, got %T instead", value) + } + sv.TraceFormat = types.TraceFormatType(jtv) + } + + case "Traces": + if err := awsRestjson1_deserializeDocumentTraceSpanList(&sv.Traces, value); err != nil { return err } @@ -3771,14 +4236,14 @@ func awsRestjson1_deserializeOpDocumentPutEncryptionConfigOutput(v **PutEncrypti return nil } -type awsRestjson1_deserializeOpPutResourcePolicy struct { +type awsRestjson1_deserializeOpListTagsForResource struct { } -func (*awsRestjson1_deserializeOpPutResourcePolicy) ID() string { +func (*awsRestjson1_deserializeOpListTagsForResource) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpListTagsForResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3796,9 +4261,9 @@ func (m *awsRestjson1_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutResourcePolicy(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorListTagsForResource(response, &metadata) } - output := &PutResourcePolicyOutput{} + output := &ListTagsForResourceOutput{} out.Result = output var buff [1024]byte @@ -3819,7 +4284,7 @@ func (m *awsRestjson1_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -3833,7 +4298,7 @@ func (m *awsRestjson1_deserializeOpPutResourcePolicy) HandleDeserialize(ctx cont return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorListTagsForResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -3874,20 +4339,11 @@ func awsRestjson1_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } switch { - case strings.EqualFold("InvalidPolicyRevisionIdException", errorCode): - return awsRestjson1_deserializeErrorInvalidPolicyRevisionIdException(response, errorBody) - - case strings.EqualFold("LockoutPreventionException", errorCode): - return awsRestjson1_deserializeErrorLockoutPreventionException(response, errorBody) - - case strings.EqualFold("MalformedPolicyDocumentException", errorCode): - return awsRestjson1_deserializeErrorMalformedPolicyDocumentException(response, errorBody) - - case strings.EqualFold("PolicyCountLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorPolicyCountLimitExceededException(response, errorBody) + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) - case strings.EqualFold("PolicySizeLimitExceededException", errorCode): - return awsRestjson1_deserializeErrorPolicySizeLimitExceededException(response, errorBody) + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) case strings.EqualFold("ThrottledException", errorCode): return awsRestjson1_deserializeErrorThrottledException(response, errorBody) @@ -3902,7 +4358,7 @@ func awsRestjson1_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Respo } } -func awsRestjson1_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentListTagsForResourceOutput(v **ListTagsForResourceOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -3915,17 +4371,26 @@ func awsRestjson1_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePo return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutResourcePolicyOutput + var sv *ListTagsForResourceOutput if *v == nil { - sv = &PutResourcePolicyOutput{} + sv = &ListTagsForResourceOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "ResourcePolicy": - if err := awsRestjson1_deserializeDocumentResourcePolicy(&sv.ResourcePolicy, value); err != nil { + 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 "Tags": + if err := awsRestjson1_deserializeDocumentTagList(&sv.Tags, value); err != nil { return err } @@ -3938,14 +4403,14 @@ func awsRestjson1_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePo return nil } -type awsRestjson1_deserializeOpPutTelemetryRecords struct { +type awsRestjson1_deserializeOpPutEncryptionConfig struct { } -func (*awsRestjson1_deserializeOpPutTelemetryRecords) ID() string { +func (*awsRestjson1_deserializeOpPutEncryptionConfig) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutTelemetryRecords) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutEncryptionConfig) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -3963,16 +4428,44 @@ func (m *awsRestjson1_deserializeOpPutTelemetryRecords) HandleDeserialize(ctx co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutTelemetryRecords(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutEncryptionConfig(response, &metadata) } - output := &PutTelemetryRecordsOutput{} + output := &PutEncryptionConfigOutput{} 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_deserializeOpDocumentPutEncryptionConfigOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutTelemetryRecords(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutEncryptionConfig(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4029,14 +4522,50 @@ func awsRestjson1_deserializeOpErrorPutTelemetryRecords(response *smithyhttp.Res } } -type awsRestjson1_deserializeOpPutTraceSegments struct { +func awsRestjson1_deserializeOpDocumentPutEncryptionConfigOutput(v **PutEncryptionConfigOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutEncryptionConfigOutput + if *v == nil { + sv = &PutEncryptionConfigOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "EncryptionConfig": + if err := awsRestjson1_deserializeDocumentEncryptionConfig(&sv.EncryptionConfig, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpPutTraceSegments) ID() string { +type awsRestjson1_deserializeOpPutResourcePolicy struct { +} + +func (*awsRestjson1_deserializeOpPutResourcePolicy) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpPutTraceSegments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutResourcePolicy) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4054,9 +4583,9 @@ func (m *awsRestjson1_deserializeOpPutTraceSegments) HandleDeserialize(ctx conte } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorPutTraceSegments(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorPutResourcePolicy(response, &metadata) } - output := &PutTraceSegmentsOutput{} + output := &PutResourcePolicyOutput{} out.Result = output var buff [1024]byte @@ -4077,7 +4606,7 @@ func (m *awsRestjson1_deserializeOpPutTraceSegments) HandleDeserialize(ctx conte return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentPutTraceSegmentsOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentPutResourcePolicyOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4091,7 +4620,7 @@ func (m *awsRestjson1_deserializeOpPutTraceSegments) HandleDeserialize(ctx conte return out, metadata, err } -func awsRestjson1_deserializeOpErrorPutTraceSegments(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorPutResourcePolicy(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4132,8 +4661,20 @@ func awsRestjson1_deserializeOpErrorPutTraceSegments(response *smithyhttp.Respon } switch { - case strings.EqualFold("InvalidRequestException", errorCode): - return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + case strings.EqualFold("InvalidPolicyRevisionIdException", errorCode): + return awsRestjson1_deserializeErrorInvalidPolicyRevisionIdException(response, errorBody) + + case strings.EqualFold("LockoutPreventionException", errorCode): + return awsRestjson1_deserializeErrorLockoutPreventionException(response, errorBody) + + case strings.EqualFold("MalformedPolicyDocumentException", errorCode): + return awsRestjson1_deserializeErrorMalformedPolicyDocumentException(response, errorBody) + + case strings.EqualFold("PolicyCountLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorPolicyCountLimitExceededException(response, errorBody) + + case strings.EqualFold("PolicySizeLimitExceededException", errorCode): + return awsRestjson1_deserializeErrorPolicySizeLimitExceededException(response, errorBody) case strings.EqualFold("ThrottledException", errorCode): return awsRestjson1_deserializeErrorThrottledException(response, errorBody) @@ -4148,7 +4689,7 @@ func awsRestjson1_deserializeOpErrorPutTraceSegments(response *smithyhttp.Respon } } -func awsRestjson1_deserializeOpDocumentPutTraceSegmentsOutput(v **PutTraceSegmentsOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentPutResourcePolicyOutput(v **PutResourcePolicyOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4161,17 +4702,17 @@ func awsRestjson1_deserializeOpDocumentPutTraceSegmentsOutput(v **PutTraceSegmen return fmt.Errorf("unexpected JSON type %v", value) } - var sv *PutTraceSegmentsOutput + var sv *PutResourcePolicyOutput if *v == nil { - sv = &PutTraceSegmentsOutput{} + sv = &PutResourcePolicyOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "UnprocessedTraceSegments": - if err := awsRestjson1_deserializeDocumentUnprocessedTraceSegmentList(&sv.UnprocessedTraceSegments, value); err != nil { + case "ResourcePolicy": + if err := awsRestjson1_deserializeDocumentResourcePolicy(&sv.ResourcePolicy, value); err != nil { return err } @@ -4184,14 +4725,14 @@ func awsRestjson1_deserializeOpDocumentPutTraceSegmentsOutput(v **PutTraceSegmen return nil } -type awsRestjson1_deserializeOpTagResource struct { +type awsRestjson1_deserializeOpPutTelemetryRecords struct { } -func (*awsRestjson1_deserializeOpTagResource) ID() string { +func (*awsRestjson1_deserializeOpPutTelemetryRecords) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpTagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpPutTelemetryRecords) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4209,16 +4750,521 @@ 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_deserializeOpErrorPutTelemetryRecords(response, &metadata) } - output := &TagResourceOutput{} + output := &PutTelemetryRecordsOutput{} + out.Result = output + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutTelemetryRecords(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpPutTraceSegments struct { +} + +func (*awsRestjson1_deserializeOpPutTraceSegments) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpPutTraceSegments) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorPutTraceSegments(response, &metadata) + } + output := &PutTraceSegmentsOutput{} + 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_deserializeOpDocumentPutTraceSegmentsOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorPutTraceSegments(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentPutTraceSegmentsOutput(v **PutTraceSegmentsOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *PutTraceSegmentsOutput + if *v == nil { + sv = &PutTraceSegmentsOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "UnprocessedTraceSegments": + if err := awsRestjson1_deserializeDocumentUnprocessedTraceSegmentList(&sv.UnprocessedTraceSegments, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +type awsRestjson1_deserializeOpStartTraceRetrieval struct { +} + +func (*awsRestjson1_deserializeOpStartTraceRetrieval) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpStartTraceRetrieval) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorStartTraceRetrieval(response, &metadata) + } + output := &StartTraceRetrievalOutput{} + 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_deserializeOpDocumentStartTraceRetrievalOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorStartTraceRetrieval(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +func awsRestjson1_deserializeOpDocumentStartTraceRetrievalOutput(v **StartTraceRetrievalOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *StartTraceRetrievalOutput + if *v == nil { + sv = &StartTraceRetrievalOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "RetrievalToken": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected RetrievalToken to be of type string, got %T instead", value) + } + sv.RetrievalToken = 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 + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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 + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ResourceNotFoundException", errorCode): + return awsRestjson1_deserializeErrorResourceNotFoundException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) + + case strings.EqualFold("TooManyTagsException", errorCode): + return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUntagResource struct { +} + +func (*awsRestjson1_deserializeOpUntagResource) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + return out, metadata, &smithy.DeserializationError{Err: fmt.Errorf("unknown transport type %T", out.RawResponse)} + } + + if response.StatusCode < 200 || response.StatusCode >= 300 { + return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + } + output := &UntagResourceOutput{} out.Result = output span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4268,8 +5314,124 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m case strings.EqualFold("ThrottledException", errorCode): return awsRestjson1_deserializeErrorThrottledException(response, errorBody) - case strings.EqualFold("TooManyTagsException", errorCode): - return awsRestjson1_deserializeErrorTooManyTagsException(response, errorBody) + default: + genericError := &smithy.GenericAPIError{ + Code: errorCode, + Message: errorMessage, + } + return genericError + + } +} + +type awsRestjson1_deserializeOpUpdateGroup struct { +} + +func (*awsRestjson1_deserializeOpUpdateGroup) ID() string { + return "OperationDeserializer" +} + +func (m *awsRestjson1_deserializeOpUpdateGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( + out middleware.DeserializeOutput, metadata middleware.Metadata, err error, +) { + out, metadata, err = next.HandleDeserialize(ctx, in) + if err != nil { + return out, metadata, err + } + + _, span := tracing.StartSpan(ctx, "OperationDeserializer") + endTimer := startMetricTimer(ctx, "client.call.deserialization_duration") + defer endTimer() + defer span.End() + response, ok := out.RawResponse.(*smithyhttp.Response) + if !ok { + 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_deserializeOpErrorUpdateGroup(response, &metadata) + } + output := &UpdateGroupOutput{} + 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_deserializeOpDocumentUpdateGroupOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + + span.End() + return out, metadata, err +} + +func awsRestjson1_deserializeOpErrorUpdateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { + var errorBuffer bytes.Buffer + if _, err := io.Copy(&errorBuffer, response.Body); err != nil { + return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} + } + errorBody := bytes.NewReader(errorBuffer.Bytes()) + + errorCode := "UnknownError" + errorMessage := errorCode + + headerCode := response.Header.Get("X-Amzn-ErrorType") + if len(headerCode) != 0 { + errorCode = restjson.SanitizeErrorCode(headerCode) + } + + var buff [1024]byte + ringBuffer := smithyio.NewRingBuffer(buff[:]) + + body := io.TeeReader(errorBody, ringBuffer) + decoder := json.NewDecoder(body) + decoder.UseNumber() + jsonCode, message, err := restjson.GetErrorInfo(decoder) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + err = &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body, %w", err), + Snapshot: snapshot.Bytes(), + } + return err + } + + errorBody.Seek(0, io.SeekStart) + if len(headerCode) == 0 && len(jsonCode) != 0 { + errorCode = restjson.SanitizeErrorCode(jsonCode) + } + if len(message) != 0 { + errorMessage = message + } + + switch { + case strings.EqualFold("InvalidRequestException", errorCode): + return awsRestjson1_deserializeErrorInvalidRequestException(response, errorBody) + + case strings.EqualFold("ThrottledException", errorCode): + return awsRestjson1_deserializeErrorThrottledException(response, errorBody) default: genericError := &smithy.GenericAPIError{ @@ -4281,14 +5443,50 @@ func awsRestjson1_deserializeOpErrorTagResource(response *smithyhttp.Response, m } } -type awsRestjson1_deserializeOpUntagResource struct { +func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateGroupOutput + if *v == nil { + sv = &UpdateGroupOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Group": + if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUntagResource) ID() string { +type awsRestjson1_deserializeOpUpdateIndexingRule struct { +} + +func (*awsRestjson1_deserializeOpUpdateIndexingRule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateIndexingRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4306,16 +5504,44 @@ func (m *awsRestjson1_deserializeOpUntagResource) HandleDeserialize(ctx context. } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUntagResource(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateIndexingRule(response, &metadata) } - output := &UntagResourceOutput{} + output := &UpdateIndexingRuleOutput{} 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_deserializeOpDocumentUpdateIndexingRuleOutput(&output, shape) + if err != nil { + var snapshot bytes.Buffer + io.Copy(&snapshot, ringBuffer) + return out, metadata, &smithy.DeserializationError{ + Err: fmt.Errorf("failed to decode response body with invalid JSON, %w", err), + Snapshot: snapshot.Bytes(), + } + } + span.End() return out, metadata, err } -func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateIndexingRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4375,14 +5601,50 @@ func awsRestjson1_deserializeOpErrorUntagResource(response *smithyhttp.Response, } } -type awsRestjson1_deserializeOpUpdateGroup struct { +func awsRestjson1_deserializeOpDocumentUpdateIndexingRuleOutput(v **UpdateIndexingRuleOutput, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", v) + } + if value == nil { + return nil + } + + shape, ok := value.(map[string]interface{}) + if !ok { + return fmt.Errorf("unexpected JSON type %v", value) + } + + var sv *UpdateIndexingRuleOutput + if *v == nil { + sv = &UpdateIndexingRuleOutput{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "IndexingRule": + if err := awsRestjson1_deserializeDocumentIndexingRule(&sv.IndexingRule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil } -func (*awsRestjson1_deserializeOpUpdateGroup) ID() string { +type awsRestjson1_deserializeOpUpdateSamplingRule struct { +} + +func (*awsRestjson1_deserializeOpUpdateSamplingRule) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateGroup) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateSamplingRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4400,9 +5662,9 @@ func (m *awsRestjson1_deserializeOpUpdateGroup) HandleDeserialize(ctx context.Co } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateGroup(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateSamplingRule(response, &metadata) } - output := &UpdateGroupOutput{} + output := &UpdateSamplingRuleOutput{} out.Result = output var buff [1024]byte @@ -4423,7 +5685,7 @@ func (m *awsRestjson1_deserializeOpUpdateGroup) HandleDeserialize(ctx context.Co return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateGroupOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateSamplingRuleOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4437,7 +5699,7 @@ func (m *awsRestjson1_deserializeOpUpdateGroup) HandleDeserialize(ctx context.Co return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateGroup(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateSamplingRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4494,7 +5756,7 @@ func awsRestjson1_deserializeOpErrorUpdateGroup(response *smithyhttp.Response, m } } -func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateSamplingRuleOutput(v **UpdateSamplingRuleOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4507,17 +5769,17 @@ func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateGroupOutput + var sv *UpdateSamplingRuleOutput if *v == nil { - sv = &UpdateGroupOutput{} + sv = &UpdateSamplingRuleOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "Group": - if err := awsRestjson1_deserializeDocumentGroup(&sv.Group, value); err != nil { + case "SamplingRuleRecord": + if err := awsRestjson1_deserializeDocumentSamplingRuleRecord(&sv.SamplingRuleRecord, value); err != nil { return err } @@ -4530,14 +5792,14 @@ func awsRestjson1_deserializeOpDocumentUpdateGroupOutput(v **UpdateGroupOutput, return nil } -type awsRestjson1_deserializeOpUpdateSamplingRule struct { +type awsRestjson1_deserializeOpUpdateTraceSegmentDestination struct { } -func (*awsRestjson1_deserializeOpUpdateSamplingRule) ID() string { +func (*awsRestjson1_deserializeOpUpdateTraceSegmentDestination) ID() string { return "OperationDeserializer" } -func (m *awsRestjson1_deserializeOpUpdateSamplingRule) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( +func (m *awsRestjson1_deserializeOpUpdateTraceSegmentDestination) HandleDeserialize(ctx context.Context, in middleware.DeserializeInput, next middleware.DeserializeHandler) ( out middleware.DeserializeOutput, metadata middleware.Metadata, err error, ) { out, metadata, err = next.HandleDeserialize(ctx, in) @@ -4555,9 +5817,9 @@ func (m *awsRestjson1_deserializeOpUpdateSamplingRule) HandleDeserialize(ctx con } if response.StatusCode < 200 || response.StatusCode >= 300 { - return out, metadata, awsRestjson1_deserializeOpErrorUpdateSamplingRule(response, &metadata) + return out, metadata, awsRestjson1_deserializeOpErrorUpdateTraceSegmentDestination(response, &metadata) } - output := &UpdateSamplingRuleOutput{} + output := &UpdateTraceSegmentDestinationOutput{} out.Result = output var buff [1024]byte @@ -4578,7 +5840,7 @@ func (m *awsRestjson1_deserializeOpUpdateSamplingRule) HandleDeserialize(ctx con return out, metadata, err } - err = awsRestjson1_deserializeOpDocumentUpdateSamplingRuleOutput(&output, shape) + err = awsRestjson1_deserializeOpDocumentUpdateTraceSegmentDestinationOutput(&output, shape) if err != nil { var snapshot bytes.Buffer io.Copy(&snapshot, ringBuffer) @@ -4592,7 +5854,7 @@ func (m *awsRestjson1_deserializeOpUpdateSamplingRule) HandleDeserialize(ctx con return out, metadata, err } -func awsRestjson1_deserializeOpErrorUpdateSamplingRule(response *smithyhttp.Response, metadata *middleware.Metadata) error { +func awsRestjson1_deserializeOpErrorUpdateTraceSegmentDestination(response *smithyhttp.Response, metadata *middleware.Metadata) error { var errorBuffer bytes.Buffer if _, err := io.Copy(&errorBuffer, response.Body); err != nil { return &smithy.DeserializationError{Err: fmt.Errorf("failed to copy error response body, %w", err)} @@ -4649,7 +5911,7 @@ func awsRestjson1_deserializeOpErrorUpdateSamplingRule(response *smithyhttp.Resp } } -func awsRestjson1_deserializeOpDocumentUpdateSamplingRuleOutput(v **UpdateSamplingRuleOutput, value interface{}) error { +func awsRestjson1_deserializeOpDocumentUpdateTraceSegmentDestinationOutput(v **UpdateTraceSegmentDestinationOutput, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -4662,18 +5924,31 @@ func awsRestjson1_deserializeOpDocumentUpdateSamplingRuleOutput(v **UpdateSampli return fmt.Errorf("unexpected JSON type %v", value) } - var sv *UpdateSamplingRuleOutput + var sv *UpdateTraceSegmentDestinationOutput if *v == nil { - sv = &UpdateSamplingRuleOutput{} + sv = &UpdateTraceSegmentDestinationOutput{} } else { sv = *v } for key, value := range shape { switch key { - case "SamplingRuleRecord": - if err := awsRestjson1_deserializeDocumentSamplingRuleRecord(&sv.SamplingRuleRecord, value); err != nil { - return err + case "Destination": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TraceSegmentDestination to be of type string, got %T instead", value) + } + sv.Destination = types.TraceSegmentDestination(jtv) + } + + case "Status": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected TraceSegmentDestinationStatus to be of type string, got %T instead", value) + } + sv.Status = types.TraceSegmentDestinationStatus(jtv) } default: @@ -6478,6 +7753,60 @@ func awsRestjson1_deserializeDocumentForecastStatistics(v **types.ForecastStatis return nil } +func awsRestjson1_deserializeDocumentGraphLink(v **types.GraphLink, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.GraphLink + if *v == nil { + sv = &types.GraphLink{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "DestinationTraceIds": + if err := awsRestjson1_deserializeDocumentTraceIdList(&sv.DestinationTraceIds, value); err != nil { + return err + } + + case "ReferenceType": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.ReferenceType = ptr.String(jtv) + } + + case "SourceTraceId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.SourceTraceId = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + func awsRestjson1_deserializeDocumentGroup(v **types.Group, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -6830,6 +8159,141 @@ func awsRestjson1_deserializeDocumentHttp(v **types.Http, value interface{}) err return nil } +func awsRestjson1_deserializeDocumentIndexingRule(v **types.IndexingRule, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.IndexingRule + if *v == nil { + sv = &types.IndexingRule{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "ModifiedAt": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ModifiedAt = 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 RuleName to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Rule": + if err := awsRestjson1_deserializeDocumentIndexingRuleValue(&sv.Rule, value); err != nil { + return err + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentIndexingRuleList(v *[]types.IndexingRule, 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.IndexingRule + if *v == nil { + cv = []types.IndexingRule{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.IndexingRule + destAddr := &col + if err := awsRestjson1_deserializeDocumentIndexingRule(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentIndexingRuleValue(v *types.IndexingRuleValue, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %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.IndexingRuleValue +loop: + for key, value := range shape { + if value == nil { + continue + } + switch key { + case "Probabilistic": + var mv types.ProbabilisticRuleValue + destAddr := &mv + if err := awsRestjson1_deserializeDocumentProbabilisticRuleValue(&destAddr, value); err != nil { + return err + } + mv = *destAddr + uv = &types.IndexingRuleValueMemberProbabilistic{Value: mv} + break loop + + default: + uv = &types.UnknownUnionMember{Tag: key} + break loop + + } + } + *v = uv + return nil +} + func awsRestjson1_deserializeDocumentInsight(v **types.Insight, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7649,6 +9113,40 @@ func awsRestjson1_deserializeDocumentInvalidRequestException(v **types.InvalidRe return nil } +func awsRestjson1_deserializeDocumentLinksList(v *[]types.GraphLink, 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.GraphLink + if *v == nil { + cv = []types.GraphLink{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.GraphLink + destAddr := &col + if err := awsRestjson1_deserializeDocumentGraphLink(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentLockoutPreventionException(v **types.LockoutPreventionException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -7704,7 +9202,47 @@ func awsRestjson1_deserializeDocumentMalformedPolicyDocumentException(v **types. var sv *types.MalformedPolicyDocumentException if *v == nil { - sv = &types.MalformedPolicyDocumentException{} + sv = &types.MalformedPolicyDocumentException{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "message", "Message": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + } + sv.Message = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentPolicyCountLimitExceededException(v **types.PolicyCountLimitExceededException, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.PolicyCountLimitExceededException + if *v == nil { + sv = &types.PolicyCountLimitExceededException{} } else { sv = *v } @@ -7729,7 +9267,7 @@ func awsRestjson1_deserializeDocumentMalformedPolicyDocumentException(v **types. return nil } -func awsRestjson1_deserializeDocumentPolicyCountLimitExceededException(v **types.PolicyCountLimitExceededException, value interface{}) error { +func awsRestjson1_deserializeDocumentPolicySizeLimitExceededException(v **types.PolicySizeLimitExceededException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7742,9 +9280,9 @@ func awsRestjson1_deserializeDocumentPolicyCountLimitExceededException(v **types return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PolicyCountLimitExceededException + var sv *types.PolicySizeLimitExceededException if *v == nil { - sv = &types.PolicyCountLimitExceededException{} + sv = &types.PolicySizeLimitExceededException{} } else { sv = *v } @@ -7769,7 +9307,7 @@ func awsRestjson1_deserializeDocumentPolicyCountLimitExceededException(v **types return nil } -func awsRestjson1_deserializeDocumentPolicySizeLimitExceededException(v **types.PolicySizeLimitExceededException, value interface{}) error { +func awsRestjson1_deserializeDocumentProbabilisticRuleValue(v **types.ProbabilisticRuleValue, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -7782,22 +9320,81 @@ func awsRestjson1_deserializeDocumentPolicySizeLimitExceededException(v **types. return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.PolicySizeLimitExceededException + var sv *types.ProbabilisticRuleValue if *v == nil { - sv = &types.PolicySizeLimitExceededException{} + sv = &types.ProbabilisticRuleValue{} } else { sv = *v } for key, value := range shape { switch key { - case "message", "Message": + case "ActualSamplingPercentage": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected ErrorMessage to be of type string, got %T instead", value) + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.ActualSamplingPercentage = 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.ActualSamplingPercentage = ptr.Float64(f64) + + default: + return fmt.Errorf("expected NullableDouble to be a JSON Number, got %T instead", value) + + } + } + + case "DesiredSamplingPercentage": + if value != nil { + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.DesiredSamplingPercentage = 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.DesiredSamplingPercentage = ptr.Float64(f64) + + default: + return fmt.Errorf("expected NullableDouble to be a JSON Number, got %T instead", value) + } - sv.Message = ptr.String(jtv) } default: @@ -8224,21 +9821,207 @@ func awsRestjson1_deserializeDocumentResponseTimeRootCauseEntityPath(v *[]types. cv = *v } - for _, value := range shape { - var col types.ResponseTimeRootCauseEntity - destAddr := &col - if err := awsRestjson1_deserializeDocumentResponseTimeRootCauseEntity(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) + for _, value := range shape { + var col types.ResponseTimeRootCauseEntity + destAddr := &col + if err := awsRestjson1_deserializeDocumentResponseTimeRootCauseEntity(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentResponseTimeRootCauses(v *[]types.ResponseTimeRootCause, 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.ResponseTimeRootCause + if *v == nil { + cv = []types.ResponseTimeRootCause{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResponseTimeRootCause + destAddr := &col + if err := awsRestjson1_deserializeDocumentResponseTimeRootCause(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentResponseTimeRootCauseService(v **types.ResponseTimeRootCauseService, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.ResponseTimeRootCauseService + if *v == nil { + sv = &types.ResponseTimeRootCauseService{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "AccountId": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.AccountId = ptr.String(jtv) + } + + case "EntityPath": + if err := awsRestjson1_deserializeDocumentResponseTimeRootCauseEntityPath(&sv.EntityPath, value); err != nil { + return err + } + + case "Inferred": + if value != nil { + jtv, ok := value.(bool) + if !ok { + return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) + } + sv.Inferred = ptr.Bool(jtv) + } + + case "Name": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Name = ptr.String(jtv) + } + + case "Names": + if err := awsRestjson1_deserializeDocumentServiceNames(&sv.Names, value); err != nil { + return err + } + + case "Type": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected String to be of type string, got %T instead", value) + } + sv.Type = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentResponseTimeRootCauseServices(v *[]types.ResponseTimeRootCauseService, 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.ResponseTimeRootCauseService + if *v == nil { + cv = []types.ResponseTimeRootCauseService{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.ResponseTimeRootCauseService + destAddr := &col + if err := awsRestjson1_deserializeDocumentResponseTimeRootCauseService(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + +func awsRestjson1_deserializeDocumentRetrievedService(v **types.RetrievedService, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.RetrievedService + if *v == nil { + sv = &types.RetrievedService{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Links": + if err := awsRestjson1_deserializeDocumentLinksList(&sv.Links, value); err != nil { + return err + } + + case "Service": + if err := awsRestjson1_deserializeDocumentService(&sv.Service, value); err != nil { + return err + } + + default: + _, _ = key, value + } } - *v = cv + *v = sv return nil } -func awsRestjson1_deserializeDocumentResponseTimeRootCauses(v *[]types.ResponseTimeRootCause, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievedServicesList(v *[]types.RetrievedService, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8251,17 +10034,17 @@ func awsRestjson1_deserializeDocumentResponseTimeRootCauses(v *[]types.ResponseT return fmt.Errorf("unexpected JSON type %v", value) } - var cv []types.ResponseTimeRootCause + var cv []types.RetrievedService if *v == nil { - cv = []types.ResponseTimeRootCause{} + cv = []types.RetrievedService{} } else { cv = *v } for _, value := range shape { - var col types.ResponseTimeRootCause + var col types.RetrievedService destAddr := &col - if err := awsRestjson1_deserializeDocumentResponseTimeRootCause(&destAddr, value); err != nil { + if err := awsRestjson1_deserializeDocumentRetrievedService(&destAddr, value); err != nil { return err } col = *destAddr @@ -8272,7 +10055,7 @@ func awsRestjson1_deserializeDocumentResponseTimeRootCauses(v *[]types.ResponseT return nil } -func awsRestjson1_deserializeDocumentResponseTimeRootCauseService(v **types.ResponseTimeRootCauseService, value interface{}) error { +func awsRestjson1_deserializeDocumentRetrievedTrace(v **types.RetrievedTrace, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) } @@ -8285,61 +10068,63 @@ func awsRestjson1_deserializeDocumentResponseTimeRootCauseService(v **types.Resp return fmt.Errorf("unexpected JSON type %v", value) } - var sv *types.ResponseTimeRootCauseService + var sv *types.RetrievedTrace if *v == nil { - sv = &types.ResponseTimeRootCauseService{} + sv = &types.RetrievedTrace{} } else { sv = *v } for key, value := range shape { switch key { - case "AccountId": + case "Duration": if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.AccountId = ptr.String(jtv) - } + switch jtv := value.(type) { + case json.Number: + f64, err := jtv.Float64() + if err != nil { + return err + } + sv.Duration = ptr.Float64(f64) - case "EntityPath": - if err := awsRestjson1_deserializeDocumentResponseTimeRootCauseEntityPath(&sv.EntityPath, value); err != nil { - return err - } + 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.Duration = ptr.Float64(f64) + + default: + return fmt.Errorf("expected NullableDouble to be a JSON Number, got %T instead", value) - case "Inferred": - if value != nil { - jtv, ok := value.(bool) - if !ok { - return fmt.Errorf("expected NullableBoolean to be of type *bool, got %T instead", value) } - sv.Inferred = ptr.Bool(jtv) } - case "Name": + case "Id": if value != nil { jtv, ok := value.(string) if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) + return fmt.Errorf("expected TraceId to be of type string, got %T instead", value) } - sv.Name = ptr.String(jtv) + sv.Id = ptr.String(jtv) } - case "Names": - if err := awsRestjson1_deserializeDocumentServiceNames(&sv.Names, value); err != nil { + case "Spans": + if err := awsRestjson1_deserializeDocumentSpanList(&sv.Spans, value); err != nil { return err } - case "Type": - if value != nil { - jtv, ok := value.(string) - if !ok { - return fmt.Errorf("expected String to be of type string, got %T instead", value) - } - sv.Type = ptr.String(jtv) - } - default: _, _ = key, value @@ -8349,40 +10134,6 @@ func awsRestjson1_deserializeDocumentResponseTimeRootCauseService(v **types.Resp return nil } -func awsRestjson1_deserializeDocumentResponseTimeRootCauseServices(v *[]types.ResponseTimeRootCauseService, 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.ResponseTimeRootCauseService - if *v == nil { - cv = []types.ResponseTimeRootCauseService{} - } else { - cv = *v - } - - for _, value := range shape { - var col types.ResponseTimeRootCauseService - destAddr := &col - if err := awsRestjson1_deserializeDocumentResponseTimeRootCauseService(&destAddr, value); err != nil { - return err - } - col = *destAddr - cv = append(cv, col) - - } - *v = cv - return nil -} - func awsRestjson1_deserializeDocumentRootCauseException(v **types.RootCauseException, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9565,6 +11316,89 @@ func awsRestjson1_deserializeDocumentServiceStatistics(v **types.ServiceStatisti return nil } +func awsRestjson1_deserializeDocumentSpan(v **types.Span, value interface{}) error { + if v == nil { + return fmt.Errorf("unexpected nil of type %T", 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.Span + if *v == nil { + sv = &types.Span{} + } else { + sv = *v + } + + for key, value := range shape { + switch key { + case "Document": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpanDocument to be of type string, got %T instead", value) + } + sv.Document = ptr.String(jtv) + } + + case "Id": + if value != nil { + jtv, ok := value.(string) + if !ok { + return fmt.Errorf("expected SpanId to be of type string, got %T instead", value) + } + sv.Id = ptr.String(jtv) + } + + default: + _, _ = key, value + + } + } + *v = sv + return nil +} + +func awsRestjson1_deserializeDocumentSpanList(v *[]types.Span, 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.Span + if *v == nil { + cv = []types.Span{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.Span + destAddr := &col + if err := awsRestjson1_deserializeDocumentSpan(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTag(v **types.Tag, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -9960,6 +11794,42 @@ func awsRestjson1_deserializeDocumentTraceAvailabilityZones(v *[]types.Availabil return nil } +func awsRestjson1_deserializeDocumentTraceIdList(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 TraceId to be of type string, got %T instead", value) + } + col = jtv + } + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTraceInstanceIds(v *[]types.InstanceIdDetail, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) @@ -10062,6 +11932,40 @@ func awsRestjson1_deserializeDocumentTraceResourceARNs(v *[]types.ResourceARNDet return nil } +func awsRestjson1_deserializeDocumentTraceSpanList(v *[]types.RetrievedTrace, 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.RetrievedTrace + if *v == nil { + cv = []types.RetrievedTrace{} + } else { + cv = *v + } + + for _, value := range shape { + var col types.RetrievedTrace + destAddr := &col + if err := awsRestjson1_deserializeDocumentRetrievedTrace(&destAddr, value); err != nil { + return err + } + col = *destAddr + cv = append(cv, col) + + } + *v = cv + return nil +} + func awsRestjson1_deserializeDocumentTraceSummary(v **types.TraceSummary, value interface{}) error { if v == nil { return fmt.Errorf("unexpected nil of type %T", v) diff --git a/service/xray/generated.json b/service/xray/generated.json index 04faa84a1f8..242d5d3dd84 100644 --- a/service/xray/generated.json +++ b/service/xray/generated.json @@ -9,6 +9,7 @@ "api_client.go", "api_client_test.go", "api_op_BatchGetTraces.go", + "api_op_CancelTraceRetrieval.go", "api_op_CreateGroup.go", "api_op_CreateSamplingRule.go", "api_op_DeleteGroup.go", @@ -17,27 +18,34 @@ "api_op_GetEncryptionConfig.go", "api_op_GetGroup.go", "api_op_GetGroups.go", + "api_op_GetIndexingRules.go", "api_op_GetInsight.go", "api_op_GetInsightEvents.go", "api_op_GetInsightImpactGraph.go", "api_op_GetInsightSummaries.go", + "api_op_GetRetrievedTracesGraph.go", "api_op_GetSamplingRules.go", "api_op_GetSamplingStatisticSummaries.go", "api_op_GetSamplingTargets.go", "api_op_GetServiceGraph.go", "api_op_GetTimeSeriesServiceStatistics.go", "api_op_GetTraceGraph.go", + "api_op_GetTraceSegmentDestination.go", "api_op_GetTraceSummaries.go", "api_op_ListResourcePolicies.go", + "api_op_ListRetrievedTraces.go", "api_op_ListTagsForResource.go", "api_op_PutEncryptionConfig.go", "api_op_PutResourcePolicy.go", "api_op_PutTelemetryRecords.go", "api_op_PutTraceSegments.go", + "api_op_StartTraceRetrieval.go", "api_op_TagResource.go", "api_op_UntagResource.go", "api_op_UpdateGroup.go", + "api_op_UpdateIndexingRule.go", "api_op_UpdateSamplingRule.go", + "api_op_UpdateTraceSegmentDestination.go", "auth.go", "deserializers.go", "doc.go", diff --git a/service/xray/serializers.go b/service/xray/serializers.go index c907f4f550f..e9ab7302778 100644 --- a/service/xray/serializers.go +++ b/service/xray/serializers.go @@ -105,6 +105,87 @@ func awsRestjson1_serializeOpDocumentBatchGetTracesInput(v *BatchGetTracesInput, return nil } +type awsRestjson1_serializeOpCancelTraceRetrieval struct { +} + +func (*awsRestjson1_serializeOpCancelTraceRetrieval) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpCancelTraceRetrieval) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*CancelTraceRetrievalInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/CancelTraceRetrieval") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentCancelTraceRetrievalInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsCancelTraceRetrievalInput(v *CancelTraceRetrievalInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentCancelTraceRetrievalInput(v *CancelTraceRetrievalInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.RetrievalToken != nil { + ok := object.Key("RetrievalToken") + ok.String(*v.RetrievalToken) + } + + return nil +} + type awsRestjson1_serializeOpCreateGroup struct { } @@ -778,6 +859,87 @@ func awsRestjson1_serializeOpDocumentGetGroupsInput(v *GetGroupsInput, value smi return nil } +type awsRestjson1_serializeOpGetIndexingRules struct { +} + +func (*awsRestjson1_serializeOpGetIndexingRules) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetIndexingRules) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetIndexingRulesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetIndexingRules") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetIndexingRulesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetIndexingRulesInput(v *GetIndexingRulesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetIndexingRulesInput(v *GetIndexingRulesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + return nil +} + type awsRestjson1_serializeOpGetInsight struct { } @@ -1159,6 +1321,92 @@ func awsRestjson1_serializeOpDocumentGetInsightSummariesInput(v *GetInsightSumma return nil } +type awsRestjson1_serializeOpGetRetrievedTracesGraph struct { +} + +func (*awsRestjson1_serializeOpGetRetrievedTracesGraph) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpGetRetrievedTracesGraph) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetRetrievedTracesGraphInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/GetRetrievedTracesGraph") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetRetrievedTracesGraphInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetRetrievedTracesGraphInput(v *GetRetrievedTracesGraphInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetRetrievedTracesGraphInput(v *GetRetrievedTracesGraphInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.RetrievalToken != nil { + ok := object.Key("RetrievalToken") + ok.String(*v.RetrievalToken) + } + + return nil +} + type awsRestjson1_serializeOpGetSamplingRules struct { } @@ -1709,14 +1957,14 @@ func awsRestjson1_serializeOpDocumentGetTraceGraphInput(v *GetTraceGraphInput, v return nil } -type awsRestjson1_serializeOpGetTraceSummaries struct { +type awsRestjson1_serializeOpGetTraceSegmentDestination struct { } -func (*awsRestjson1_serializeOpGetTraceSummaries) ID() string { +func (*awsRestjson1_serializeOpGetTraceSegmentDestination) ID() string { return "OperationSerializer" } -func (m *awsRestjson1_serializeOpGetTraceSummaries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( +func (m *awsRestjson1_serializeOpGetTraceSegmentDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( out middleware.SerializeOutput, metadata middleware.Metadata, err error, ) { _, span := tracing.StartSpan(ctx, "OperationSerializer") @@ -1728,13 +1976,13 @@ func (m *awsRestjson1_serializeOpGetTraceSummaries) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} } - input, ok := in.Parameters.(*GetTraceSummariesInput) + input, ok := in.Parameters.(*GetTraceSegmentDestinationInput) _ = input if !ok { return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} } - opPath, opQuery := httpbinding.SplitURI("/TraceSummaries") + opPath, opQuery := httpbinding.SplitURI("/GetTraceSegmentDestination") request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) request.Method = "POST" @@ -1750,17 +1998,6 @@ func (m *awsRestjson1_serializeOpGetTraceSummaries) HandleSerialize(ctx context. return out, metadata, &smithy.SerializationError{Err: err} } - restEncoder.SetHeader("Content-Type").String("application/json") - - jsonEncoder := smithyjson.NewEncoder() - if err := awsRestjson1_serializeOpDocumentGetTraceSummariesInput(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} } @@ -1770,7 +2007,7 @@ func (m *awsRestjson1_serializeOpGetTraceSummaries) HandleSerialize(ctx context. span.End() return next.HandleSerialize(ctx, in) } -func awsRestjson1_serializeOpHttpBindingsGetTraceSummariesInput(v *GetTraceSummariesInput, encoder *httpbinding.Encoder) error { +func awsRestjson1_serializeOpHttpBindingsGetTraceSegmentDestinationInput(v *GetTraceSegmentDestinationInput, encoder *httpbinding.Encoder) error { if v == nil { return fmt.Errorf("unsupported serialization of nil %T", v) } @@ -1778,24 +2015,93 @@ func awsRestjson1_serializeOpHttpBindingsGetTraceSummariesInput(v *GetTraceSumma return nil } -func awsRestjson1_serializeOpDocumentGetTraceSummariesInput(v *GetTraceSummariesInput, value smithyjson.Value) error { - object := value.Object() - defer object.Close() - - if v.EndTime != nil { - ok := object.Key("EndTime") - ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) - } +type awsRestjson1_serializeOpGetTraceSummaries struct { +} - if v.FilterExpression != nil { - ok := object.Key("FilterExpression") - ok.String(*v.FilterExpression) - } +func (*awsRestjson1_serializeOpGetTraceSummaries) ID() string { + return "OperationSerializer" +} - if v.NextToken != nil { - ok := object.Key("NextToken") - ok.String(*v.NextToken) - } +func (m *awsRestjson1_serializeOpGetTraceSummaries) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*GetTraceSummariesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/TraceSummaries") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentGetTraceSummariesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsGetTraceSummariesInput(v *GetTraceSummariesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentGetTraceSummariesInput(v *GetTraceSummariesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("EndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) + } + + if v.FilterExpression != nil { + ok := object.Key("FilterExpression") + ok.String(*v.FilterExpression) + } + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } if v.Sampling != nil { ok := object.Key("Sampling") @@ -1903,6 +2209,97 @@ func awsRestjson1_serializeOpDocumentListResourcePoliciesInput(v *ListResourcePo return nil } +type awsRestjson1_serializeOpListRetrievedTraces struct { +} + +func (*awsRestjson1_serializeOpListRetrievedTraces) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpListRetrievedTraces) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*ListRetrievedTracesInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/ListRetrievedTraces") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentListRetrievedTracesInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsListRetrievedTracesInput(v *ListRetrievedTracesInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentListRetrievedTracesInput(v *ListRetrievedTracesInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.NextToken != nil { + ok := object.Key("NextToken") + ok.String(*v.NextToken) + } + + if v.RetrievalToken != nil { + ok := object.Key("RetrievalToken") + ok.String(*v.RetrievalToken) + } + + if len(v.TraceFormat) > 0 { + ok := object.Key("TraceFormat") + ok.String(string(v.TraceFormat)) + } + + return nil +} + type awsRestjson1_serializeOpListTagsForResource struct { } @@ -2352,6 +2749,99 @@ func awsRestjson1_serializeOpDocumentPutTraceSegmentsInput(v *PutTraceSegmentsIn return nil } +type awsRestjson1_serializeOpStartTraceRetrieval struct { +} + +func (*awsRestjson1_serializeOpStartTraceRetrieval) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpStartTraceRetrieval) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*StartTraceRetrievalInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/StartTraceRetrieval") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentStartTraceRetrievalInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsStartTraceRetrievalInput(v *StartTraceRetrievalInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentStartTraceRetrievalInput(v *StartTraceRetrievalInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.EndTime != nil { + ok := object.Key("EndTime") + ok.Double(smithytime.FormatEpochSeconds(*v.EndTime)) + } + + if v.StartTime != nil { + ok := object.Key("StartTime") + ok.Double(smithytime.FormatEpochSeconds(*v.StartTime)) + } + + if v.TraceIds != nil { + ok := object.Key("TraceIds") + if err := awsRestjson1_serializeDocumentTraceIdListForRetrieval(v.TraceIds, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpTagResource struct { } @@ -2626,6 +3116,94 @@ func awsRestjson1_serializeOpDocumentUpdateGroupInput(v *UpdateGroupInput, value return nil } +type awsRestjson1_serializeOpUpdateIndexingRule struct { +} + +func (*awsRestjson1_serializeOpUpdateIndexingRule) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateIndexingRule) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateIndexingRuleInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/UpdateIndexingRule") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateIndexingRuleInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateIndexingRuleInput(v *UpdateIndexingRuleInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateIndexingRuleInput(v *UpdateIndexingRuleInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.Name != nil { + ok := object.Key("Name") + ok.String(*v.Name) + } + + if v.Rule != nil { + ok := object.Key("Rule") + if err := awsRestjson1_serializeDocumentIndexingRuleValueUpdate(v.Rule, ok); err != nil { + return err + } + } + + return nil +} + type awsRestjson1_serializeOpUpdateSamplingRule struct { } @@ -2709,6 +3287,87 @@ func awsRestjson1_serializeOpDocumentUpdateSamplingRuleInput(v *UpdateSamplingRu return nil } +type awsRestjson1_serializeOpUpdateTraceSegmentDestination struct { +} + +func (*awsRestjson1_serializeOpUpdateTraceSegmentDestination) ID() string { + return "OperationSerializer" +} + +func (m *awsRestjson1_serializeOpUpdateTraceSegmentDestination) HandleSerialize(ctx context.Context, in middleware.SerializeInput, next middleware.SerializeHandler) ( + out middleware.SerializeOutput, metadata middleware.Metadata, err error, +) { + _, span := tracing.StartSpan(ctx, "OperationSerializer") + endTimer := startMetricTimer(ctx, "client.call.serialization_duration") + defer endTimer() + defer span.End() + request, ok := in.Request.(*smithyhttp.Request) + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown transport type %T", in.Request)} + } + + input, ok := in.Parameters.(*UpdateTraceSegmentDestinationInput) + _ = input + if !ok { + return out, metadata, &smithy.SerializationError{Err: fmt.Errorf("unknown input parameters type %T", in.Parameters)} + } + + opPath, opQuery := httpbinding.SplitURI("/UpdateTraceSegmentDestination") + request.URL.Path = smithyhttp.JoinPath(request.URL.Path, opPath) + request.URL.RawQuery = smithyhttp.JoinRawQuery(request.URL.RawQuery, opQuery) + request.Method = "POST" + var restEncoder *httpbinding.Encoder + if request.URL.RawPath == "" { + restEncoder, err = httpbinding.NewEncoder(request.URL.Path, request.URL.RawQuery, request.Header) + } else { + request.URL.RawPath = smithyhttp.JoinPath(request.URL.RawPath, opPath) + restEncoder, err = httpbinding.NewEncoderWithRawPath(request.URL.Path, request.URL.RawPath, request.URL.RawQuery, request.Header) + } + + if err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + restEncoder.SetHeader("Content-Type").String("application/json") + + jsonEncoder := smithyjson.NewEncoder() + if err := awsRestjson1_serializeOpDocumentUpdateTraceSegmentDestinationInput(input, jsonEncoder.Value); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request, err = request.SetStream(bytes.NewReader(jsonEncoder.Bytes())); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + + if request.Request, err = restEncoder.Encode(request.Request); err != nil { + return out, metadata, &smithy.SerializationError{Err: err} + } + in.Request = request + + endTimer() + span.End() + return next.HandleSerialize(ctx, in) +} +func awsRestjson1_serializeOpHttpBindingsUpdateTraceSegmentDestinationInput(v *UpdateTraceSegmentDestinationInput, encoder *httpbinding.Encoder) error { + if v == nil { + return fmt.Errorf("unsupported serialization of nil %T", v) + } + + return nil +} + +func awsRestjson1_serializeOpDocumentUpdateTraceSegmentDestinationInput(v *UpdateTraceSegmentDestinationInput, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if len(v.Destination) > 0 { + ok := object.Key("Destination") + ok.String(string(v.Destination)) + } + + return nil +} + func awsRestjson1_serializeDocumentAttributeMap(v map[string]string, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2757,6 +3416,24 @@ func awsRestjson1_serializeDocumentBackendConnectionErrors(v *types.BackendConne return nil } +func awsRestjson1_serializeDocumentIndexingRuleValueUpdate(v types.IndexingRuleValueUpdate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + switch uv := v.(type) { + case *types.IndexingRuleValueUpdateMemberProbabilistic: + av := object.Key("Probabilistic") + if err := awsRestjson1_serializeDocumentProbabilisticRuleValueUpdate(&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_serializeDocumentInsightsConfiguration(v *types.InsightsConfiguration, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -2785,6 +3462,31 @@ func awsRestjson1_serializeDocumentInsightStateList(v []types.InsightState, valu return nil } +func awsRestjson1_serializeDocumentProbabilisticRuleValueUpdate(v *types.ProbabilisticRuleValueUpdate, value smithyjson.Value) error { + object := value.Object() + defer object.Close() + + if v.DesiredSamplingPercentage != nil { + ok := object.Key("DesiredSamplingPercentage") + switch { + case math.IsNaN(*v.DesiredSamplingPercentage): + ok.String("NaN") + + case math.IsInf(*v.DesiredSamplingPercentage, 1): + ok.String("Infinity") + + case math.IsInf(*v.DesiredSamplingPercentage, -1): + ok.String("-Infinity") + + default: + ok.Double(*v.DesiredSamplingPercentage) + + } + } + + return nil +} + func awsRestjson1_serializeDocumentSamplingRule(v *types.SamplingRule, value smithyjson.Value) error { object := value.Object() defer object.Close() @@ -3138,6 +3840,17 @@ func awsRestjson1_serializeDocumentTraceIdList(v []string, value smithyjson.Valu return nil } +func awsRestjson1_serializeDocumentTraceIdListForRetrieval(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_serializeDocumentTraceSegmentDocumentList(v []string, value smithyjson.Value) error { array := value.Array() defer array.Close() diff --git a/service/xray/snapshot/api_op_CancelTraceRetrieval.go.snap b/service/xray/snapshot/api_op_CancelTraceRetrieval.go.snap new file mode 100644 index 00000000000..628fe95efe7 --- /dev/null +++ b/service/xray/snapshot/api_op_CancelTraceRetrieval.go.snap @@ -0,0 +1,41 @@ +CancelTraceRetrieval + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/xray/snapshot/api_op_GetIndexingRules.go.snap b/service/xray/snapshot/api_op_GetIndexingRules.go.snap new file mode 100644 index 00000000000..90f370f8441 --- /dev/null +++ b/service/xray/snapshot/api_op_GetIndexingRules.go.snap @@ -0,0 +1,40 @@ +GetIndexingRules + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/xray/snapshot/api_op_GetRetrievedTracesGraph.go.snap b/service/xray/snapshot/api_op_GetRetrievedTracesGraph.go.snap new file mode 100644 index 00000000000..0f1487bf006 --- /dev/null +++ b/service/xray/snapshot/api_op_GetRetrievedTracesGraph.go.snap @@ -0,0 +1,41 @@ +GetRetrievedTracesGraph + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/xray/snapshot/api_op_GetTraceSegmentDestination.go.snap b/service/xray/snapshot/api_op_GetTraceSegmentDestination.go.snap new file mode 100644 index 00000000000..fd2c50e755f --- /dev/null +++ b/service/xray/snapshot/api_op_GetTraceSegmentDestination.go.snap @@ -0,0 +1,40 @@ +GetTraceSegmentDestination + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/xray/snapshot/api_op_ListRetrievedTraces.go.snap b/service/xray/snapshot/api_op_ListRetrievedTraces.go.snap new file mode 100644 index 00000000000..4e613661157 --- /dev/null +++ b/service/xray/snapshot/api_op_ListRetrievedTraces.go.snap @@ -0,0 +1,41 @@ +ListRetrievedTraces + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/xray/snapshot/api_op_StartTraceRetrieval.go.snap b/service/xray/snapshot/api_op_StartTraceRetrieval.go.snap new file mode 100644 index 00000000000..f233656b577 --- /dev/null +++ b/service/xray/snapshot/api_op_StartTraceRetrieval.go.snap @@ -0,0 +1,41 @@ +StartTraceRetrieval + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/xray/snapshot/api_op_UpdateIndexingRule.go.snap b/service/xray/snapshot/api_op_UpdateIndexingRule.go.snap new file mode 100644 index 00000000000..8f77c01e98e --- /dev/null +++ b/service/xray/snapshot/api_op_UpdateIndexingRule.go.snap @@ -0,0 +1,41 @@ +UpdateIndexingRule + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + OperationInputValidation + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/xray/snapshot/api_op_UpdateTraceSegmentDestination.go.snap b/service/xray/snapshot/api_op_UpdateTraceSegmentDestination.go.snap new file mode 100644 index 00000000000..34b1b7eb243 --- /dev/null +++ b/service/xray/snapshot/api_op_UpdateTraceSegmentDestination.go.snap @@ -0,0 +1,40 @@ +UpdateTraceSegmentDestination + Initialize stack step + spanInitializeStart + RegisterServiceMetadata + legacyEndpointContextSetter + SetLogger + spanInitializeEnd + Serialize stack step + spanBuildRequestStart + setOperationInput + ResolveEndpoint + OperationSerializer + Build stack step + ClientRequestID + ComputeContentLength + UserAgent + AddTimeOffsetMiddleware + RecursionDetection + spanBuildRequestEnd + Finalize stack step + ResolveAuthScheme + GetIdentity + ResolveEndpointV2 + disableHTTPS + ComputePayloadHash + spanRetryLoop + Retry + RetryMetricsHeader + setLegacyContextSigningOptions + Signing + Deserialize stack step + AddRawResponseToMetadata + ErrorCloseResponseBody + CloseResponseBody + ResponseErrorWrapper + RequestIDRetriever + OperationDeserializer + AddTimeOffsetMiddleware + RecordResponseTiming + RequestResponseLogger diff --git a/service/xray/snapshot_test.go b/service/xray/snapshot_test.go index 161eb662158..b6a1f73056a 100644 --- a/service/xray/snapshot_test.go +++ b/service/xray/snapshot_test.go @@ -74,6 +74,18 @@ func TestCheckSnapshot_BatchGetTraces(t *testing.T) { } } +func TestCheckSnapshot_CancelTraceRetrieval(t *testing.T) { + svc := New(Options{}) + _, err := svc.CancelTraceRetrieval(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "CancelTraceRetrieval") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_CreateGroup(t *testing.T) { svc := New(Options{}) _, err := svc.CreateGroup(context.Background(), nil, func(o *Options) { @@ -170,6 +182,18 @@ func TestCheckSnapshot_GetGroups(t *testing.T) { } } +func TestCheckSnapshot_GetIndexingRules(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetIndexingRules(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetIndexingRules") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetInsight(t *testing.T) { svc := New(Options{}) _, err := svc.GetInsight(context.Background(), nil, func(o *Options) { @@ -218,6 +242,18 @@ func TestCheckSnapshot_GetInsightSummaries(t *testing.T) { } } +func TestCheckSnapshot_GetRetrievedTracesGraph(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetRetrievedTracesGraph(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetRetrievedTracesGraph") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetSamplingRules(t *testing.T) { svc := New(Options{}) _, err := svc.GetSamplingRules(context.Background(), nil, func(o *Options) { @@ -290,6 +326,18 @@ func TestCheckSnapshot_GetTraceGraph(t *testing.T) { } } +func TestCheckSnapshot_GetTraceSegmentDestination(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTraceSegmentDestination(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "GetTraceSegmentDestination") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_GetTraceSummaries(t *testing.T) { svc := New(Options{}) _, err := svc.GetTraceSummaries(context.Background(), nil, func(o *Options) { @@ -314,6 +362,18 @@ func TestCheckSnapshot_ListResourcePolicies(t *testing.T) { } } +func TestCheckSnapshot_ListRetrievedTraces(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListRetrievedTraces(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "ListRetrievedTraces") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -374,6 +434,18 @@ func TestCheckSnapshot_PutTraceSegments(t *testing.T) { } } +func TestCheckSnapshot_StartTraceRetrieval(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartTraceRetrieval(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "StartTraceRetrieval") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_TagResource(t *testing.T) { svc := New(Options{}) _, err := svc.TagResource(context.Background(), nil, func(o *Options) { @@ -410,6 +482,18 @@ func TestCheckSnapshot_UpdateGroup(t *testing.T) { } } +func TestCheckSnapshot_UpdateIndexingRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateIndexingRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateIndexingRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestCheckSnapshot_UpdateSamplingRule(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateSamplingRule(context.Background(), nil, func(o *Options) { @@ -421,6 +505,18 @@ func TestCheckSnapshot_UpdateSamplingRule(t *testing.T) { t.Fatal(err) } } + +func TestCheckSnapshot_UpdateTraceSegmentDestination(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateTraceSegmentDestination(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return testSnapshot(stack, "UpdateTraceSegmentDestination") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} func TestUpdateSnapshot_BatchGetTraces(t *testing.T) { svc := New(Options{}) _, err := svc.BatchGetTraces(context.Background(), nil, func(o *Options) { @@ -433,6 +529,18 @@ func TestUpdateSnapshot_BatchGetTraces(t *testing.T) { } } +func TestUpdateSnapshot_CancelTraceRetrieval(t *testing.T) { + svc := New(Options{}) + _, err := svc.CancelTraceRetrieval(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "CancelTraceRetrieval") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_CreateGroup(t *testing.T) { svc := New(Options{}) _, err := svc.CreateGroup(context.Background(), nil, func(o *Options) { @@ -529,6 +637,18 @@ func TestUpdateSnapshot_GetGroups(t *testing.T) { } } +func TestUpdateSnapshot_GetIndexingRules(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetIndexingRules(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetIndexingRules") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetInsight(t *testing.T) { svc := New(Options{}) _, err := svc.GetInsight(context.Background(), nil, func(o *Options) { @@ -577,6 +697,18 @@ func TestUpdateSnapshot_GetInsightSummaries(t *testing.T) { } } +func TestUpdateSnapshot_GetRetrievedTracesGraph(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetRetrievedTracesGraph(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetRetrievedTracesGraph") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetSamplingRules(t *testing.T) { svc := New(Options{}) _, err := svc.GetSamplingRules(context.Background(), nil, func(o *Options) { @@ -649,6 +781,18 @@ func TestUpdateSnapshot_GetTraceGraph(t *testing.T) { } } +func TestUpdateSnapshot_GetTraceSegmentDestination(t *testing.T) { + svc := New(Options{}) + _, err := svc.GetTraceSegmentDestination(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "GetTraceSegmentDestination") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_GetTraceSummaries(t *testing.T) { svc := New(Options{}) _, err := svc.GetTraceSummaries(context.Background(), nil, func(o *Options) { @@ -673,6 +817,18 @@ func TestUpdateSnapshot_ListResourcePolicies(t *testing.T) { } } +func TestUpdateSnapshot_ListRetrievedTraces(t *testing.T) { + svc := New(Options{}) + _, err := svc.ListRetrievedTraces(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "ListRetrievedTraces") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_ListTagsForResource(t *testing.T) { svc := New(Options{}) _, err := svc.ListTagsForResource(context.Background(), nil, func(o *Options) { @@ -733,6 +889,18 @@ func TestUpdateSnapshot_PutTraceSegments(t *testing.T) { } } +func TestUpdateSnapshot_StartTraceRetrieval(t *testing.T) { + svc := New(Options{}) + _, err := svc.StartTraceRetrieval(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "StartTraceRetrieval") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_TagResource(t *testing.T) { svc := New(Options{}) _, err := svc.TagResource(context.Background(), nil, func(o *Options) { @@ -769,6 +937,18 @@ func TestUpdateSnapshot_UpdateGroup(t *testing.T) { } } +func TestUpdateSnapshot_UpdateIndexingRule(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateIndexingRule(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateIndexingRule") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} + func TestUpdateSnapshot_UpdateSamplingRule(t *testing.T) { svc := New(Options{}) _, err := svc.UpdateSamplingRule(context.Background(), nil, func(o *Options) { @@ -780,3 +960,15 @@ func TestUpdateSnapshot_UpdateSamplingRule(t *testing.T) { t.Fatal(err) } } + +func TestUpdateSnapshot_UpdateTraceSegmentDestination(t *testing.T) { + svc := New(Options{}) + _, err := svc.UpdateTraceSegmentDestination(context.Background(), nil, func(o *Options) { + o.APIOptions = append(o.APIOptions, func(stack *middleware.Stack) error { + return updateSnapshot(stack, "UpdateTraceSegmentDestination") + }) + }) + if _, ok := err.(snapshotOK); !ok && err != nil { + t.Fatal(err) + } +} diff --git a/service/xray/types/enums.go b/service/xray/types/enums.go index 42870cf6a5e..c1ebe027f01 100644 --- a/service/xray/types/enums.go +++ b/service/xray/types/enums.go @@ -76,6 +76,33 @@ func (InsightState) Values() []InsightState { } } +type RetrievalStatus string + +// Enum values for RetrievalStatus +const ( + RetrievalStatusScheduled RetrievalStatus = "SCHEDULED" + RetrievalStatusRunning RetrievalStatus = "RUNNING" + RetrievalStatusComplete RetrievalStatus = "COMPLETE" + RetrievalStatusFailed RetrievalStatus = "FAILED" + RetrievalStatusCancelled RetrievalStatus = "CANCELLED" + RetrievalStatusTimeout RetrievalStatus = "TIMEOUT" +) + +// Values returns all known values for RetrievalStatus. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (RetrievalStatus) Values() []RetrievalStatus { + return []RetrievalStatus{ + "SCHEDULED", + "RUNNING", + "COMPLETE", + "FAILED", + "CANCELLED", + "TIMEOUT", + } +} + type SamplingStrategyName string // Enum values for SamplingStrategyName @@ -115,3 +142,61 @@ func (TimeRangeType) Values() []TimeRangeType { "Service", } } + +type TraceFormatType string + +// Enum values for TraceFormatType +const ( + TraceFormatTypeXray TraceFormatType = "XRAY" + TraceFormatTypeOtel TraceFormatType = "OTEL" +) + +// Values returns all known values for TraceFormatType. Note that this can be +// expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TraceFormatType) Values() []TraceFormatType { + return []TraceFormatType{ + "XRAY", + "OTEL", + } +} + +type TraceSegmentDestination string + +// Enum values for TraceSegmentDestination +const ( + TraceSegmentDestinationXRay TraceSegmentDestination = "XRay" + TraceSegmentDestinationCloudWatchLogs TraceSegmentDestination = "CloudWatchLogs" +) + +// Values returns all known values for TraceSegmentDestination. Note that this can +// be expanded in the future, and so it is only as up to date as the client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TraceSegmentDestination) Values() []TraceSegmentDestination { + return []TraceSegmentDestination{ + "XRay", + "CloudWatchLogs", + } +} + +type TraceSegmentDestinationStatus string + +// Enum values for TraceSegmentDestinationStatus +const ( + TraceSegmentDestinationStatusPending TraceSegmentDestinationStatus = "PENDING" + TraceSegmentDestinationStatusActive TraceSegmentDestinationStatus = "ACTIVE" +) + +// Values returns all known values for TraceSegmentDestinationStatus. Note that +// this can be expanded in the future, and so it is only as up to date as the +// client. +// +// The ordering of this slice is not guaranteed to be stable across updates. +func (TraceSegmentDestinationStatus) Values() []TraceSegmentDestinationStatus { + return []TraceSegmentDestinationStatus{ + "PENDING", + "ACTIVE", + } +} diff --git a/service/xray/types/types.go b/service/xray/types/types.go index 386ae56251a..810db2bbe72 100644 --- a/service/xray/types/types.go +++ b/service/xray/types/types.go @@ -235,7 +235,7 @@ type ErrorStatistics struct { // The number of requests that failed with untracked 4xx Client Error status codes. OtherCount *int64 - // The number of requests that failed with a 419 throttling status code. + // The number of requests that failed with a 429 throttling status code. ThrottleCount *int64 // The total number of requests that failed with a 4xx Client Error status code. @@ -322,6 +322,21 @@ type ForecastStatistics struct { noSmithyDocumentSerde } +// The relation between two services. +type GraphLink struct { + + // Destination traces of a link relationship. + DestinationTraceIds []string + + // Relationship of a trace to the corresponding service. + ReferenceType *string + + // Source trace of a link relationship. + SourceTraceId *string + + noSmithyDocumentSerde +} + // Details and metadata for a group. type Group struct { @@ -405,6 +420,59 @@ type Http struct { noSmithyDocumentSerde } +// Rule used to determine the server-side sampling rate for spans ingested +// +// through the CloudWatchLogs destination and indexed by X-Ray. +type IndexingRule struct { + + // Displays when the rule was last modified, in Unix time seconds. + ModifiedAt *time.Time + + // The name of the indexing rule. + Name *string + + // The indexing rule. + Rule IndexingRuleValue + + noSmithyDocumentSerde +} + +// The indexing rule configuration. +// +// The following types satisfy this interface: +// +// IndexingRuleValueMemberProbabilistic +type IndexingRuleValue interface { + isIndexingRuleValue() +} + +// Indexing rule configuration that is used to probabilistically sample traceIds. +type IndexingRuleValueMemberProbabilistic struct { + Value ProbabilisticRuleValue + + noSmithyDocumentSerde +} + +func (*IndexingRuleValueMemberProbabilistic) isIndexingRuleValue() {} + +// Update to an indexing rule. +// +// The following types satisfy this interface: +// +// IndexingRuleValueUpdateMemberProbabilistic +type IndexingRuleValueUpdate interface { + isIndexingRuleValueUpdate() +} + +// Indexing rule configuration that is used to probabilistically sample traceIds. +type IndexingRuleValueUpdateMemberProbabilistic struct { + Value ProbabilisticRuleValueUpdate + + noSmithyDocumentSerde +} + +func (*IndexingRuleValueUpdateMemberProbabilistic) isIndexingRuleValueUpdate() {} + // When fault rates go outside of the expected range, X-Ray creates an insight. // Insights tracks emergent issues within your applications. type Insight struct { @@ -594,6 +662,33 @@ type InstanceIdDetail struct { noSmithyDocumentSerde } +// The indexing rule configuration for probabilistic sampling. +type ProbabilisticRuleValue struct { + + // Configured sampling percentage of traceIds. Note that sampling can be subject + // to limits to ensure completeness of data. + // + // This member is required. + DesiredSamplingPercentage *float64 + + // Applied sampling percentage of traceIds. + ActualSamplingPercentage *float64 + + noSmithyDocumentSerde +} + +// Update to the indexing rule configuration for probabilistic sampling. +type ProbabilisticRuleValueUpdate struct { + + // Configured sampling percentage of traceIds. Note that sampling can be subject + // to limits to ensure completeness of data. + // + // This member is required. + DesiredSamplingPercentage *float64 + + noSmithyDocumentSerde +} + // Statistics that describe how the incident has impacted a service. type RequestImpactStatistics struct { @@ -692,6 +787,39 @@ type ResponseTimeRootCauseService struct { noSmithyDocumentSerde } +// Retrieved information about an application that processed requests, users that +// +// made requests, or downstream services, resources, and applications that an +// application used. +type RetrievedService struct { + + // Relation between two 2 services. + Links []GraphLink + + // Information about an application that processed requests, users that made + // requests, or downstream services, resources, and applications that an + // application used. + Service *Service + + noSmithyDocumentSerde +} + +// Retrieved collection of spans with matching trace IDs. +type RetrievedTrace struct { + + // The length of time in seconds between the start time of the root span and the + // end time of the last span that completed. + Duration *float64 + + // The unique identifier for the span. + Id *string + + // Spans that comprise the trace. + Spans []Span + + noSmithyDocumentSerde +} + // The exception associated with a root cause. type RootCauseException struct { @@ -944,11 +1072,11 @@ type SamplingTargetDocument struct { // downstream service, generated from a subsegment sent by the service that called // it. // -// For the full segment document schema, see [Amazon Web Services X-Ray Segment Documents] in the Amazon Web Services X-Ray +// For the full segment document schema, see [Amazon Web Services X-Ray segment documents] in the Amazon Web Services X-Ray // Developer Guide. // +// [Amazon Web Services X-Ray segment documents]: https://docs.aws.amazon.com/xray/latest/devguide/aws-xray-interface-api.html#xray-api-segmentdocuments // [PutTraceSegments]: https://docs.aws.amazon.com/xray/latest/api/API_PutTraceSegments.html -// [Amazon Web Services X-Ray Segment Documents]: https://docs.aws.amazon.com/xray/latest/devguide/xray-api-segmentdocuments.html type Segment struct { // The segment document. @@ -1057,6 +1185,20 @@ type ServiceStatistics struct { noSmithyDocumentSerde } +// A span from a trace that has been ingested by the X-Ray service. A span +// +// represents a unit of work or an operation performed by a service. +type Span struct { + + // The span document. + Document *string + + // The span ID. + Id *string + + noSmithyDocumentSerde +} + // A map that contains tag keys and tag values to attach to an Amazon Web Services // X-Ray group or sampling rule. For more information about ways to use tags, see [Tagging Amazon Web Services resources] // in the Amazon Web Services General Reference. @@ -1302,4 +1444,6 @@ type UnknownUnionMember struct { noSmithyDocumentSerde } -func (*UnknownUnionMember) isAnnotationValue() {} +func (*UnknownUnionMember) isAnnotationValue() {} +func (*UnknownUnionMember) isIndexingRuleValue() {} +func (*UnknownUnionMember) isIndexingRuleValueUpdate() {} diff --git a/service/xray/types/types_exported_test.go b/service/xray/types/types_exported_test.go index 53522aad773..b8ac6b759a1 100644 --- a/service/xray/types/types_exported_test.go +++ b/service/xray/types/types_exported_test.go @@ -32,3 +32,39 @@ func ExampleAnnotationValue_outputUsage() { var _ *string var _ *bool var _ *float64 + +func ExampleIndexingRuleValue_outputUsage() { + var union types.IndexingRuleValue + // type switches can be used to check the union value + switch v := union.(type) { + case *types.IndexingRuleValueMemberProbabilistic: + _ = v.Value // Value is types.ProbabilisticRuleValue + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ProbabilisticRuleValue + +func ExampleIndexingRuleValueUpdate_outputUsage() { + var union types.IndexingRuleValueUpdate + // type switches can be used to check the union value + switch v := union.(type) { + case *types.IndexingRuleValueUpdateMemberProbabilistic: + _ = v.Value // Value is types.ProbabilisticRuleValueUpdate + + case *types.UnknownUnionMember: + fmt.Println("unknown tag:", v.Tag) + + default: + fmt.Println("union is nil or unknown type") + + } +} + +var _ *types.ProbabilisticRuleValueUpdate diff --git a/service/xray/validators.go b/service/xray/validators.go index c6c575022af..4f1c1c960a5 100644 --- a/service/xray/validators.go +++ b/service/xray/validators.go @@ -30,6 +30,26 @@ func (m *validateOpBatchGetTraces) HandleInitialize(ctx context.Context, in midd return next.HandleInitialize(ctx, in) } +type validateOpCancelTraceRetrieval struct { +} + +func (*validateOpCancelTraceRetrieval) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpCancelTraceRetrieval) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*CancelTraceRetrievalInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpCancelTraceRetrievalInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpCreateGroup struct { } @@ -170,6 +190,26 @@ func (m *validateOpGetInsightSummaries) HandleInitialize(ctx context.Context, in return next.HandleInitialize(ctx, in) } +type validateOpGetRetrievedTracesGraph struct { +} + +func (*validateOpGetRetrievedTracesGraph) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpGetRetrievedTracesGraph) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*GetRetrievedTracesGraphInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpGetRetrievedTracesGraphInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpGetSamplingTargets struct { } @@ -270,6 +310,26 @@ func (m *validateOpGetTraceSummaries) HandleInitialize(ctx context.Context, in m return next.HandleInitialize(ctx, in) } +type validateOpListRetrievedTraces struct { +} + +func (*validateOpListRetrievedTraces) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpListRetrievedTraces) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*ListRetrievedTracesInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpListRetrievedTracesInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpListTagsForResource struct { } @@ -370,6 +430,26 @@ func (m *validateOpPutTraceSegments) HandleInitialize(ctx context.Context, in mi return next.HandleInitialize(ctx, in) } +type validateOpStartTraceRetrieval struct { +} + +func (*validateOpStartTraceRetrieval) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpStartTraceRetrieval) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*StartTraceRetrievalInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpStartTraceRetrievalInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpTagResource struct { } @@ -410,6 +490,26 @@ func (m *validateOpUntagResource) HandleInitialize(ctx context.Context, in middl return next.HandleInitialize(ctx, in) } +type validateOpUpdateIndexingRule struct { +} + +func (*validateOpUpdateIndexingRule) ID() string { + return "OperationInputValidation" +} + +func (m *validateOpUpdateIndexingRule) HandleInitialize(ctx context.Context, in middleware.InitializeInput, next middleware.InitializeHandler) ( + out middleware.InitializeOutput, metadata middleware.Metadata, err error, +) { + input, ok := in.Parameters.(*UpdateIndexingRuleInput) + if !ok { + return out, metadata, fmt.Errorf("unknown input parameters type %T", in.Parameters) + } + if err := validateOpUpdateIndexingRuleInput(input); err != nil { + return out, metadata, err + } + return next.HandleInitialize(ctx, in) +} + type validateOpUpdateSamplingRule struct { } @@ -434,6 +534,10 @@ func addOpBatchGetTracesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpBatchGetTraces{}, middleware.After) } +func addOpCancelTraceRetrievalValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpCancelTraceRetrieval{}, middleware.After) +} + func addOpCreateGroupValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpCreateGroup{}, middleware.After) } @@ -462,6 +566,10 @@ func addOpGetInsightSummariesValidationMiddleware(stack *middleware.Stack) error return stack.Initialize.Add(&validateOpGetInsightSummaries{}, middleware.After) } +func addOpGetRetrievedTracesGraphValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpGetRetrievedTracesGraph{}, middleware.After) +} + func addOpGetSamplingTargetsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetSamplingTargets{}, middleware.After) } @@ -482,6 +590,10 @@ func addOpGetTraceSummariesValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpGetTraceSummaries{}, middleware.After) } +func addOpListRetrievedTracesValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpListRetrievedTraces{}, middleware.After) +} + func addOpListTagsForResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpListTagsForResource{}, middleware.After) } @@ -502,6 +614,10 @@ func addOpPutTraceSegmentsValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpPutTraceSegments{}, middleware.After) } +func addOpStartTraceRetrievalValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpStartTraceRetrieval{}, middleware.After) +} + func addOpTagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpTagResource{}, middleware.After) } @@ -510,10 +626,48 @@ func addOpUntagResourceValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUntagResource{}, middleware.After) } +func addOpUpdateIndexingRuleValidationMiddleware(stack *middleware.Stack) error { + return stack.Initialize.Add(&validateOpUpdateIndexingRule{}, middleware.After) +} + func addOpUpdateSamplingRuleValidationMiddleware(stack *middleware.Stack) error { return stack.Initialize.Add(&validateOpUpdateSamplingRule{}, middleware.After) } +func validateIndexingRuleValueUpdate(v types.IndexingRuleValueUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "IndexingRuleValueUpdate"} + switch uv := v.(type) { + case *types.IndexingRuleValueUpdateMemberProbabilistic: + if err := validateProbabilisticRuleValueUpdate(&uv.Value); err != nil { + invalidParams.AddNested("[Probabilistic]", err.(smithy.InvalidParamsError)) + } + + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + +func validateProbabilisticRuleValueUpdate(v *types.ProbabilisticRuleValueUpdate) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ProbabilisticRuleValueUpdate"} + if v.DesiredSamplingPercentage == nil { + invalidParams.Add(smithy.NewErrParamRequired("DesiredSamplingPercentage")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateSamplingRule(v *types.SamplingRule) error { if v == nil { return nil @@ -670,6 +824,21 @@ func validateOpBatchGetTracesInput(v *BatchGetTracesInput) error { } } +func validateOpCancelTraceRetrievalInput(v *CancelTraceRetrievalInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "CancelTraceRetrievalInput"} + if v.RetrievalToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("RetrievalToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpCreateGroupInput(v *CreateGroupInput) error { if v == nil { return nil @@ -798,6 +967,21 @@ func validateOpGetInsightSummariesInput(v *GetInsightSummariesInput) error { } } +func validateOpGetRetrievedTracesGraphInput(v *GetRetrievedTracesGraphInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "GetRetrievedTracesGraphInput"} + if v.RetrievalToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("RetrievalToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpGetSamplingTargetsInput(v *GetSamplingTargetsInput) error { if v == nil { return nil @@ -886,6 +1070,21 @@ func validateOpGetTraceSummariesInput(v *GetTraceSummariesInput) error { } } +func validateOpListRetrievedTracesInput(v *ListRetrievedTracesInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "ListRetrievedTracesInput"} + if v.RetrievalToken == nil { + invalidParams.Add(smithy.NewErrParamRequired("RetrievalToken")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpListTagsForResourceInput(v *ListTagsForResourceInput) error { if v == nil { return nil @@ -968,6 +1167,27 @@ func validateOpPutTraceSegmentsInput(v *PutTraceSegmentsInput) error { } } +func validateOpStartTraceRetrievalInput(v *StartTraceRetrievalInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "StartTraceRetrievalInput"} + if v.TraceIds == nil { + invalidParams.Add(smithy.NewErrParamRequired("TraceIds")) + } + if v.StartTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("StartTime")) + } + if v.EndTime == nil { + invalidParams.Add(smithy.NewErrParamRequired("EndTime")) + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpTagResourceInput(v *TagResourceInput) error { if v == nil { return nil @@ -1008,6 +1228,28 @@ func validateOpUntagResourceInput(v *UntagResourceInput) error { } } +func validateOpUpdateIndexingRuleInput(v *UpdateIndexingRuleInput) error { + if v == nil { + return nil + } + invalidParams := smithy.InvalidParamsError{Context: "UpdateIndexingRuleInput"} + if v.Name == nil { + invalidParams.Add(smithy.NewErrParamRequired("Name")) + } + if v.Rule == nil { + invalidParams.Add(smithy.NewErrParamRequired("Rule")) + } else if v.Rule != nil { + if err := validateIndexingRuleValueUpdate(v.Rule); err != nil { + invalidParams.AddNested("Rule", err.(smithy.InvalidParamsError)) + } + } + if invalidParams.Len() > 0 { + return invalidParams + } else { + return nil + } +} + func validateOpUpdateSamplingRuleInput(v *UpdateSamplingRuleInput) error { if v == nil { return nil